gcc is not finding newlib's stdio.h #20

Open
Dale-M opened this Issue Feb 28, 2012 · 3 comments

Comments

Projects
None yet
2 participants

Dale-M commented Feb 28, 2012

Extracted tarball and compiled with

PREFIX=/mnt/data/s/gcc install-cross

Other information:

$ gcc --version
gcc (32-bit ARM EABI Toolchain JBS-2011.09-69-v2011.09-69-12-g2867909) 4.6.1
Copyright (C) 2011 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.

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
Target: arm-none-eabi
Configured with: ../../gcc-4.6-2011.09/configure --prefix=/mnt/data/s/gcc --with-pkgversion='32-bit ARM EABI Toolchain JBS-2011.09-69-v2011.09-69-12-g2867909' --with-bugurl=https://github.com/jsnyder/arm-eabi-toolchain --target=arm-none-eabi --enable-languages=c,c++ --with-gnu-ld --with-gnu-as --with-newlib --disable-nls --disable-libssp --disable-shared --enable-threads --with-headers=yes --disable-libmudflap --disable-libgomp --enable-lto --disable-libstdcxx-pch --enable-poison-system-directories --with-sysroot=/mnt/data/s/gcc/arm-none-eabi --with-build-time-tools=/mnt/data/s/gcc/arm-none-eabi/bin --enable-extra-sgxxlite-multilibs --with-specs='%{save-temps: -fverbose-asm} -D__CS_SOURCERYGXX_MAJ__=2011 -D__CS_SOURCERYGXX_MIN__=09 -D__CS_SOURCERYGXX_REV__=69 %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}'
Thread model: single
gcc version 4.6.1 (32-bit ARM EABI Toolchain JBS-2011.09-69-v2011.09-69-12-g2867909)

Anybody seen this? Any ideas what I should do?

Thanks in advance,
Dale

Owner

jsnyder commented Feb 29, 2012

What platform are you on? I'm guessing a 32-bit linux?

There should probably be stdio.h files in the following subdirectories of the prefix:

arm-none-eabi/include/sys/stdio.h
arm-none-eabi-include/c++/4.6.1/tr1/stdio.h
arm-none-eabi/include/stdio.h

Dale-M commented Feb 29, 2012

On Tue, 2012-02-28 at 17:12 -0800, James Snyder wrote:

What platform are you on? I'm guessing a 32-bit linux?

There should probably be stdio.h files in the following subdirectories of the prefix:

arm-none-eabi/include/sys/stdio.h
arm-none-eabi-include/c++/4.6.1/tr1/stdio.h
arm-none-eabi/include/stdio.h

Yes, the files are there, but wouldn't you expect gcc to pick them up
automatically, e.g. after an ``#include <stdio.h>''?

Owner

jsnyder commented Feb 29, 2012

Yep, I suppose it's for some reason not looking in the correct paths.

certainly something like this should work:

test.c:

cat test.c

#include <stdio.h>

void main( void )
{
    printf("Hello world!\n");
}

then:

arm-none-eabi-gcc -v -c test.c

