Opened 8 years ago
Last modified 5 years ago
#10258 new Bugs
b2 fails to find gcc if bootstrapped with clang
Reported by: | Niall Douglas | Owned by: | Vladimir Prus |
---|---|---|---|
Milestone: | To Be Determined | Component: | build |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
The system showing the problem is Ubuntu 14.04 LTS on ARMv7a. x86 or x64 may not have the same problem. This is in Boost 1.56 beta.
What my CI was always doing for bootstrap is this:
./bootstrap.sh --with-toolset=clang
Unfortunately, this breaks:
./b2 toolset=gcc ...
iff you bootstrapped with clang! It appears to set the gcc executable path to an empty string with obvious consequences.
./b2 toolset=clang works fine though, as does bootstrapping with gcc whereupon both gcc and clang toolsets work fine.
Change History (6)
follow-up: 2 comment:1 by , 8 years ago
comment:2 by , 8 years ago
Replying to vladimir_prus:
Could you please say how "./b2 toolset=gcc ..." fails exactly? What's your project-config.jam?
You can see a failing build log at https://ci.nedprod.com/view/Boost.AFIO/job/Boost.AFIO%20Build%20POSIX_ARM_GCC%204.8/10/console.
There is no project-config.jam. Everything is entirely set to default vanilla settings. It could be an ARM Linux thing.
comment:3 by , 8 years ago
bootstrap.sh creates a project-config.jam in BOOST_ROOT which contains the default compiler setup. Please take a look for it and tell us the contents. Your error log contains "/bin/sh: 2: -ftemplate-depth-128: not found" which is the classic indication that the (default) compiler is missing/not found/somehow got lost.
comment:4 by , 8 years ago
When bootstrapped with no arguments:
# Boost.Build Configuration # Automatically generated by bootstrap.sh import option ; import feature ; # Compiler configuration. This definition will be used unless # you already have defined some toolsets in your user-config.jam # file. if ! gcc in [ feature.values <toolset> ] { using gcc ; } project : default-build <toolset>gcc ; # Python configuration using python : 2.7 : /usr ; # List of --with-<library> and --without-<library> # options. If left empty, all libraries will be built. # Options specified on the command line completely # override this variable. libraries = ; # These settings are equivivalent to corresponding command-line # options. option.set prefix : /usr/local ; option.set exec-prefix : /usr/local ; option.set libdir : /usr/local/lib ; option.set includedir : /usr/local/include ; # Stop on first error option.set keep-going : false ;
When bootstrapped with --with-toolset=clang:
# Boost.Build Configuration # Automatically generated by bootstrap.sh import option ; import feature ; # Compiler configuration. This definition will be used unless # you already have defined some toolsets in your user-config.jam # file. if ! clang in [ feature.values <toolset> ] { using clang ; } project : default-build <toolset>clang ; # Python configuration using python : 2.7 : /usr ; # List of --with-<library> and --without-<library> # options. If left empty, all libraries will be built. # Options specified on the command line completely # override this variable. libraries = ; # These settings are equivivalent to corresponding command-line # options. option.set prefix : /usr/local ; option.set exec-prefix : /usr/local ; option.set libdir : /usr/local/lib ; option.set includedir : /usr/local/include ; # Stop on first error option.set keep-going : false ;
Locations of g++ and clang++
jenkins-slave@tegra-ubuntu:~/workspace/Boost.AFIO Build POSIX_ARM_clang 3.4/boost-local$ whereis g++ g++: /usr/bin/g++ /usr/bin/X11/g++ /usr/share/man/man1/g++.1.gz jenkins-slave@tegra-ubuntu:~/workspace/Boost.AFIO Build POSIX_ARM_clang 3.4/boost-local$ whereis clang++ clang++: /usr/bin/clang++ /usr/bin/X11/clang++ /usr/share/man/man1/clang++.1.gz
After bootstrapping with clang I also did a:
./b2 toolset=gcc libs/afio/build -d9 > debug.txt
... and have attached the output as a file which hopefully says what went wrong.
Let me know if you need anything else.
Niall
comment:5 by , 8 years ago
Ok attachments are limited to a pathetic 256Kb, so I sent the log to Google Drive:
https://drive.google.com/file/d/0B5QDPUNHLpKMNDJhM1ZoZXpCSms/edit?usp=sharing
N
comment:6 by , 5 years ago
The reason this happens is:
- clang imports gcc
- gcc.jam calls feature.extend toolset : gcc ; at the top level.
- build-system.jam attempts to autoconfigure toolsets based on whether the feature value is known. Therefore, a plain toolset=gcc will not trigger autoconfiguration if clang has been used.
Workarounds:
- toolset=gcc-7.2.1 (or whatever the full version of gcc is)
- add using gcc to user-config.jam.
Could you please say how "./b2 toolset=gcc ..." fails exactly? What's your project-config.jam?