Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 723734 - dev-lang/perl calls cc directly
Summary: dev-lang/perl calls cc directly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Perl team
URL: https://github.com/Perl/perl5/issues/...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: tc-directly perl-toolchain
  Show dependency tree
 
Reported: 2020-05-18 11:31 UTC by Agostino Sarubbo
Modified: 2024-05-10 17:28 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,614.20 KB, text/plain)
2020-05-18 11:31 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-05-18 11:31:08 UTC
This is an auto-filed bug because dev-lang/perl calls cc directly.
The issue was originally discovered on amd64, but it may be reproducible on other arches as well.
If you think that a different summary clarifies the issue better, feel free to change it.
Attached build log and emerge --info.

NOTE:
If you think it doesn't make sense fix these type of issues, I'd like to point out that won't be possible use a different CC implementation (like clang) by setting the CC variable. So this issue has been reproduced by setting the CC variable to x86_64-pc-linux-gnu-gcc and by removing the /usr/bin/cc - /usr/bin/gcc binaries.
Comment 1 Agostino Sarubbo gentoo-dev 2020-05-18 11:31:17 UTC
Created attachment 640124 [details]
build.log

build log and emerge --info
Comment 2 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-05-18 11:38:31 UTC
Important context from QA report:


    ./hints/linux.sh: line 174: gcc: command not found
    Configure: line 6387: nm: command not found
    Configure: line 22940: cpp: command not found

While these aren't fatal for perl's build, like ar, they're likely to lead to bad consequences.
Comment 3 Larry the Git Cow gentoo-dev 2020-05-18 13:19:21 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10f82b45e3946956fec887a87ce4ceb6c11fc680

commit 10f82b45e3946956fec887a87ce4ceb6c11fc680
Author:     Kent Fredric <kentnl@gentoo.org>
AuthorDate: 2020-05-18 13:15:12 +0000
Commit:     Kent Fredric <kentnl@gentoo.org>
CommitDate: 2020-05-18 13:18:45 +0000

    dev-lang/perl: More TC love for nm/cpp/ranlib re bug #723734
    
    While this won't fix the warnings about hints/linux.sh, as that is
    something too complex for me to trivially fix, it should mitigate the
    warnings about nm and cpp, and additonally, guards against a possible
    future where ranlib is also nuked and later tried to be used from
    $Config{ranlib}
    
    -r bump for compile propagation reasons, real delta:
    
    --- a/dev-lang/perl/perl-5.30.2-r1.ebuild
    +++ b/dev-lang/perl/perl-5.30.2-r2.ebuild
    @@ -502,11 +502,16 @@ src_configure() {
            # allow fiddling via EXTRA_ECONF, bug 558070
            eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})"
    
    +       # setting -Dld= to tc-getLD breaks perl and all perl things
    +       # https://github.com/Perl/perl5/issues/17791#issuecomment-630145202
            myconf \
                    -Duseshrplib \
                    -Darchname="${myarch}" \
                    -Dcc="$(tc-getCC)" \
                    -Dar="$(tc-getAR)" \
    +               -Dnm="$(tc-getNM)" \
    +               -Dcpp="$(tc-getCPP)" \
    +               -Dranlib="$(tc-getRANLIB)" \
                    -Doptimize="${CFLAGS}" \
                    -Dldflags="${LDFLAGS}" \
                    -Dprefix="${EPREFIX}"'/usr' \
    
    Bug: https://bugs.gentoo.org/723734
    Bug: https://github.com/Perl/perl5/issues/17791#issuecomment-630123559
    Package-Manager: Portage-2.3.99, Repoman-2.3.22
    Signed-off-by: Kent Fredric <kentnl@gentoo.org>

 dev-lang/perl/perl-5.30.2-r2.ebuild | 659 ++++++++++++++++++++++++++++++++++++
 1 file changed, 659 insertions(+)
Comment 4 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-05-18 13:26:44 UTC
For now, this:
>     ./hints/linux.sh: line 174: gcc: command not found

Seems like a red herring, but the code involved is a bit of a nightmare:


https://metacpan.org/source/SHAY/perl-5.30.2/hints/linux.sh#L166-206

This could *potentially* mess up plibpth computation, and possibly libquadmath support.

The rest are addressed.
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2021-04-30 20:12:53 UTC
This is now in 5.32.1
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-04 09:08:42 UTC
I wonder if Kent made a mistake at https://github.com/Perl/perl5/issues/17791#issuecomment-630145202.

We don't ever really care about LD, it's deprecated to use it as a path to the actual linker. --ld=$(tc-getCC) seems to work for me so far in some brief testing (Module::Install doesn't respect CCLD), and we already do 'export CCLD=$(tc-getCC)' and 'unset LD' in perl-module.eclass.
Comment 7 Larry the Git Cow gentoo-dev 2024-05-10 17:28:35 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c399cbd07731158823bef61ad97058db365f8aea

commit c399cbd07731158823bef61ad97058db365f8aea
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-05-04 10:42:07 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-10 17:28:03 +0000

    dev-lang/perl: respect CC for LD too
    
    As I remarked at https://bugs.gentoo.org/723734#c6, I suspect trying
    to respect LD specifically was a mistake. Calling LD directly at all
    is deprecated and people should do it via the compiler driver, hence
    set LD="$(tc-getCC)".
    
    Note that we already unset LD anyway since 6eb964b504c3aef2192403cbf383ae75d46990ff.
    
    Bug: https://bugs.gentoo.org/723734
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-lang/perl/perl-5.38.2-r4.ebuild | 863 ++++++++++++++++++++++++++++++++++++
 1 file changed, 863 insertions(+)