From 752679b4479c6db9322e0845a151e6d4d4716894 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 12 Mar 2012 17:32:47 +0100 Subject: [PATCH] bin/blhc: Another fix for libtool --mode=link. --- bin/blhc | 2 +- t/logs/libtool | 1 + t/tests.t | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/blhc b/bin/blhc index 30bc35a..6156282 100755 --- a/bin/blhc +++ b/bin/blhc @@ -272,7 +272,7 @@ foreach my $line (@input) { # Linker commands. if ($line =~ /\s-l[A-Za-z0-9.-]+(\s|\\|$)/ or $line =~ /^libtool: link: / - or $line =~ m{\s*/bin/bash .+?libtool\s+.+?\s+--mode=(re)?link}) { + or $line =~ m{\s*/bin/bash .+?libtool\s+(.+?\s+)?--mode=(re)?link}) { $compiler = 0; $linker = 1; } diff --git a/t/logs/libtool b/t/logs/libtool index d85ca49..4447a20 100644 --- a/t/logs/libtool +++ b/t/logs/libtool @@ -4,6 +4,7 @@ libtool: link: g++ -shared test-a.o test-b.o test-b.o test-c.o -O2 -pie -Wl,relr libtool: link: g++ -shared test-a.o test-b.o test-b.o test-c.o -O2 -Wl,relro -o test.so libtool: link: gcc -Wl,-z -Wl,relro -o test test.o +/bin/bash ../../../libtool --mode=link cc -Wl,-z,relro -o test.so test.o /bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.o /bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.o /bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.o diff --git a/t/tests.t b/t/tests.t index 6904a7d..5af0780 100644 --- a/t/tests.t +++ b/t/tests.t @@ -308,6 +308,7 @@ is_blhc 'libtool', '--bindnow', 4, LDFLAGS missing (-fPIE): libtool: link: g++ -shared test-a.o test-b.o test-b.o test-c.o -O2 -pie -Wl,relro -Wl,now -o test.so LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: g++ -shared test-a.o test-b.o test-b.o test-c.o -O2 -Wl,relro -o test.so LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z -Wl,relro -o test test.o +LDFLAGS missing (-fPIE -pie -Wl,-z,now): /bin/bash ../../../libtool --mode=link cc -Wl,-z,relro -o test.so test.o LDFLAGS missing (-fPIE -pie -Wl,-z,now): /bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.o LDFLAGS missing (-fPIE -pie -Wl,-z,now): /bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.o LDFLAGS missing (-fPIE -pie -Wl,-z,now): /bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.o -- 2.43.2