Error Building Newlib for arm-none-eabi
Jaap de Wolff
info@jasoon.nl
Tue Feb 20 07:59:00 GMT 2018
> -----Oorspronkelijk bericht-----
> Van: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org]
> Namens R0b0t1
> Verzonden: Tuesday, February 20, 2018 5:44 AM
> Aan: newlib@sourceware.org
> Onderwerp: Re: Error Building Newlib for arm-none-eabi
>
> On Mon, Feb 19, 2018 at 8:33 PM, R0b0t1 <r030t1@gmail.com> wrote:
> > I am trying to build for arm-none-eabi with GCC.
> >
> > ../../source/${dname}/configure \
> > --target=${TARGET} \
> > --prefix=`realpath ../../${DIR_PREFIX}` \
> > --disable-newlib-supplied-syscalls \
> > --enable-newlib-reent-small \
> > --disable-newlib-fvwrite-in-streamio \
> > --disable-newlib-fseek-optimization \
> > --disable-newlib-wide-orient \
> > --disable-newlib-unbuf-stream-opt \
> > --enable-newlib-global-atexit \
> > --enable-newlib-retargetable-locking \
> > --disable-nls
> >
> > make -j"${NCPU}" -l"${NCPU}"
> > make install
> >
> >
> > Gives:
> >
> > In file included from
> > /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/ssp/stdio.h:34:0,
> > from
> > /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/stdio.h:800,
> > from
> > ../../../../../../source/newlib-3.0.0/newlib/libc/stdio/gets.c:62:
> > ../../../../../../source/newlib-3.0.0/newlib/libc/stdio/gets.c:96:1:
> > error: expected declaration specifiers or ‘...’ before
> > ‘__builtin_object_size’
> > gets (char *buf)
> > ^
> >
> > I attempted to search for the error, but did not get much of anywhere.
> > The GCC mailing list informed me that building all components
> > separately may not be the best idea, but I am looking to copy existing
> > build systems and to integrate the code into those build systems. In
> > which case separate component builds are more convenient, at least for
> > now.
> >
>
> Some testing with a default configuration, just setting --target, leads to more of
> the same:
>
> In file included from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/stdio.h:800:0,
> from
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/sprintf.c:572:
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/sprintf.c:606:1:
> error: expected declaration specifiers or ‘...’ before numeric constant sprintf
> (char *__restrict str, ^ In file included from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/ssp/stdio.h:34:0,
> from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/stdio.h:800,
> from
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/sprintf.c:572:
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/sprintf.c:606:1:
> error: expected declaration specifiers or ‘...’ before ‘__builtin_object_size’
> sprintf (char *__restrict str,
> ^
> make[8]: *** [Makefile:1222: lib_a-sprintf.o] Error 1
> make[8]: *** Waiting for unfinished jobs....
> In file included from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/ssp/stdio.h:34:0,
> from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/stdio.h:800,
> from
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/gets.c:62:
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/gets.c:96:1:
> error: expected declaration specifiers or ‘...’ before ‘__builtin_object_size’
> gets (char *buf)
> ^
> In file included from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/stdio.h:800:0,
> from
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/snprintf.c:22:
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/snprintf.c:66:1:
> error: expected declaration specifiers or ‘...’ before numeric constant snprintf
> (char *__restrict str, ^ In file included from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/ssp/stdio.h:34:0,
> from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/stdio.h:800,
> from
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/snprintf.c:22:
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/snprintf.c:66:1:
> error: expected declaration specifiers or ‘...’ before ‘__builtin_object_size’
> snprintf (char *__restrict str,
> ^
> make[8]: *** [Makefile:1096: lib_a-gets.o] Error 1
> make[8]: *** [Makefile:1216: lib_a-snprintf.o] Error 1 In file included from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/stdio.h:800:0,
> from
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/vsprintf.c:25:
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/vsprintf.c:34:1:
> error: expected declaration specifiers or ‘...’ before numeric constant vsprintf
> (char *__restrict str, ^ In file included from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/ssp/stdio.h:34:0,
> from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/stdio.h:800,
> from
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/vsprintf.c:25:
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/vsprintf.c:34:1:
> error: expected declaration specifiers or ‘...’ before ‘__builtin_object_size’
> vsprintf (char *__restrict str,
> ^
> In file included from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/stdio.h:800:0,
> from
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/vsnprintf.c:25:
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/vsnprintf.c:35:1:
> error: expected declaration specifiers or ‘...’ before numeric constant vsnprintf
> (char *__restrict str, ^ In file included from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/ssp/stdio.h:34:0,
> from
> /home/R0b0t1/devel/toolgen/source/newlib-
> 3.0.0/newlib/libc/include/stdio.h:800,
> from
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/vsnprintf.c:25:
> ../../../../../../../source/newlib-3.0.0/newlib/libc/stdio/vsnprintf.c:35:1:
> error: expected declaration specifiers or ‘...’ before ‘__builtin_object_size’
> vsnprintf (char *__restrict str,
> ^
>
>
>
> > Thanks in advance,
> > R0b0t1
Robot,
Are you sure you have the PATH right, etc?
I just did:
/home/jaap/tst-newlib/gcc-arm-none-eabi-7-2017-q4-major/src/newlib/configure \
--build=x86_64-linux-gnu \
--host=x86_64-linux-gnu \
--target=arm-none-eabi \
--prefix=/home/jaap/tst-newlib/gcc-arm-none-eabi-7-2017-q4-major/build-native/target-libs \
--disable-newlib-supplied-syscalls \
--enable-newlib-reent-small \
--disable-newlib-fvwrite-in-streamio \
--disable-newlib-fseek-optimization \
--disable-newlib-wide-orient \
--disable-newlib-unbuf-stream-opt \
--enable-newlib-global-atexit \
--enable-newlib-retargetable-locking \
--disable-nls
make -j8
The newlib version I used to test this is the version in git ea543d3ffa129dd4976aa19d47cf6c8f7ce09a11
(with comment line fix declaration of fhandler_socket::socketpair)
and it did compile without any error.
Jaap de Wolff
More information about the Newlib
mailing list