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
Created attachment 870318 [details] stage3 log
Created attachment 870319 [details] build log for sys-libs/zlib-1.2.13-r1
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
The fact it's calling `cc` directly isn't great and might even be related here.
Could you try forcing it to use the right CC? maybe try adding CC="$(tc-getCC)" before configure
(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?
(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
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.
Created attachment 870895 [details] build log for sys-libs/zlib-1.2.13-r1 after adding CC="$(tc-getCC)"
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.
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.
I created a new report regarding the new error with sys-devel/gcc-12.1.0. https://bugs.gentoo.org/914416