Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 770289 - sys-devel/binutils-2.35.2: fails to compile on armv7 (configure: error: C++ preprocessor "/lib/cpp" fails sanity check) (prefix)
Summary: sys-devel/binutils-2.35.2: fails to compile on armv7 (configure: error: C++ p...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: ARM Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-12 23:34 UTC by shevtsovsasha
Modified: 2021-03-13 12:29 UTC (History)
2 users (show)

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


Attachments
build.log for sys-devel/binutils (build.log,44.65 KB, text/x-log)
2021-02-12 23:34 UTC, shevtsovsasha
Details
emerge --info sys-devel/binutils (emerge-info.txt,4.19 KB, text/plain)
2021-02-12 23:37 UTC, shevtsovsasha
Details
Configure output (config.log,37.73 KB, text/x-log)
2021-02-12 23:38 UTC, shevtsovsasha
Details
Configure from gold (config.log,68.83 KB, text/x-log)
2021-02-17 09:33 UTC, shevtsovsasha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shevtsovsasha 2021-02-12 23:34:52 UTC
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.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-02-12 23:36:47 UTC
>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?
Comment 2 shevtsovsasha 2021-02-12 23:37:00 UTC
Created attachment 686523 [details]
emerge --info sys-devel/binutils
Comment 3 shevtsovsasha 2021-02-12 23:38:37 UTC
Created attachment 686526 [details]
Configure output
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2021-02-13 08:26:51 UTC
(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.
Comment 5 shevtsovsasha 2021-02-17 09:33:21 UTC
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.
Comment 6 Fabian Groffen gentoo-dev 2021-02-17 09:39:21 UTC
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.
Comment 7 Larry the Git Cow gentoo-dev 2021-03-13 12:29:27 UTC
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(+)