Cannot build Newlib on a Linux PC

R. Diez via newlib newlib@sourceware.org
Thu Sep 27 15:13:00 GMT 2018


Hi all:

I already asked this question here before, but got no answer at all:

https://sourceware.org/ml/newlib/2018/msg00794.html

I am getting desperate. I created a 32-bit (i686) Ubuntu MATE virtual 
machine for the sole purpose of building Newlib, in case it was getting 
confused because of the 64/32-bit multiarch, but it is failing in the 
same place.

I am using the latest snapshot: newlib-3.0.0.20180831

This is my configure command:

./configure --prefix="$HOME/rdiez/newlib/newlib-bin" 
CFLAGS_FOR_TARGET="-save-temps -g -O0 -DDEBUG" 
CXXFLAGS_FOR_TARGET="-save-temps -g -O0 -DDEBUG" 
--host=i686-pc-linux-gnu --target=i686-pc-linux-gnu  --disable-multilib 
--disable-shared --with-newlib

Compilation is failing like this:

Making all in argz
make[5]: Entering directory 
'/home/rdiez/rdiez/newlib/newlib-3.0.0.20180831/i686-pc-linux-gnu/newlib/libc/argz'
/bin/bash ../libtool --tag=CC   --mode=compile gcc 
-I/home/rdiez/rdiez/newlib/newlib-3.0.0.20180831/i686-pc-linux-gnu/newlib/targ-include 
-I/home/rdiez/rdiez/newlib/newlib-3.0.0.20180831/newlib/libc/include 
-DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" 
-DPACKAGE_VERSION=\"3.0.0\" -DPACKAGE_STRING=\"newlib\ 3.0.0\" 
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 
-DLT_OBJDIR=\".libs/\" -I. -I../../../.././newlib/libc/argz -fno-builtin 
-Wall -DHAVE_FCNTL -DHAVE_GETOPT -D_NO_POSIX_SPAWN -fPIC 
-D_I386MACH_NEED_SOTYPE_FUNCTION -DMISSING_SYSCALL_NAMES 
-DHAVE_INIT_FINI      -save-temps -g -O0 -DDEBUG -c -o argz_add.lo 
../../../.././newlib/libc/argz/argz_add.c
libtool: compile:  gcc 
-I/home/rdiez/rdiez/newlib/newlib-3.0.0.20180831/i686-pc-linux-gnu/newlib/targ-include 
-I/home/rdiez/rdiez/newlib/newlib-3.0.0.20180831/newlib/libc/include 
-DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" 
-DPACKAGE_VERSION=\"3.0.0\" "-DPACKAGE_STRING=\"newlib 3.0.0\"" 
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 
-DLT_OBJDIR=\".libs/\" -I. -I../../../.././newlib/libc/argz -fno-builtin 
-Wall -DHAVE_FCNTL -DHAVE_GETOPT -D_NO_POSIX_SPAWN -fPIC 
-D_I386MACH_NEED_SOTYPE_FUNCTION -DMISSING_SYSCALL_NAMES 
-DHAVE_INIT_FINI -save-temps -g -O0 -DDEBUG -c 
../../../.././newlib/libc/argz/argz_add.c -o argz_add.o
In file included from 
/home/rdiez/rdiez/newlib/newlib-3.0.0.20180831/newlib/libc/include/sys/reent.h:13:0,
                  from 
/home/rdiez/rdiez/newlib/newlib-3.0.0.20180831/i686-pc-linux-gnu/newlib/targ-include/sys/errno.h:11,
                  from 
/home/rdiez/rdiez/newlib/newlib-3.0.0.20180831/newlib/libc/include/errno.h:9,
                  from 
/home/rdiez/rdiez/newlib/newlib-3.0.0.20180831/newlib/libc/include/argz.h:10,
                  from ../../../.././newlib/libc/argz/argz_add.c:7:
/home/rdiez/rdiez/newlib/newlib-3.0.0.20180831/newlib/libc/include/_ansi.h:72:19: 
error: missing binary operator before token "("
  #if __GNUC_PREREQ (3, 1)
                    ^
Makefile:390: recipe for target 'argz_add.lo' failed
make[5]: *** [argz_add.lo] Error 1


It looks like it does not know macro __GNUC_PREREQ. But the right 
#includes are apparently there.

I am not the only one facing problems trying to build Newlib for a Linux PC:

https://stackoverflow.com/questions/49925014/how-do-i-build-newlib-for-x86-and-x86-64-linux-in-a-x86-64-linux-host

Please can somebody help?

Best regards,
   rdiez



More information about the Newlib mailing list