csmith-project / creduce

C-Reduce, a C and C++ program reducer
Other
1.23k stars 125 forks source link

Add -rpath config to handle case where LLVM libraries are not install… #274

Open yuxuanchen1997 opened 4 months ago

yuxuanchen1997 commented 4 months ago

…ed on a system path

If I supply a path to an LLVM installation with ./configure --with-llvm="$HOME/llvm-18/" --disable-trans-assert --cache=.cache --prefix="$HOME/creduce-install/", the built clang_delta binary's dynamic linkage to libclang-cpp.so is broken.

This patch adds -rpath to the linker flags for clang_delta. After the change, I ran

./bootstrap
./configure --with-llvm="$HOME/llvm-18/" --disable-trans-assert --cache=.cache --prefix="$HOME/creduce-install/"
make -j $(nproc)
make install

And ran ldd clang_delta

clang_delta:
        linux-vdso.so.1 (0x00007ffda37da000)
        libclang-cpp.so.18rc => /home/ych/llvm-18/lib/libclang-cpp.so.18rc (0x00007fec2ec00000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fec2eb25000)
        libz.so.1 => /lib64/libz.so.1 (0x00007fec38be6000)
        libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007fec2eaf5000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fec2e800000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fec2eada000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fec2e400000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fec3a36b000)