Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 914006 - sys-libs/zlib-1.2.13-r1::gentoo_prefix failed (compile phase) in bootstrap-prefix.sh stage3
Summary: sys-libs/zlib-1.2.13-r1::gentoo_prefix failed (compile phase) in bootstrap-pr...
Status: UNCONFIRMED
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:
Depends on:
Blocks:
 
Reported: 2023-09-11 15:08 UTC by Yadi Xiao
Modified: 2023-09-18 23:48 UTC (History)
2 users (show)

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


Attachments
stage3 log (stage3.log,837.72 KB, text/plain)
2023-09-11 15:10 UTC, Yadi Xiao
Details
build log for sys-libs/zlib-1.2.13-r1 (build.log,11.71 KB, application/octet-stream)
2023-09-11 15:28 UTC, Yadi Xiao
Details
build log for sys-libs/zlib-1.2.13-r1 after adding CC="$(tc-getCC)" (build_zlib_CC=%22$(tc-getCC)%22.log,11.54 KB, application/octet-stream)
2023-09-18 20:40 UTC, Yadi Xiao
Details
build.log for sys-devel/gcc-12.1.0 (build_sys-devel:gcc-12.1.0.log,13.74 KB, application/octet-stream)
2023-09-18 22:23 UTC, Yadi Xiao
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yadi Xiao 2023-09-11 15:08:30 UTC
I tried to run the latest bootstrap-prefix.sh script (commit 10296d4b, 2023-09-11 12:37:44 +0200) with RAP support disabled. During stage3, I met the following error: "ERROR: sys-libs/zlib-1.2.13-r1::gentoo_prefix failed (compile phase)". 
This is caused by: "{$EPREFIX}/tmp/usr/x86_64-pc-linux-gnu/binutils-bin/2.40/ld: crc32.lo: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC"

Reproducible: Always

Steps to Reproduce:
1.export PREFIX_DISABLE_RAP="yes"
2../bootstrap-prefix.sh
Comment 1 Yadi Xiao 2023-09-11 15:10:11 UTC
Created attachment 870318 [details]
stage3 log
Comment 2 Yadi Xiao 2023-09-11 15:28:55 UTC
Created attachment 870319 [details]
build log for sys-libs/zlib-1.2.13-r1
Comment 3 Yadi Xiao 2023-09-12 03:54:00 UTC
I also tired the bootstrap-prefix.sh script (commit 34fe8e37, 2023-09-11 21:51:58 +0200) with RAP support disabled and received the same error:

/ocean/projects/sys890003p/xiaoy/gentoo_34fe8e37/tmp/usr/x86_64-pc-linux-gnu/binutils-bin/2.40/ld: crc32.lo: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/ocean/projects/sys890003p/xiaoy/gentoo_34fe8e37/tmp/usr/x86_64-pc-linux-gnu/binutils-bin/2.40/ld: failed to set dynamic section sizes: bad value
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-12 03:57:08 UTC
The fact it's calling `cc` directly isn't great and might even be related here.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-12 04:01:38 UTC
Could you try forcing it to use the right CC?

maybe try adding CC="$(tc-getCC)" before configure
Comment 6 Yadi Xiao 2023-09-12 13:38:20 UTC
(In reply to Sam James from comment #5)
> Could you try forcing it to use the right CC?
> 
> maybe try adding CC="$(tc-getCC)" before configure

Do you suggest adding CC="$(tc-getCC)" to the zlib ebuild file?

If so, would I also need to update the manifest? Could you guide me on updating the manifest in the Gentoo Prefix? Like which ebuild executable should I use?
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-13 04:03:37 UTC
(In reply to Yadi Xiao from comment #6)
> (In reply to Sam James from comment #5)
> > Could you try forcing it to use the right CC?
> > 
> > maybe try adding CC="$(tc-getCC)" before configure
> 
> Do you suggest adding CC="$(tc-getCC)" to the zlib ebuild file?
> 

yes

> If so, would I also need to update the manifest? Could you guide me on
> updating the manifest in the Gentoo Prefix? Like which ebuild executable
> should I use?

any should be ok (either one on the host or any inside the prefix), like /prefix/tmp/usr/bin/ebuild /path/to/foo.ebuild clean digest
Comment 8 Yadi Xiao 2023-09-18 20:25:38 UTC
I added CC="$(tc-getCC)" to the first line of multilib_src_configure function in zlib's ebuild file.

After re-running the bootstrap script, I still got the same error:
/ocean/projects/sys890003p/xiaoy/gentoo_34fe8e37/tmp/usr/x86_64-pc-linux-gnu/binutils-bin/2.40/ld: crc32.lo: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/ocean/projects/sys890003p/xiaoy/gentoo_34fe8e37/tmp/usr/x86_64-pc-linux-gnu/binutils-bin/2.40/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status

I checked the ebuild file after running the script to make sure it is not overwritten by the script.
Comment 9 Yadi Xiao 2023-09-18 20:40:12 UTC
Created attachment 870895 [details]
build log for sys-libs/zlib-1.2.13-r1 after adding CC="$(tc-getCC)"
Comment 10 Yadi Xiao 2023-09-18 21:22:57 UTC
Apologies for the previous incorrect update. I forgot to export CC in ebuild file!

After adding export CC="$(tc-getCC)" to the first line of multilib_src_configure function in zlib's ebuild file, I ran the script and it successfully installed zlib.
Comment 11 Yadi Xiao 2023-09-18 22:23:19 UTC
Created attachment 870900 [details]
build.log for sys-devel/gcc-12.1.0

I received a new error when emerging sys-devel/gcc-12.1.0:

configure: error: *** A compiler with support for C++11 language features is required.
 * ERROR: sys-devel/gcc-12.1.0::gentoo_prefix failed (configure phase):


I tried to add export CC="$(tc-getCC)" to the ebuild file of sys-devel/gcc-12.1.0, but this time it doesn't work.

I'm also testing on if the new update at https://gitweb.gentoo.org/repo/proj/prefix.git/commit/scripts/bootstrap-prefix.sh?id=ac4c67f00fd053c8556580d3101066c99b6d1051 would solve the problem.
Comment 12 Yadi Xiao 2023-09-18 23:48:04 UTC
I created a new report regarding the new error with sys-devel/gcc-12.1.0.
https://bugs.gentoo.org/914416