Makefile quits generating nothing

Jeff Johnston jjohnstn@redhat.com
Wed Aug 11 12:15:00 GMT 2010


For Linux, we use some of the system headers and some of newlib's 
headers (there are newlib-only types for example).  Admittedly, this is 
a bit of a pain sometimes and things do break from time to time when 
upstream headers change plus there is also sometimes duplicate settings 
between the system headers and newlib.

You have configured for 32-bit x86, but your system headers are 64 bit 
so you are blazing a new trail here.

So, what can you do?

One possibility is to get the x86 headers and put them on your path. 
For example, on Fedora you could get:
glibc-headers-2.12.90-7.i686.rpm and install it somewhere off of your 
normal path, then use it during your configure/build of newlib.  There 
are issues if you intend to have other users use your built library 
since they will need similar header files available.  If it is just you 
building an app, then there is no problem.

Alternatively, you can try hacking away to see if you can get newlib 
built (e.g. if you set the __GNUC__ flag for that particular compile you 
failed on, __loff_t gets defined as long long instead of long).  If you 
can get it working and write down what you did, I can look at placing 
some compiler flags in the headers based on your findings to save you 
and others in the same boat from trouble next time.  For simplicity, you 
might want to edit the headers found in the 
build/i686-pc-linux-gnu/newlib/targ-include directory (note this is set 
up at build time and will get trashed if reconfigured so you might want 
to back-up after changes). The build directory is not used when 
installing the headers so you might want to copy over any headers you 
have modified into the install include directory.

-- Jeff J.

