Bug 1666098 - Overspecification in perl -MExtUtils::Embed -e ldopts
Summary: Overspecification in perl -MExtUtils::Embed -e ldopts
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: perl
Version: 40
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jitka Plesnikova
QA Contact: Fedora Extras Quality Assurance
URL: https://rt.perl.org/Ticket/Display.ht...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-14 21:57 UTC by Michael Schwendt
Modified: 2024-02-15 22:53 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github Perl perl5 issues 16811 0 None open ExtUtils::Embed::ldopts contains flags for linking the Perl itself 2022-05-16 08:30:29 UTC

Description Michael Schwendt 2019-01-14 21:57:18 UTC
The following command is supposed to return the ldflags that are needed to link with libperl. Instead, it returns everything that has been specified when building libperl itself. Not limited to Fedora's global flags and several libraries that aren't needed when linking shared. As a result, programs relink also with those libs instead of just libperl.

$ perl -MExtUtils::Embed -e ldopts
-Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -L/usr/local/lib  -L/usr/lib64/perl5/CORE -lperl -lpthread -lresolv -ldl -lm -lcrypt -lutil -lc

Please clean up the flags and return only -L/usr/lib64/perl5/CORE -lperl.

Comment 1 Petr Pisar 2019-01-15 07:17:37 UTC
The unneeded libraries are there because of this:

ExtUtils::Embed adds $Config{perllibs} to ldopts:

$ perl -MConfig -e 'print qq{$Config{perllibs}\n}'
-lpthread -lresolv -ldl -lm -lcrypt -lutil -lc

and perllibs is documented as:

        The list of libraries needed by Perl only (any libraries needed by
        extensions only will by dropped, if using dynamic loading).

The perllibs documentation is not clear (as always) whether the flags are for linking with Perl or linking the Perl.
The perllibs value suggests its for linking the Perl.

ExtUtils::Embed documents ldopts like this:

        Output arguments for linking the Perl library and extensions to your
        application.

I will forward this discrepancy to upstream, but do not hope in any action. Upstream is very reluctant to touching this code and any downstream changes always makes angry one or another party depending on which misfeature we remove and they rely on.

The other options are there because perl enforces its ABI to applications that use perl. That's upstream's deliberate decision and that fix will be very painful. (No, it's not about rewriting ExtUtils::Embed, that's only a symptom. The real issue is Perl's build system that's hindered by a compatibility with the whole CPAN.)

Comment 2 Ben Cotton 2019-08-13 16:59:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 3 Ben Cotton 2019-08-13 19:37:31 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 4 Ben Cotton 2020-11-03 15:07:31 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Jitka Plesnikova 2020-11-03 16:14:08 UTC
Still valid

Comment 6 Ben Cotton 2021-02-09 15:09:22 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 7 Ben Cotton 2022-05-12 16:52:33 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 8 Ben Cotton 2022-08-09 13:37:30 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.

Comment 9 Aoife Moloney 2023-11-23 00:02:02 UTC
This message is a reminder that Fedora Linux 37 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 37 on 2023-12-05.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '37'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 37 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 10 Aoife Moloney 2024-02-15 22:53:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.


Note You need to log in before you can comment on or make changes to this bug.