Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regression in 1.10: can't find libraries that are present #23

Open
schmonz opened this issue Apr 11, 2017 · 5 comments
Open

regression in 1.10: can't find libraries that are present #23

schmonz opened this issue Apr 11, 2017 · 5 comments

Comments

@schmonz
Copy link

schmonz commented Apr 11, 2017

I'm using NetBSD 7.1. (This regression is almost certainly not limited to NetBSD.)

Last week, I had no trouble installing (for example) p5-Crypt-DH-GMP. This week, it complained like so, and failed to write its Makefile:

Writing ppport.h
Shared object "libgmp.so.10" not found
wrong result: 'gmp'

(libgmp is exactly as present as it was last week, and other configury things continue to find it just fine.)

In 1.09, when my build last worked, @ldflags was getting set to -Wl,-rpath,/usr/pkg/lib -fstack-protector -L/usr/pkg/lib.

In 1.10, when I get the above error, @ldflags is getting set to -fstack-protector -L/usr/pkg/lib.

The change was introduced in this commit.

I'm having trouble imagining a rationale for the change that makes sense to me, and I suspect there's a better way to get the result you were after. What was the problem the change was intended to solve? Maybe I can help solve it another way.

Thanks!

  • Amitai
jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Apr 11, 2017
@mattn
Copy link
Owner

mattn commented Apr 12, 2017

@toddr could you handle this, please.

@toddr
Copy link
Contributor

toddr commented Apr 13, 2017

@schmonz per #19 it appears that on Linux, having -Wl options in $LD_RUN_PATH causes problems. This may not be the case for BSD. I need a day or 2 before I can look at it.

Todd

@mohawk2
Copy link
Contributor

mohawk2 commented May 6, 2022

@toddr Any insights? :-)

@schmonz
Copy link
Author

schmonz commented Jul 28, 2022

FYI, pkgsrc still needs the following local patch. We lost it by mistake a couple weeks ago and p5-Crypt-DH-GMP promptly broke again on NetBSD. It's back now.

$NetBSD: patch-lib_Devel_CheckLib.pm,v 1.3 2022/07/28 18:45:03 schmonz Exp $

Fix regression reported in https://github.com/mattn/p5-Devel-CheckLib/issues/23.
Keeps p5-Crypt-DH-GMP building on at least NetBSD.

--- lib/Devel/CheckLib.pm.orig	2022-05-04 14:31:10.000000000 +0000
+++ lib/Devel/CheckLib.pm
@@ -454,7 +454,7 @@ sub _findcc {
         push @Config_ldflags, $config_val if ( $config_val =~ /\S/ );
     }
     my @ccflags = grep { length } _parsewords($Config_ccflags||'', $user_ccflags||'');
-    my @ldflags = grep { length && $_ !~ m/^-Wl/ } _parsewords(@Config_ldflags, $user_ldflags||'');
+    my @ldflags = grep { length } _parsewords(@Config_ldflags, $user_ldflags||'');
     my @paths = split(/$Config{path_sep}/, $ENV{PATH});
     my @cc = _parsewords($Config{cc});
     if (check_compiler ($cc[0], $debug)) {

@mohawk2
Copy link
Contributor

mohawk2 commented Aug 1, 2022

It looks to me like the relevant code should be in two stages, to only filter -Wl on Linux (I also removed the blocks in grep to slightly improve performance):

my @ldflags = grep length, _parsewords(@Config_ldflags, $user_ldflags||'');
@ldflags = grep !/^-Wl/, @ldflags if $^O =~ /linux/i;

@mattn @toddr Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants