Skip to content
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

Build of GCC fails when . is in PATH #2

Open
caltry opened this issue Feb 2, 2013 · 0 comments
Open

Build of GCC fails when . is in PATH #2

caltry opened this issue Feb 2, 2013 · 0 comments
Assignees

Comments

@caltry
Copy link
Owner

caltry commented Feb 2, 2013

When cross compiling GCC while the current directory is in the PATH variable, compilation fails with the error message:

checking for i686-pc-linux-gnu-gcc... (cached) gcc
checking for C compiler default output file name... 
configure: error: in `/tmp/dcl9934/cross-tools/build-gcc/gcc':
configure: error: C compiler cannot create executables
See `config.log' for more details.

If you go to compile gcc manually, you'll see a more useful message:

$ rm -rf build-gcc && mkdir build-gcc
$ cd build-gcc
$ ../gcc-4.7.2/configure --target=arm-none-eabi --prefix=/tmp/dcl9934/cross-tools/local-prefix --enable-languages=c --without-headers
$ make
gcc -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat   -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../gcc-4.7.2/gcc -I../../gcc-4.7.2/gcc/build -I../../gcc-4.7.2/gcc/../include -I../../gcc-4.7.2/gcc/../libcpp/include  -I../../gcc-4.7.2/gcc/../libdecnumber -I../../gcc-4.7.2/gcc/../libdecnumber/dpd -I../libdecnumber    \
            -o build/genconstants.o ../../gcc-4.7.2/gcc/genconstants.c
/tmp/dcl9934/cross-tools/local-prefix/arm-none-eabi/bin/as: unrecognized option '--32'

This problem here is that GCC creates a symlink to the 'as' for the target platform, and puts it in the build-gcc/gcc directory. So, when we try to compile something for the host, we end up using the target's 'as' instead!

gcc$ which as
./as
gcc$ as --verbose
GNU assembler version 2.23.1 (arm-none-eabi) using BFD version (GNU Binutils) 2.23.1

Either the user need to remove '.' from their path, or we should remove it from the environment when we build GCC by submake.

@ghost ghost assigned caltry Feb 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant