This is what I use for my ThreadSanitizer enabled builds. DON'T USE IT 
VERBATIM! (It enables ThreadSanitizer and disables optimizations, etc...)

TL;DR The part you want is -Wl,-rpath=$PREFIX/lib

If that doesn't work, experiment with -Wl,--enable-new-dtags vs 
-Wl,--disable-new-dtags (see here for explanation: 
https://stackoverflow.com/questions/52018092/how-to-set-rpath-and-runpath-with-gcc-ld)

Also there's always an option to add the paths where you installed the updated 
libraries to /etc/ld.so.conf (or to /etc/ld.so.conf.d/local.conf).

Cheers,
Ondřej

$ cat tsan-env
#!/bin/sh
export CC="${CC:-clang-18}"
export PREFIX="$HOME/.tsan-${CC}"
case "$CC" in
        clang-*) export CXX=clang++-${CC#clang-} ;;
        gcc-*) export CXX=g++-${CC#gcc-} ;;
        *) exit 1 ;;
esac
export CFLAGS="$CFLAGS -rdynamic -ggdb -O0 -Wno-deprecated-declarations 
-fno-omit-frame-pointer -fno-optimize-sibling-calls -fPIC -fsanitize=thread 
-Wl,-rpath=$PREFIX/lib -Wl,--enable-new-dtags"
export CXXFLAGS="$CXXFLAGS -rdynamic -ggdb -O0 -Wno-deprecated-declarations 
-fno-omit-frame-pointer -fno-optimize-sibling-calls -fPIC -fsanitize=thread 
-Wl,-rpath=$PREFIX/lib -Wl,--enable-new-dtags"
export LDFLAGS="$LDFLAGS -fPIE -fsanitize=thread -Wl,-rpath=$PREFIX/lib 
-Wl,--enable-new-dtags"
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"
export PATH="$PREFIX/sbin:$PREFIX/bin:$PATH"

$ cat build
#!/bin/sh

. ./tsan-env

rm -rf "$PREFIX"

# OpenSSL (skip, it takes too long)
#        ./config no-asm no-ssl3 no-comp no-weak-ssl-ciphers --prefix="$PREFIX" 
&& \
(cd openssl && \
         git clean -xdf && \
         git reset --hard HEAD && \
         ./config no-ssl3 no-weak-ssl-ciphers --prefix="$PREFIX" 
--libdir="$PREFIX/lib" && \
         make -j && \
         make install_sw)

# libuv
(cd libuv && \
         git clean -xdf && \
         git reset --hard HEAD && \
         ./autogen.sh && \
         ./configure --prefix="$PREFIX" && \
         make -j && \
         make install
)

# userspace-rcu
(cd userspace-rcu && \
         git clean -xdf && \
         git reset --hard HEAD && \
         ./bootstrap &&  \
         ./configure --prefix="$PREFIX" --enable-compiler-atomic-builtins 
--disable-legacy-mb && \
         make -j && \
         make install
)


--
Ondřej Surý (He/Him)
ond...@isc.org

My working hours and your working hours may be different. Please do not feel 
obligated to reply outside your normal working hours.

> On 22. 12. 2023, at 16:44, William D. Colburn <wcolb...@nrao.edu> wrote:
> 
> Your build system did say to manually change it.  I used an environment
> variable, but thought (still think actually) that yhour build system
> should honor pkgconfig for finding packages.


-- 
Visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from 
this list

ISC funds the development of this software with paid support subscriptions. 
Contact us at https://www.isc.org/contact/ for more information.


bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Reply via email to