On Fri, 15 Aug 2025 22:25:52 +0000
Lloyd <[email protected]> wrote:
> The Makefile was passing the -shrext flag to GNU libtool to create shared
> libraries with a custom extension. The libtool from base was silently
> ignoring this flag as opposed to erroring out as I would have expected.
I try adding -shrext to OpenBSD libtool. I'm not sure if my diff is
correct. Later, I will try linking some things with it, but those
things don't use -shrext.
--gkoehler
Index: LT/Mode/Link.pm
===================================================================
RCS file: /cvs/src/usr.bin/libtool/LT/Mode/Link.pm,v
diff -u -p -r1.38 Link.pm
--- LT/Mode/Link.pm 8 Jul 2023 08:15:32 -0000 1.38
+++ LT/Mode/Link.pm 17 Aug 2025 03:55:47 -0000
@@ -150,7 +150,7 @@ sub run($class, $ltprog, $gp, $ltconfig)
# XXX options ignored: bindir, dlopen, dlpreopen, no-fast-install,
# no-install, no-undefined, precious-files-regex,
- # shrext, thread-safe, prefer-pic, prefer-non-pic,
+ # thread-safe, prefer-pic, prefer-non-pic,
# static-libtool-libs
my @RPopts = $gp->rpath; # -rpath options
@@ -245,8 +245,9 @@ sub run($class, $ltprog, $gp, $ltconfig)
$outfile =~ s/\.a$/.la/;
}
(my $libname = $ofile) =~ s/\.l?a$//; # remove extension
+ my $shrext = $gp->shrext // '.so';
my $staticlib = $libname.'.a';
- my $sharedlib = $libname.'.so';
+ my $sharedlib = $libname.$shrext;
my $sharedlib_symlink;
if ($gp->static || $gp->all_static) {
@@ -277,7 +278,7 @@ sub run($class, $ltprog, $gp, $ltconfig)
}
if (defined $gp->release) {
$sharedlib_symlink = $sharedlib;
- $sharedlib = $libname.'-'.$gp->release.'.so';
+ $sharedlib = $libname.'-'.$gp->release.$shrext;
}
if ($gp->avoid_version ||
(defined $gp->release && !$gp->version_info)) {