ngrep: fix static linking issue with libpcre
PATCH v2 1/1 ngrep: fix static linking issue with libpcre
Adding -lpcre in LDFLAGS place the library before object files:
gcc ... -lpcre -L .../sysroot/usr/lib -s -o ngrep ngrep.o -lpcap
Makefile.in is patched to use @LIBS@ for adding -lpcre in the right place.
Fixes:
http://autobuild.buildroot.net/results/684/684a3bed28d13ef5e5156257aade3b9aff32f180
--- package/ngrep/ngrep-1.45-Makefile.in.patch | 23 +++++++++++++++++++++++ package/ngrep/ngrep.mk | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 package/ngrep/ngrep-1.45-Makefile.in.patch
package/ngrep/ngrep-1.45-Makefile.in.patch new file +23 -0
@@ -0,0 +1,23 @@ +Use LIBS for adding libraries. + +Signed-off-by: Romain Naour <[email protected]> +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 2ae4506..3eefc0a 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -11,7 +11,7 @@ CFLAGS=@CFLAGS@ -D at OS@ @DEFS@ @EXTRA_DEFINES@ + INCLUDES=-I at srcdir@ @PCAP_INCLUDE@ @EXTRA_INCLUDES@ + + LDFLAGS=@LDFLAGS@ @PCAP_LINK@ +-LIBS=-lpcap @EXTRA_LIBS@ ++LIBS=@LIBS@ @EXTRA_LIBS@ + + STRIPFLAG=@STRIPFLAG@ + +-- +1.8.4 +
package/ngrep/ngrep.mk +1 -1
@@ -8,7 +8,7 @@ NGREP_VERSION = 1.45 NGREP_SOURCE = ngrep-$(NGREP_VERSION).tar.bz2 NGREP_SITE = http://downloads.sourceforge.net/project/ngrep/ngrep/$(NGREP_VERSION) NGREP_INSTALL_STAGING = YES -NGREP_CONF_ENV = LDFLAGS="-lpcre" +NGREP_CONF_ENV = LIBS="-lpcre" NGREP_CONF_OPT = \ --with-pcap-includes=$(STAGING_DIR)/usr/include \ --enable-pcre \
Signature · 1 line
1.8.4
PATCH v2 1/1 ngrep: fix static linking issue with libpcre
Dear Romain Naour,
Quoted 10 lines · Romain Naour
Adding -lpcre in LDFLAGS place the library before object files:
gcc ... -lpcre -L .../sysroot/usr/lib -s -o ngrep ngrep.o -lpcapMakefile.in is patched to use @LIBS@ for adding -lpcre in the right place.
Fixes:
http://autobuild.buildroot.net/results/684/684a3bed28d13ef5e5156257aade3b9aff32f180Signed-off-by Romain Naour <[email protected]>
Thanks, but this patch no longer applies on top of master, and more importantly, the ngrep-1.45-Makefile.in.patch doesn't apply to the ngrep sources. Could you rename the ngrep patches to use numbers, i.e ngrep-01-<foo>.patch, and use a more descriptive name than ngrep-1.45-Makefile.in.patch?
(Should be done in two patches: one renaming the existing patches, one adding the pcre static link fix).
Thanks a lot!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 1/1 ngrep: fix static linking issue with libpcre
Le 01/11/2013 17:59, Thomas Petazzoni a ?crit :
Quoted 18 lines
Dear Romain Naour,
Quoted 9 lines · Romain Naour
Adding -lpcre in LDFLAGS place the library before object files:
gcc ... -lpcre -L .../sysroot/usr/lib -s -o ngrep ngrep.o -lpcapMakefile.in is patched to use @LIBS@ for adding -lpcre in the right place.
Fixes:
http://autobuild.buildroot.net/results/684/684a3bed28d13ef5e5156257aade3b9aff32f180Signed-off-by Romain Naour <[email protected]>Thanks, but this patch no longer applies on top of master, and more importantly, the ngrep-1.45-Makefile.in.patch doesn't apply to the ngrep sources. Could you rename the ngrep patches to use numbers, i.e ngrep-01-<foo>.patch, and use a more descriptive name than ngrep-1.45-Makefile.in.patch?
Quoted 6 lines
(Should be done in two patches: one renaming the existing patches, one adding the pcre static link fix).
Thanks a lot!
Thomas
Hi Thomas,
Ok, I'll send two patches to fix this issue.
Best regards,
Romain