On 8/7/20 5:57 AM, Petr Pisar wrote:
> I think the build script does not use Perl configuration consistently. It uses
> ldflags value for the linker flags, but it does not use ld value for the 
> linker
> exectable:
...
> $ perl -MConfig -E 'say $Config{ldflags}'
> -Wl,-z,relro -Wl,--as-needed -Wl,-z,now 
> -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong 
> -L/usr/local/lib
> $ perl -MConfig -E 'say $Config{ld}'
> gcc

double-checking here,

perl -MConfig -E 'say $Config{ldflags}'
        -Wl,-z,relro -Wl,--as-needed -Wl,-z,now 
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong 
-L/usr/local/lib
perl -MConfig -E 'say $Config{ld}'
        gcc

> If your /usr/bin/ld is the binutils ld,

it is:

which ld
        /usr/bin/ld

ld -v
        GNU ld version 2.34-4.fc32

rpm -ql binutils | grep bin/ld
        /usr/bin/ld
        /usr/bin/ld.bfd


ls -al /usr/bin/ld
        lrwxrwxrwx. 1 root root 20 Jul 28 21:59 /usr/bin/ld -> 
/etc/alternatives/ld*
ls -al /etc/alternatives/ld
        lrwxrwxrwx. 1 root root 15 Jul 28 21:59 /etc/alternatives/ld -> 
/usr/bin/ld.bfd*

> 
then -fstack-protector-strong is also

> an invalid option for ld (see ld manual page) and it should also fail. I think

> something tricks you.

noted

> It's not intentional, but it's how perl works.
> 
> When you build perl, the linker flags are modified by a perl build script and
> built into the perl interpreter. Later when a third-party XS module is built,
> the built-in linker flags are reused. That's because the XS module must be
> binary compatible with the perl interpreter and having the same flags ensures
> it. (Some flags, especially compiler flags, changes ABI.) As a result, the
> third-party module is also built rerlo.
> 
> We would like to change it, but perl build script is a giant mess. When I 
> asked
> perl authors for explaining the mess, it turned out that they do not fully
> understand it and, more imporatantly, that they do not want to touch it
> all because they fear breaking a compatibility.
> 
>> Or likely an issue with the module not correctly dealing with it?
> 
> I think that's the case. It should use gcc program for linking.

thx for the comments!  I'll share upstream.
_______________________________________________
perl-devel mailing list -- perl-devel@lists.fedoraproject.org
To unsubscribe send an email to perl-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/perl-devel@lists.fedoraproject.org

Reply via email to