-
Notifications
You must be signed in to change notification settings - Fork 577
hints/darwin.sh: skip ldflags in lddlflags #23227
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
base: blead
Are you sure you want to change the base?
Conversation
It has not effect. "adopting flags from ldflags is supposed to happen in Configure, not in hints." - leont Configuring a build of perl with -Aappend:ldflags=" -L/var/empty" and checking the output of 'perl -V:ldflags -V:lddlflags' shows ldflags=' -L/var/empty'; lddlflags='-bundle -undefined dynamic_lookup -L/var/empty'; Found when analysing issue Perl#9437 Tested on OS X 10.4 aka Darwin 8.
Introduces a bunch of link warnings, from github builds:
locally:
|
Just as a test, can you try the following patch locally?
|
That didn't improve matters, nor did adding it further down as well:
Configure reported it added it:
but it didn't end up in config.sh:
Tested with after |
Thanks for checking. I'll dig a bit more over the next couple of days & report back. |
So it can be appended, otherwise it just hardcodes lddlflags="-bundle -undefined dynamic_lookup" Make sure MACOSX_DEPLOYMENT_TARGET is added to $lddlflags.
Need to be explicit with OS' for macOS 11 and up here. Otherwise: Unexpected MACOSX_DEPLOYMENT_TARGET=11
Unless MACOSX_DEPLOYMENT_TARGET is passed into the build, just ride the defaults of the OS' toolchain. This code assumes OS X versioning (10.15.x ) and tries to drop the patch version from the product version so that you're targetting macOS 10.15, rather than 10.15.1. Unfortunately with macOS 11 and up, it ends up targetting the patch version and since we're no longer appending $ld to $lddlflags we end up with the core targetting the major version and the modules targetting the patch version. Resulting in warnings ld: warning: object file (/Users/runner/work/perl5/perl5/cpan/Compress-Raw-Bzip2/Bzip2.o) was built for newer 'macOS' version (14.7) than being linked (14.0)
I think we're good now. The only warning from the linker is I looked into into and it looks like the warning was added sometime after macOS 10.15 (macOS 11?) but I don't have anything running macOS 11 to 13 in order to point to the specific version. |
Built with Tested this patch on OS X 10.4/i386 shouldn't have affected anything there since Tested on macOS 10.15/x86_64. Built successfully & test passed. No warnings from linker.
Tested on macOS 10.15 with
During the configure stage,
When running the test suite
I suspect these are bugs in the tests, which this change has brought to light, rather than fallout due to the change. |
Is there an open ticket for this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look reasonable to me:
- it builds fine on current versions of macos (the most common case)
- you've tested it on some older macos, and built successfully
I wouldn't mind some second opinions though
There's mattn/p5-Devel-CheckLib#40 |
But ExtUtils::MakeMaker needs a bug report too. It's not just Devel::CheckLib which creates breaks targeting 10.4 and older. |
It has not effect.
"adopting flags from ldflags is supposed to happen in Configure, not in hints." - leont
Configuring a build of perl with -Aappend:ldflags=" -L/var/empty" and checking the output of 'perl -V:ldflags -V:lddlflags' shows
ldflags=' -L/var/empty';
lddlflags='-bundle -undefined dynamic_lookup -L/var/empty';
Found when analysing issue #9437
Tested on OS X 10.4 aka Darwin 8.