From b9a9d5481c7d37c26b0c74357bb78e74a2250295 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 17 Mar 2012 22:25:41 +0100 Subject: [PATCH] Correctly detect linking for CGI binaries (e.g. test.cgi). --- bin/blhc | 3 ++- t/logs/bad-library | 2 ++ t/logs/good-library | 2 ++ t/tests.t | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/blhc b/bin/blhc index d089931..9430479 100755 --- a/bin/blhc +++ b/bin/blhc @@ -414,7 +414,8 @@ for (my $i = 0; $i < scalar @input; $i++) { (?:[/.A-Za-z0-9~_-]+/)? # path to file [A-Za-z0-9~_-]+ # binary name (no dots!) (?:[0-9.]*\.so[0-9.]*[a-z]? # library (including version) - |\.la)? + |\.la + |\.cgi)? # CGI binary (?:\s|\\|$) # end of file name }x or $line =~ /^libtool: link: / diff --git a/t/logs/bad-library b/t/logs/bad-library index 831afd9..383a8db 100644 --- a/t/logs/bad-library +++ b/t/logs/bad-library @@ -8,3 +8,5 @@ gcc -shared -fPIC test.o -Wl,-z -Wl,relro -o .libs/libtest.so.1.0.0 gcc -shared -o libtest.so.0d ./test-a.o test/./test-b.o -Wl,-z,now -lpthread -ldl /usr/bin/g++ -shared -fpic -o libtest-6.1.so.0 test.o -ltiff -lz + +gcc -Wl,--as-needed -fPIE -pie -o test.cgi test.o -lgcrypt diff --git a/t/logs/good-library b/t/logs/good-library index 7d6a0ec..a104f0d 100644 --- a/t/logs/good-library +++ b/t/logs/good-library @@ -9,3 +9,5 @@ gcc -shared -fPIC test.o -Wl,-z -Wl,relro -Wl,now -o .libs/libtest.so.1.0.0 gcc -shared -fPIE -pie -o libtest.so.0d ./test-a.o test/./test-b.o -Wl,-z,relro -Wl,-z,now -lpthread -ldl /usr/bin/g++ -shared -fpic -Wl,-z,relro -Wl,-z,now -o libtest-6.1.so.0 test.o -ltiff -lz + +gcc -Wl,-z,now -Wl,-z,relro -Wl,--as-needed -fPIE -pie -o test.cgi test.o -lgcrypt diff --git a/t/tests.t b/t/tests.t index fa1eab8..f336cad 100644 --- a/t/tests.t +++ b/t/tests.t @@ -296,6 +296,7 @@ LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -shared -fPIC -DPIC libtest.o -lp LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC test.o -Wl,-z -Wl,relro -o .libs/libtest.so.1.0.0 LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -shared -o libtest.so.0d ./test-a.o test/./test-b.o -Wl,-z,now -lpthread -ldl LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): /usr/bin/g++ -shared -fpic -o libtest-6.1.so.0 test.o -ltiff -lz +LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -Wl,--as-needed -fPIE -pie -o test.cgi test.o -lgcrypt '; -- 2.43.2