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

Substitution issue for -L in Makefile.PL on HPUX #492

Open
maxvohlkenhcl opened this issue Nov 19, 2024 · 2 comments
Open

Substitution issue for -L in Makefile.PL on HPUX #492

maxvohlkenhcl opened this issue Nov 19, 2024 · 2 comments

Comments

@maxvohlkenhcl
Copy link

maxvohlkenhcl commented Nov 19, 2024

On HPUX the platform identifier is IA64.ARCHREV_0-thread-multi-LP64. A substitution for -L in the Makefile.PL incorrectly replaces the -L in -LP64 when the platform identifier is on the linker command line. An example is the -Wl,+b/usr/lib/perl5/5.26.3/IA64.ARCHREV_0-thread-multi-LP64/CORE option to add the CORE directory to the embedded runpath.

The offending line is:
($args{uc $_} = $Config{$_}) =~ s/-L/$lp -L/ for qw(lddlflags ldflags);
The s/-L/ isn't specific enough. The desire is to match the -L linker argument. So a better match is to look for -L after a space or at the beginning of the value. So I propose this improvement.
($args{uc $_} = $Config{$_}) =~ s/(^|\s)-L/$1$lp -L/ for qw(lddlflags ldflags);

@h-vn
Copy link
Contributor

h-vn commented Dec 2, 2024

Looks good. I first thought about removing the match variable $1 and using non-capturing grouping (?:...) but that would not preserve space and would cause a problem.

@maxvohlkenhcl
Copy link
Author

maxvohlkenhcl commented Dec 6, 2024 via email

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

2 participants