On Sun, Jul 31, 2016 at 07:21:39PM +0200, Antoine Jacoutot wrote:
> On July 31, 2016 7:14:21 PM GMT+02:00, [email protected] wrote:
> >
> >Making read(2) return EISDIR for directories breaks two ports, both
> >because they use libtool -bindir. cc(1) gets executed with an unknown
> >option, -bindir, and a path such as /usr/local/bin, which then gets
> >passed to ld(1). ld(1) copes with read(2) returning 0, not with
> >EISDIR.
> >Thanks to Antoine who ran the bulk builds that exposed this problem.
> >
> >-bindir support is meaningless on OpenBSD so handling that option
> >should
> >be easy. The problem is that I don't know how to implement it in
> >libtool(1). GNU libtool recognizes -bindir among cc flags, while our
> >version seems to only handle options passed right after argv[0].
> >
> >I plan to work around that problem by using GNU libtool for the ports
> >mentioned above, but someone else might want to poke at libtool(1)
> >internals. :)
> >
> >--
> >jca | PGP: 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524
> >E7EE
>
> I can have a look at it during g2k16 if no one beats me to it.
> --
> Antoine
Hi Jeremie.
This seems to do the trick for me:
Index: LT/Getopt.pm
===================================================================
RCS file: /cvs/src/usr.bin/libtool/LT/Getopt.pm,v
retrieving revision 1.12
diff -u -p -r1.12 Getopt.pm
--- LT/Getopt.pm 19 Mar 2014 02:16:22 -0000 1.12
+++ LT/Getopt.pm 1 Aug 2016 10:18:03 -0000
@@ -292,6 +292,11 @@ MAINLOOP2:
if ($arg =~ m/^\-\-$/) {
next; # XXX ?
}
+ # ignore "-bindir /path/to/dir" on OpenBSD (matches GNU libtool)
+ if ($arg =~ m/^\-bindir$/) {
+ shift @main::ARGV;
+ next;
+ }
if ($arg =~ m/^\-/) {
for my $opt (@options) {
if ($opt->match($arg, $self)) {
--
Antoine