summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2018-04-07 17:54:55 +0000
committerMarc Espie <espie@cvs.openbsd.org>2018-04-07 17:54:55 +0000
commit06b99823c11f083b3246ac029544a0bf36769035 (patch)
tree97a32a46926c7b0d9f362635fd65b4535cfc66f7 /usr.bin
parentab47fcf0c43eeb5c8bf28f84e1e38680dbf28268 (diff)
have libtool do libtool work, mainly work around exec limitations by
using ar @file construct. okay aja@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/libtool/LT/Mode/Link/Library.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.bin/libtool/LT/Mode/Link/Library.pm b/usr.bin/libtool/LT/Mode/Link/Library.pm
index 2c8ad9bfe66..0f71d5aef85 100644
--- a/usr.bin/libtool/LT/Mode/Link/Library.pm
+++ b/usr.bin/libtool/LT/Mode/Link/Library.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: Library.pm,v 1.5 2014/04/16 14:39:06 zhuk Exp $
+# $OpenBSD: Library.pm,v 1.6 2018/04/07 17:54:54 espie Exp $
# Copyright (c) 2007-2010 Steven Mestdagh <steven@openbsd.org>
# Copyright (c) 2012 Marc Espie <espie@openbsd.org>
@@ -96,7 +96,19 @@ sub link
}
push @cmd, @libflags if @libflags;
push @cmd, @$objs if @$objs;
+ my ($fh, $file);
+
+ if (@cmd > 512) {
+ use OpenBSD::MkTemp qw(mkstemp);
+ my @extra = splice(@cmd, 512);
+ ($fh, $file) = mkstemp("/tmp/arargs.XXXXXXXXXXXX");
+ print $fh map {"$_\n"} @extra;
+ close $fh;
+ push @cmd, "\@$file";
+ }
LT::Exec->link(@cmd);
+ unlink($file) if defined $file;
+
LT::Exec->link('ranlib', $dst);
return;
}