Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 895240 - sys-devel/binutils-2.39-r4: bootstrap.sh fails
Summary: sys-devel/binutils-2.39-r4: bootstrap.sh fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-02-18 10:34 UTC by APN-Pucky
Modified: 2023-03-04 02:21 UTC (History)
6 users (show)

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


Attachments
build.log (build.log,11.81 KB, text/plain)
2023-02-18 10:36 UTC, APN-Pucky
Details
full.log.bz2 (full.log.bz2,771.82 KB, text/plain)
2023-02-18 10:39 UTC, APN-Pucky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description APN-Pucky 2023-02-18 10:34:40 UTC
System: 
Vagrantfile generic/debian11

Steps to Reproduce:
Run bootstrap-prefix.sh
Comment 1 APN-Pucky 2023-02-18 10:36:00 UTC
Created attachment 852630 [details]
build.log
Comment 2 APN-Pucky 2023-02-18 10:37:54 UTC
Full large log is available here as an artifact https://github.com/APN-Pucky/gentoo-prefix-tester/actions/runs/4182207353

bugz does not seem to uploading it.
Comment 3 APN-Pucky 2023-02-18 10:39:51 UTC
Created attachment 852632 [details]
full.log.bz2
Comment 4 Larry the Git Cow gentoo-dev 2023-03-01 00:52:11 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f4bae8f7128a0a7977d4cf765f21301a2275f32e

commit f4bae8f7128a0a7977d4cf765f21301a2275f32e
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-03-01 00:51:07 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-03-01 00:51:07 +0000

    sys-devel/binutils: add 2.40(-r2)
    
    Bug: https://bugs.gentoo.org/895240
    Bug: https://bugs.gentoo.org/892549
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/binutils/Manifest                        |   2 +
 sys-devel/binutils/binutils-2.40-r2.ebuild         | 509 +++++++++++++++++++++
 .../files/binutils-2.40-linker-search-path.patch   |  74 +++
 3 files changed, 585 insertions(+)
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-02 02:26:24 UTC
configure has:

checking for dlopen... no
checking for dlopen in -ldl... no

and from config.log:
"""
configure:10945: checking for dlopen
configure:10945: gcc -isystem /home/gentoo/gentoo/usr/include -B/home/gentoo/gentoo/usr/lib64 -L/home/gentoo/gentoo/usr/lib64 -Wl,--dynamic-linker=/home/gentoo/gentoo/lib64/ld-linux-x86-64.so.2  -o conftest -O2 -pipe -O2 -pipe       -L/home/gentoo/gentoo/usr/lib64 -Wl,--dynamic-linker=/home/gentoo/gentoo/lib64/ld-linux-x86-64.so.2 conftest.c  >&5
/home/gentoo/gentoo/tmp/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /home/gentoo/gentoo/var/tmp/portage/sys-devel/binutils-2.40-r2/temp/ccJRRcQb.o: in function `main':
conftest.c:(.text.startup+0x7): undefined reference to `dlopen'
collect2: error: ld returned 1 exit status
configure:10949: checking for dlopen in -ldl
configure:10974: gcc -isystem /home/gentoo/gentoo/usr/include -B/home/gentoo/gentoo/usr/lib64 -L/home/gentoo/gentoo/usr/lib64 -Wl,--dynamic-linker=/home/gentoo/gentoo/lib64/ld-linux-x86-64.so.2  -o conftest -O2 -pipe -O2 -pipe       -L/home/gentoo/gentoo/usr/lib64 -Wl,--dynamic-linker=/home/gentoo/gentoo/lib64/ld-linux-x86-64.so.2 conftest.c -ldl   >&5
/home/gentoo/gentoo/tmp/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /home/gentoo/gentoo/var/tmp/portage/sys-devel/binutils-2.40-r2/temp/cc6ky0pA.o: in function `main':
conftest.c:(.text.startup+0x7): undefined reference to `dlopen'
collect2: error: ld returned 1 exit status
configure:10974: $? = 1
"""
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-02 02:41:44 UTC
Was looking for dlopen and...

$ nm -D /home/gentoo/gentoo/lib64/ld-linux-x86-64.so.2
nm: /home/gentoo/gentoo/lib64/ld-linux-x86-64.so.2: unknown type [0x13] section `.relr.dyn'

why is there anything DT_RELR in there?
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-02 06:26:15 UTC
Just to give an update:
1. The DT_RELR thing is a real issue I have some hacks for which I'll submit/commit in the next few days, but it's unrelated.

2. It's to do with not properly using the new glibc from stage2 & being confused wrt ${EPREFIX}/lib* and ${EPREFIX}/usr/lib*

3. It turns out someone's submitted a PR already which properly explains the issue so I didn't need to spend a while on it earlier as it turns out ;)

https://github.com/gentoo/prefix/pull/22

Will look at the PR later.
Comment 8 Larry the Git Cow gentoo-dev 2023-03-04 02:21:44 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=97f76fa9e3aeeac6f44dbc979dcddb86ce7e1686

commit 97f76fa9e3aeeac6f44dbc979dcddb86ce7e1686
Author:     Bart Oldeman <bart.oldeman@calculquebec.ca>
AuthorDate: 2023-03-01 17:29:36 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-03-04 02:21:34 +0000

    Use gcc --sysroot in rap stage3 post glibc install
    
    Since glibc now has non-prefixed filenames in
    `$EPREFIX/usr/lib64/libc.so`, it picks up non-prefixed
    `/lib64/libc.so.6` from stage2 gcc, unless we replace its -I, -L, and
    -B options by --sysroot. Then it will look at the same places as
    the future stage3 gcc.
    
    This avoids issues building binutils, which can't find dlopen in
    older `/lib64/libc.so.6`, since dlopen used to be in `libdl`
    instead.
    
    The whole logic no longer tests for compiler == gcc, since clang
    is only used for non-rap on MacOS.
    
    Closes: https://bugs.gentoo.org/895240
    Signed-off-by: Bart Oldeman <bart.oldeman@calculquebec.ca>
    Closes: https://github.com/gentoo/prefix/pull/22
    Signed-off-by: Sam James <sam@gentoo.org>

 scripts/bootstrap-prefix.sh | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)