summaryrefslogtreecommitdiff
path: root/usr.bin/libtool
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2012-07-12 11:43:47 +0000
committerMarc Espie <espie@cvs.openbsd.org>2012-07-12 11:43:47 +0000
commit0f12fed65402717e3de79cde1fe04733e8908ca2 (patch)
tree5886e9fb085c3751063c3f92b1973ef329fbc9c9 /usr.bin/libtool
parentcf5415601865a11c738fca4708629d11db36ac9c (diff)
deal with -pthread as a "once on" option.
Diffstat (limited to 'usr.bin/libtool')
-rw-r--r--usr.bin/libtool/LT/LaFile.pm3
-rw-r--r--usr.bin/libtool/LT/Parser.pm12
-rw-r--r--usr.bin/libtool/LT/Program.pm5
3 files changed, 9 insertions, 11 deletions
diff --git a/usr.bin/libtool/LT/LaFile.pm b/usr.bin/libtool/LT/LaFile.pm
index 4a6562a0727..a2a1aa93358 100644
--- a/usr.bin/libtool/LT/LaFile.pm
+++ b/usr.bin/libtool/LT/LaFile.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: LaFile.pm,v 1.14 2012/07/12 09:43:34 espie Exp $
+# $OpenBSD: LaFile.pm,v 1.15 2012/07/12 11:43:46 espie Exp $
# Copyright (c) 2007-2010 Steven Mestdagh <steven@openbsd.org>
# Copyright (c) 2012 Marc Espie <espie@openbsd.org>
@@ -334,6 +334,7 @@ sub link
@cmd = @$ltprog;
push @cmd, $ltconfig->sharedflag, @{$ltconfig->picflags};
push @cmd, '-o', $dst;
+ push @cmd, '-pthread' if $parser->{pthread};
push @cmd, @$args if $args;
push @cmd, @$objs if @$objs;
push @cmd, '-Wl,-whole-archive', @$staticlibs, '-Wl,-no-whole-archive'
diff --git a/usr.bin/libtool/LT/Parser.pm b/usr.bin/libtool/LT/Parser.pm
index 82634eaa8a7..42b5be32553 100644
--- a/usr.bin/libtool/LT/Parser.pm
+++ b/usr.bin/libtool/LT/Parser.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: Parser.pm,v 1.9 2012/07/12 09:43:34 espie Exp $
+# $OpenBSD: Parser.pm,v 1.10 2012/07/12 11:43:46 espie Exp $
# Copyright (c) 2007-2010 Steven Mestdagh <steven@openbsd.org>
# Copyright (c) 2012 Marc Espie <espie@openbsd.org>
@@ -131,11 +131,8 @@ sub internal_parse_linkargs1
tsay {" processing $a"};
if (!$a || $a eq '' || $a =~ m/^\s+$/) {
# skip empty arguments
- } elsif ($a eq '-pthread' && !$self->{pthread}) {
- # XXX special treatment since it's not a -l flag
- push @$deplibs, $a;
+ } elsif ($a eq '-pthread') {
$self->{pthread} = 1;
- push(@$result, $a);
} elsif ($a =~ m/^-L(.*)/) {
# already read earlier, do nothing
} elsif ($a =~ m/^-R(.*)/) {
@@ -220,6 +217,7 @@ sub parse_linkargs1
$self->{result} = [];
$self->internal_parse_linkargs1($deplibs, $gp, $dirs, $libs,
$self->{args});
+ push(@$deplibs, '-pthread') if $self->{pthread};
$self->{args} = $self->{result};
}
@@ -249,10 +247,8 @@ sub parse_linkargs2
# skip empty arguments
} elsif ($a eq '-lc') {
# don't link explicitly with libc (just remove -lc)
- } elsif ($a eq '-pthread' && !$self->{pthread}) {
- # XXX special treatment since it's not a -l flag
+ } elsif ($a eq '-pthread') {
$self->{pthread} = 1;
- push(@$result, $a);
} elsif ($a =~ m/^-L(.*)/) {
if (!exists $dirs->{$1}) {
$dirs->{$1} = 1;
diff --git a/usr.bin/libtool/LT/Program.pm b/usr.bin/libtool/LT/Program.pm
index caac7c203a1..5aa965eea6f 100644
--- a/usr.bin/libtool/LT/Program.pm
+++ b/usr.bin/libtool/LT/Program.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: Program.pm,v 1.16 2012/07/12 09:48:11 espie Exp $
+# $OpenBSD: Program.pm,v 1.17 2012/07/12 11:43:46 espie Exp $
# Copyright (c) 2007-2010 Steven Mestdagh <steven@openbsd.org>
# Copyright (c) 2012 Marc Espie <espie@openbsd.org>
@@ -188,7 +188,8 @@ sub link
}
@cmd = @$ltprog;
push @cmd, '-o', $dst;
- push @cmd, @$args if ($args);
+ push @cmd, '-pthread' if $parser->{pthread};
+ push @cmd, @$args if $args;
push @cmd, @{$self->{objlist}} if @{$self->{objlist}};
push @cmd, @$staticlibs if @$staticlibs;
push @cmd, "-L$symlinkdir", @libflags if @libflags;