Created attachment 686520 [details] build.log for sys-devel/binutils Hello. I'm trying to use bootstrap-prefix.sh on my arm device (cortex-a7 allwinner A31s). And on stage2 I got error very similar to: https://bugs.gentoo.org/770061 make[1]: Leaving directory '/data/gentoo/tmp/var/tmp/portage/sys-devel/bin make: *** [Makefile:854: all] Error 2 * ERROR: sys-devel/binutils-2.35.2::gentoo failed (compile phase): * emake failed At host now I'm using fedora 33 chroot. P.S. Before that, I used precompiled stage3 tarball from here: https://wiki.gentoo.org/wiki/Project:Android/tarball It worked on my device, but was very outdated. Reproducible: Always Steps to Reproduce: 1. Start bootstrap-prefix.sh 2. Enter prefix '/data/gentoo' 3. Wait for compiling binutils.
>configure: error: in `/data/gentoo/tmp/var/tmp/portage/sys-devel/binutils-2.35.2/work/build/gold': >configure: error: C++ preprocessor "/lib/cpp" fails sanity check >See `config.log' for more details Hmm. Can you share emergg --info (if possible) and config.log?
Created attachment 686523 [details] emerge --info sys-devel/binutils
Created attachment 686526 [details] Configure output
(In reply to shevtsovsasha from comment #3) > Created attachment 686526 [details] > Configure output I think you need a 'config.log' from gold subdir: configure: error: in `/data/gentoo/tmp/var/tmp/portage/sys-devel/binutils-2.35.2/work/build/gold': configure: error: C++ preprocessor "/lib/cpp" fails sanity check See `config.log' for more details You have USE=gold enabled for binutils: > * USE: arm elibc_glibc gold kernel_linux plugins prefix userland_GNU gold needs c++ (as opposed to most of binutils). I suspect bootstrap-prefix.sh also assumes g++ is not available: > /data/gentoo/tmp/usr/local/bin/g++: line 3: exec: g++: not found I'm not very familiar with prefix but I wonder if mere USE=-gold ./bootstrap-prefix.sh would be enough. Or installing g++ to your host system if you really want to bootstrap with gold available.
Created attachment 687210 [details] Configure from gold Attaching configure log from gold dir. Also, I tried to install g++ (gcc-c++ on fedora) and it helped to move forward. Thank you.
Ok, so this is a prefix bug. Yes, you need a c++ compiler to complete a bootstrap. I guess we should add a check and warn/complain if you don't have one to avoid issues like these.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=3d12a4fb0cb041c7a6ff652ae0c6b2ca1d0f2a9b commit 3d12a4fb0cb041c7a6ff652ae0c6b2ca1d0f2a9b Author: Fabian Groffen <grobian@gentoo.org> AuthorDate: 2021-03-13 12:27:51 +0000 Commit: Fabian Groffen <grobian@gentoo.org> CommitDate: 2021-03-13 12:27:51 +0000 scripts/bootstrap-prefix: use binutils without gold in stage2 If we don't have a c++ compiler, we're trying to build one, so it helps in that case if the linker (binutils) doesn't impose a c++ dependency on us there. Closes: https://bugs.gentoo.org/770289 Signed-off-by: Fabian Groffen <grobian@gentoo.org> scripts/bootstrap-prefix.sh | 1 + 1 file changed, 1 insertion(+)