]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Better handling of the `dlsym` missing symbol in our Rust lib 15338/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 21 Mar 2025 08:53:23 +0000 (09:53 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 21 Mar 2025 09:18:24 +0000 (10:18 +0100)
builder-support/debian/dnsdist/debian-bookworm/rules
builder-support/debian/dnsdist/debian-bullseye/rules
builder-support/specs/dnsdist.spec
pdns/dnsdistdist/meson.build

index ee60781ecfa45eaf1e1f7abd16a021b78f0a3e20..2888faadf31d9dc887e1f04d1fa2a58a814c05d4 100755 (executable)
@@ -42,10 +42,9 @@ override_dh_auto_clean:
 #LDFLAGS += -latomic
 # We need clang (LLVM) to link the Rust static library and the C++ code with LTO enabled
 # build-id SHA1 prevents an issue with the debug symbols ("export: `-Wl,--build-id=sha1': not a valid identifier")
-# and the -ldl an issue with the dlsym not being found ("ld.lld: error: undefined symbol: dlsym eferenced by weak.rs:142 (library/std/src/sys/pal/unix/weak.rs:142) [...] in archive ./dnsdist-rust-lib/rust/libdnsdist_rust.a)
 
 override_dh_auto_configure:
-       LDFLAGS="-latomic -fuse-ld=lld -Wl,--build-id=sha1 -ldl" \
+       LDFLAGS="-latomic -fuse-ld=lld -Wl,--build-id=sha1" \
        CC=clang \
        CXX=clang++ \
        PKG_CONFIG_PATH=/opt/lib/pkgconfig dh_auto_configure -- \
index 81b9bf7c95650c9770d14ea8c255b5dc88871380..db6f96b4b681d1c1ded26c80db8a99bd266c7473 100755 (executable)
@@ -35,10 +35,9 @@ override_dh_auto_clean:
 #LDFLAGS += -latomic
 # We need clang (LLVM) to link the Rust static library and the C++ code with LTO enabled
 # build-id SHA1 prevents an issue with the debug symbols ("export: `-Wl,--build-id=sha1': not a valid identifier")
-# and the -ldl an issue with the dlsym not being found ("ld.lld: error: undefined symbol: dlsym eferenced by weak.rs:142 (library/std/src/sys/pal/unix/weak.rs:142) [...] in archive ./dnsdist-rust-lib/rust/libdnsdist_rust.a)
 
 override_dh_auto_configure:
-       LDFLAGS="-latomic -fuse-ld=lld -Wl,--build-id=sha1 -ldl" \
+       LDFLAGS="-latomic -fuse-ld=lld -Wl,--build-id=sha1" \
        CC=clang \
        CXX=clang++ \
        PKG_CONFIG_PATH=/opt/lib/pkgconfig dh_auto_configure -- \
index b7181686d7a7ffeca747a122d4eb1c0dc5ade09c..ffc1d6a31e2707c0a33079cba228dc66b57184e0 100644 (file)
@@ -73,8 +73,7 @@ dnsdist is a high-performance DNS loadbalancer that is scriptable in Lua.
 export CC=clang
 export CXX=clang++
 # build-id SHA1 prevents an issue with the debug symbols ("export: `-Wl,--build-id=sha1': not a valid identifier")
-# and -ldl an issue with the dlsym not being found ("ld.lld: error: undefined symbol: dlsym eferenced by weak.rs:142 (library/std/src/sys/pal/unix/weak.rs:142) [...] in archive ./dnsdist-rust-lib/rust/libdnsdist_rust.a)
-export LDFLAGS="-fuse-ld=lld -Wl,--build-id=sha1 -ldl"
+export LDFLAGS="-fuse-ld=lld -Wl,--build-id=sha1"
 
 %if 0%{?rhel} < 9
 # starting with EL-9 we get these hardening settings for free by just setting the right toolchain (see above)
index 039486d2fc934be777abd2836863b94103e6e611..3e2ae9402032d1ebffaa68e7f35635fe3e59a2a2 100644 (file)
@@ -108,8 +108,10 @@ endif
 
 if get_option('yaml').allowed()
   subdir('dnsdist-rust-lib')
+  subdir('meson' / 'dlopen') # our Rust static library needs dlopen
 else
   dep_dnsdist_rust_lib = declare_dependency()
+  dep_dlopen = declare_dependency()
 endif
 
 common_sources += files(
@@ -335,6 +337,7 @@ deps = [
   dep_arc4random,
   dep_boost,
   dep_cdb,
+  dep_dlopen,
   dep_dnstap,
   dep_htmlfiles,
   dep_ipcrypt,