From 582b1a95f51e4e7ff817acc6a59b42414d7d998f Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Mon, 27 Apr 2026 17:39:03 -0500 Subject: [PATCH] build: build static module archives with PIC Pass [pic-only] to LT_INIT so libtool emits PIC objects for the `-static` module archives (libdaq_static_afpacket.a and friends). Without this, on Linux toolchains that default to PIE (Ubuntu 22.04+, recent Debian and Fedora), linking those archives into a PIE executable fails with: relocation R_X86_64_32S against `.bss' can not be used when making a PIE object; recompile with -fPIE Snort 3 with --enable-static-daq is the most common path that hits this. The workaround until now has been to pass CFLAGS=-fPIC at configure time, which is easy to miss. Making PIC the default removes the foot-gun at negligible runtime cost on x86_64. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d6ba8d6..97ad377 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ AC_PROG_SED AX_CXX_COMPILE_STDCXX_11(,optional) -LT_INIT +LT_INIT([pic-only]) # Initialize pkg-config since we are installing a .pc file PKG_INSTALLDIR