From fe9d0d4971ff25e278b744ad89e3724ee42f67b0 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Thu, 15 Mar 2012 20:59:30 +0100 Subject: [PATCH] Also support -fpic in -fPIE/-fPIC conflict detection. --- bin/blhc | 2 +- t/logs/bad-library | 2 +- t/logs/good-library | 2 +- t/tests.t | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/blhc b/bin/blhc index b2188ee..210f0ac 100755 --- a/bin/blhc +++ b/bin/blhc @@ -87,7 +87,7 @@ sub pic_pie_conflict { my ($line, $pie, $missing_flags_ref, @flags_pie) = @_; return 0 if not $pie; - return 0 if not any_flags_used($line, ('-fPIC')); + return 0 if not any_flags_used($line, ('-fPIC', '-fpic')); my %flags = map { $_ => 1 } @flags_pie; diff --git a/t/logs/bad-library b/t/logs/bad-library index d4c5c23..811b711 100644 --- a/t/logs/bad-library +++ b/t/logs/bad-library @@ -5,4 +5,4 @@ gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,--as-needed -o libtest.so 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 +/usr/bin/g++ -shared -fpic -o libtest-6.1.so.0 test.o -ltiff -lz diff --git a/t/logs/good-library b/t/logs/good-library index 6c21470..5447520 100644 --- a/t/logs/good-library +++ b/t/logs/good-library @@ -6,4 +6,4 @@ gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,relro -Wl,now -Wl,--as-neede 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 +/usr/bin/g++ -shared -fpic -Wl,-z,relro -Wl,-z,now -o libtest-6.1.so.0 test.o -ltiff -lz diff --git a/t/tests.t b/t/tests.t index b94d976..485752a 100644 --- a/t/tests.t +++ b/t/tests.t @@ -288,7 +288,7 @@ LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -W LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,--as-needed -o libtest.so LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC test.o -Wl,-z -Wl,relro -o .libs/libtest.so.1.0.0 LDFLAGS missing (-Wl,-z,relro -fPIE -pie): 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): /usr/bin/g++ -shared -fpic -o libtest-6.1.so.0 test.o -ltiff -lz "; -- 2.45.2