Skip to content

Build doesn't honour CFG_CC/CFG_CXX. #40295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vext01 opened this issue Mar 6, 2017 · 5 comments
Closed

Build doesn't honour CFG_CC/CFG_CXX. #40295

vext01 opened this issue Mar 6, 2017 · 5 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@vext01
Copy link
Contributor

vext01 commented Mar 6, 2017

Hi,

CC @semarie

I notice that the rust build doesn't pass down the gcc/g++ binary chosen at configure time down to the later stages of the build.

$ CFG_CC=egcc CFG_CXX=eg++ ./configure --prefix=`pwd`/inst --enable-local-rust --local-rust-root=...
...
configure: CFG_CC               := egcc
configure: CFG_CXX              := eg++
...

Which suggests I successfully chose an alternative compiler.

$ egcc --version
egcc (GCC) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ eg++ --version
eg++ (GCC) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ gmake
...
CMake Error at cmake/modules/CheckCompilerVersion.cmake:12 (message):         
  Host GCC version must be at least 4.7!

So I think it has incorrectly used gcc instead of egcc:

$ gcc --version
gcc (GCC) 4.2.1 20070719 

A workaround is to make symlinks to egcc and eg++ and put the dir in the path first.

System is OpenBSD. Today's rust master.

Thanks.

@pnkfelix pnkfelix added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Mar 6, 2017
@semarie
Copy link
Contributor

semarie commented Mar 6, 2017

@edd please use CC and CXX env variable and pass them to gmake too.

env CC=egcc CXX=eg++ ./configure ...
env CC=egcc CXX=eg++ gmake

@semarie
Copy link
Contributor

semarie commented Mar 6, 2017

it is due because even if configure write CFG_CC, rustbuild doesn't read the compiler path from config.mk, but always from gcc crate, so at runtime.

@vext01
Copy link
Contributor Author

vext01 commented Mar 6, 2017

Thanks. This seems to be working.

I guess I was caught out, as usually the compiler found by configure is used without having to set CC and CXX for the make part.

@alexcrichton
Copy link
Member

FWIW rustbulid attempts to do this detection, and if that's failing then PRs are of course always welcome!

@Mark-Simulacrum
Copy link
Member

Closing in favor of #42255.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

5 participants