On 08/10/2010 02:26 PM, sravs wrote:
>
> Thanks Jeff :),
>
> That worked to some extent and exited giving the error
>
> /usr/include/bits/types.h:187: error: conflicting types for ‘__loff_t’
> /home/stangeda/newlib_08022010/newlib-1.18.0/newlib/libc/include/machine/types.h:22:
> error: previous declaration of ‘__loff_t’ was here
> make[5]: *** [argz_add.lo] Error 1
> make[5]: Leaving directory
> `/home/stangeda/newlib_08022010/newlib_compile/i686-pc-linux-gnu/newlib/libc/argz'
> make[4]: *** [all-recursive] Error 1
> make[4]: Leaving directory
> `/home/stangeda/newlib_08022010/newlib_compile/i686-pc-linux-gnu/newlib/libc'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory
> `/home/stangeda/newlib_08022010/newlib_compile/i686-pc-linux-gnu/newlib'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory
> `/home/stangeda/newlib_08022010/newlib_compile/i686-pc-linux-gnu/newlib'
> make[1]: *** [all-target-newlib] Error 2
> make[1]: Leaving directory `/home/stangeda/newlib_08022010/newlib_compile'
> make: *** [all] Error 2
>
> So i understand that types.h is being called twice from two different
> locations, to overcome this i compiled fom the directory
> /home/stangeda/newlib_08022010/newlib_compile/i686-pc-linux-gnu/newlib/libc/argz/
> using  -nostdinc command in commandline
>
> gcc
> -I/home/stangeda/newlib_08022010/newlib_compile/i686-pc-linux-gnu/newlib/targ-include
> -I/home/stangeda/newlib_08022010/newlib-1.18.0/newlib/libc/include
> -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\"
> -DPACKAGE_VERSION=\"1.18.0\" "-DPACKAGE_STRING=\"newlib 1.18.0\""
> -DPACKAGE_BUGREPORT=\"\" -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-1.18.0/newlib/libc/argz -Wall
> -D_I386MACH_ALLOW_HW_INTERRUPTS -DHAVE_FCNTL -DHAVE_GETOPT -fPIC
> -D_I386MACH_NEED_SOTYPE_FUNCTION  -nostdinc -DMISSING_SYSCALL_NAMES
> -fno-builtin -g -O2 -c
> ../../../../../newlib-1.18.0/newlib/libc/argz/argz_add.c  -fPIC -DPIC -o
> .libs/argz_add.o
>
> I tried to see if it successfully compiles with nostdinc flags..but that
> didnt work quite well since it was missing few files. The first error it
> produced was
>
> /home/stangeda/newlib_08022010/newlib_compile/i686-pc-linux-gnu/newlib/targ-include/sys/_types.h:25:20:
> error: stddef.h: No such file or directory
>
> So i understand few files are being called twice and when i use -nostdinc
> there are other files missing. Could you throw some light on this scenario.
>
> Thanks,
> Sravs
>
> *******************************************************************************
>
> Jeff Johnston wrote:
>>
>> It's Jeff actually :)
>>
>> There are a few problems here.
>>
>> 1. newlib does not build natively by default.   By default, sourceware
>>       expects glibc on a native system so you need to specify --with-newlib
>>       on the configuration.
>>
>> 2. the only linux target currently supported is x86 (e.g.
>> i686-pc-linux-gnu)
>>       and there isn't x86_64 support.   If you like, you can look at
>> porting the
>>       libc/sys/linux/machine/x86 directory to
>> libc/sys/linux/machine/x86_64 or
>>       you could just try specifying --target=i686-pc-linux-gnu and run in
>>       x86 32-bit mode
>>
>> Regards.
>>
>> -- Jeff J.
>>
>> On 03/08/10 02:44 PM, sravs wrote:
>>> Hello John,
>>>
>>> I am facing some difficulties to successfully run Makefile.I have gcc
>>> version 11.1 and binutils-2.17.50.0.6-9.e15 installed on my machine
>>> already.
>>>
>>> below are the commands that i follow to generate Makefile
>>>
>>> cd newlib-1.18.0
>>> mkdir ../newlib_compile
>>> cd ../newlib_compile
>>> ../newlib-1.18.0/configure --srcdir=../newlib-1.18.0/
>>> --build=x86_64-redhat-linux.
>>> make
>>>
>>> I can successfully generate Make file using the configure command  but
>>> makefile doesnot generate any object files and quits building nothing, it
>>> displays following message.
>>>
>>> make[1]: Entering directory
>>> `/home/stangeda/newlib_07152010/newlib_compile'
>>> Configuring in ./etc
>>> configure: loading cache ./config.cache
>>> checking for a BSD-compatible install... /usr/bin/install -c
>>> configure: creating ./config.status
>>> config.status: creating Makefile
>>> make[2]: Entering directory
>>> `/home/stangeda/newlib_07152010/newlib_compile/etc'
>>> for f in standards.info configure.info; do \
>>>             if test -f ../../newlib-1.18.0/etc/`echo $f | sed -e
>>> 's/.info$/.texi/'`; then \
>>>               if make "MAKEINFO=makeinfo --split-size=5000000
>>> --split-size=5000000" $f; then \
>>>                 true; \
>>>               else \
>>>                 exit 1; \
>>>               fi; \
>>>             fi; \
>>>           done
>>> make[3]: Entering directory
>>> `/home/stangeda/newlib_07152010/newlib_compile/etc'
>>> make[3]: `standards.info' is up to date.
>>> make[3]: Leaving directory
>>> `/home/stangeda/newlib_07152010/newlib_compile/etc'
>>> make[3]: Entering directory
>>> `/home/stangeda/newlib_07152010/newlib_compile/etc'
>>> make[3]: `configure.info' is up to date.
>>> make[3]: Leaving directory
>>> `/home/stangeda/newlib_07152010/newlib_compile/etc'
>>> make[2]: Leaving directory
>>> `/home/stangeda/newlib_07152010/newlib_compile/etc'
>>> make[1]: Nothing to be done for `all-target'.
>>> make[1]: Leaving directory
>>> `/home/stangeda/newlib_07152010/newlib_compile'
>>>
>>> This is my first time playing with one such library, any suggestions are
>>> highly appreciated to get me through this issue.
>>>
>>> Thanks,
>>> Sravs
>>>
>>
>>
>>
>



More information about the Newlib mailing list