I get the following output:

Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/home/jsnyder/arm-cs-tools/libexec/gcc/arm-none-eabi/4.6.1/lto-wrapper
Target: arm-none-eabi
Configured with: ../../gcc-4.6-2011.09/configure --prefix=/home/jsnyder/arm-cs-tools --with-pkgversion='32-bit ARM EABI Toolchain JBS-2011.09-69-v2011.09-69-11-g1cd739f' --with-bugurl=https://github.com/jsnyder/arm-eabi-toolchain --target=arm-none-eabi --enable-languages=c,c++ --with-gnu-ld --with-gnu-as --with-newlib --disable-nls --disable-libssp --disable-shared --enable-threads --with-headers=yes --disable-libmudflap --disable-libgomp --enable-lto --disable-libstdcxx-pch --enable-poison-system-directories --with-sysroot=/home/jsnyder/arm-cs-tools/arm-none-eabi --with-build-time-tools=/home/jsnyder/arm-cs-tools/arm-none-eabi/bin --enable-extra-sgxxlite-multilibs --with-specs='%{save-temps: -fverbose-asm} -D__CS_SOURCERYGXX_MAJ__=2011 -D__CS_SOURCERYGXX_MIN__=09 -D__CS_SOURCERYGXX_REV__=69 %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}'
Thread model: single
gcc version 4.6.1 (32-bit ARM EABI Toolchain JBS-2011.09-69-v2011.09-69-11-g1cd739f) 
COLLECT_GCC_OPTIONS='-v' '-c' '-D' '__CS_SOURCERYGXX_MAJ__=2011' '-D' '__CS_SOURCERYGXX_MIN__=09' '-D' '__CS_SOURCERYGXX_REV__=69'
 /home/jsnyder/arm-cs-tools/libexec/gcc/arm-none-eabi/4.6.1/cc1 -quiet -v -D__USES_INITFINI__ -D __CS_SOURCERYGXX_MAJ__=2011 -D __CS_SOURCERYGXX_MIN__=09 -D __CS_SOURCERYGXX_REV__=69 test.c -quiet -dumpbase test.c -auxbase test -version -o /tmp/cc4zlRTy.s
GNU C (32-bit ARM EABI Toolchain JBS-2011.09-69-v2011.09-69-11-g1cd739f) version 4.6.1 (arm-none-eabi)
    compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9
warning: MPFR header version 3.0.0-p8 differs from library version 3.0.1-p3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/home/jsnyder/arm-cs-tools/arm-none-eabi/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/jsnyder/arm-cs-tools/lib/gcc/arm-none-eabi/4.6.1/include
 /home/jsnyder/arm-cs-tools/lib/gcc/arm-none-eabi/4.6.1/include-fixed
 /home/jsnyder/arm-cs-tools/lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/include
 /home/jsnyder/arm-cs-tools/arm-none-eabi/usr/include
End of search list.
GNU C (32-bit ARM EABI Toolchain JBS-2011.09-69-v2011.09-69-11-g1cd739f) version 4.6.1 (arm-none-eabi)
    compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9
warning: MPFR header version 3.0.0-p8 differs from library version 3.0.1-p3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 0f3c6b686e86d99462fc86b0b8e659fd
COLLECT_GCC_OPTIONS='-v' '-c' '-D' '__CS_SOURCERYGXX_MAJ__=2011' '-D' '__CS_SOURCERYGXX_MIN__=09' '-D' '__CS_SOURCERYGXX_REV__=69'
 /home/jsnyder/arm-cs-tools/lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/bin/as -v -meabi=5 -o test.o /tmp/cc4zlRTy.s
GNU assembler version 2.21.53 (arm-none-eabi) using BFD version (32-bit ARM EABI Toolchain JBS-2011.09-69-v2011.09-69-11-g1cd739f) 2.21.53.20110905
COMPILER_PATH=/home/jsnyder/arm-cs-tools/libexec/gcc/arm-none-eabi/4.6.1/:/home/jsnyder/arm-cs-tools/libexec/gcc/arm-none-eabi/4.6.1/:/home/jsnyder/arm-cs-tools/libexec/gcc/arm-none-eabi/:/home/jsnyder/arm-cs-tools/lib/gcc/arm-none-eabi/4.6.1/:/home/jsnyder/arm-cs-tools/lib/gcc/arm-none-eabi/:/home/jsnyder/arm-cs-tools/lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/bin/
LIBRARY_PATH=/home/jsnyder/arm-cs-tools/lib/gcc/arm-none-eabi/4.6.1/:/home/jsnyder/arm-cs-tools/lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/:/home/jsnyder/arm-cs-tools/arm-none-eabi/lib/
COLLECT_GCC_OPTIONS='-v' '-c' '-D' '__CS_SOURCERYGXX_MAJ__=2011' '-D' '__CS_SOURCERYGXX_MIN__=09' '-D' '__CS_SOURCERYGXX_REV__=69'

It's not going to link without some missing functions, an entry point, and at least stubs for functions that would normally be taken care of by an OS, but it should at least compile as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment