From: Remi Gacogne Date: Thu, 6 Mar 2025 09:04:50 +0000 (+0100) Subject: dnsdist: Test building packages without `-Wl,--no-as-needed` X-Git-Tag: dnsdist-2.0.0-alpha1~30^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b620e00c83aa4ec048efbec4f46ef2bebfb40a8f;p=thirdparty%2Fpdns.git dnsdist: Test building packages without `-Wl,--no-as-needed` --- diff --git a/builder-support/debian/dnsdist/debian-bookworm/rules b/builder-support/debian/dnsdist/debian-bookworm/rules index d6ab520fa4..e25401a510 100755 --- a/builder-support/debian/dnsdist/debian-bookworm/rules +++ b/builder-support/debian/dnsdist/debian-bookworm/rules @@ -42,13 +42,10 @@ 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 --no-as-needed -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) -# LDFLAGS += -fuse-ld=lld -Wl,--build-id=sha1 -Wl,--no-as-needed -ldl -# CC=clang -# CXX=clang++ +# 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 -Wl,--no-as-needed -ldl" \ + LDFLAGS="-latomic -fuse-ld=lld -Wl,--build-id=sha1 -ldl" \ CC=clang \ CXX=clang++ \ PKG_CONFIG_PATH=/opt/lib/pkgconfig dh_auto_configure -- \ diff --git a/builder-support/debian/dnsdist/debian-buster/rules b/builder-support/debian/dnsdist/debian-buster/rules index a19db4f1b9..9bd76d0d17 100755 --- a/builder-support/debian/dnsdist/debian-buster/rules +++ b/builder-support/debian/dnsdist/debian-buster/rules @@ -12,8 +12,8 @@ include /usr/share/dpkg/default.mk 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 --no-as-needed -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) -LDFLAGS += -fuse-ld=lld -Wl,--build-id=sha1 -Wl,--no-as-needed -ldl +# 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) +LDFLAGS += -fuse-ld=lld -Wl,--build-id=sha1 -ldl CC=clang CXX=clang++ diff --git a/builder-support/specs/dnsdist.spec b/builder-support/specs/dnsdist.spec index 12284be1ba..bf9da0a1c1 100644 --- a/builder-support/specs/dnsdist.spec +++ b/builder-support/specs/dnsdist.spec @@ -73,8 +73,8 @@ 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 the --no-as-needed -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 -Wl,--no-as-needed -ldl" +# 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" %if 0%{?rhel} < 9 export CFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -gdwarf-4" export CXXFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -gdwarf-4"