Page 1 of 1

compile errors when porting newlib

Posted: Sat Aug 13, 2016 5:25 pm
by szhou42
I've followed the exact steps described in this tutorial http://wiki.osdev.org/Porting_Newlib
but when I do

Code: Select all

make all
to compile newlib, it gives me this error:

Code: Select all

mkdir tmp
cd tmp; \
	 for i in argz/lib.a stdlib/lib.a ctype/lib.a search/lib.a stdio/lib.a   string/lib.a signal/lib.a time/lib.a locale/lib.a reent/lib.a  errno/lib.a misc/lib.a     machine/lib.a sys/lib.a; do \
	   i686-simpleos-ar x ../$i; \
	 done; \
	i686-simpleos-ar rc ../libc.a *.o
i686-simpleos-ar: ../sys/lib.a: No such file or directory
i686-simpleos-ranlib libc.a
rm -rf tmp
rm -f crt0.o
ln sys/crt0.o crt0.o >/dev/null 2>/dev/null || cp sys/crt0.o crt0.o
cp: cannot stat ‘sys/crt0.o’: No such file or directory
make[5]: *** [crt0.o] Error 1
make[5]: Leaving directory `/home/vagrant/backup/build-newlib/i686-simpleos/newlib/libc'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/vagrant/backup/build-newlib/i686-simpleos/newlib/libc'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/vagrant/backup/build-newlib/i686-simpleos/newlib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/vagrant/backup/build-newlib/i686-simpleos/newlib'
make[1]: *** [all-target-newlib] Error 2
make[1]: Leaving directory `/home/vagrant/backup/build-newlib'
make: *** [all] Error 2
Can someone explains what's going on and how to solve this problem? thanks

Re: compile errors when porting newlib

Posted: Sat Aug 13, 2016 6:08 pm
by szhou42
.

Re: compile errors when porting newlib

Posted: Mon Dec 07, 2020 9:43 pm
by kotovalexarian
I have the same error.

Google shows four results when searching the error message, one of which is this thread and others are:
None of them provides an answer.

Re: compile errors when porting newlib

Posted: Mon Dec 07, 2020 10:18 pm
by Octocontrabass
One source suggests that this error means you're not using automake 1.11 for whichever reason.

Re: compile errors when porting newlib

Posted: Mon Dec 07, 2020 10:21 pm
by nullplan
It appears the build system could not build sys/crt0.o nor sys/lib.a, but why is not evident from the error listings. You might want to investigate the build files in the sys directory.

Re: compile errors when porting newlib

Posted: Tue Dec 08, 2020 1:20 am
by kotovalexarian
Octocontrabass wrote:One source suggests that this error means you're not using automake 1.11 for whichever reason.
I'm using Automake 1.15.1, which is greater.

Re: compile errors when porting newlib

Posted: Tue Dec 08, 2020 1:36 am
by Octocontrabass
It doesn't work with higher versions. Try again with Automake 1.11.

Re: compile errors when porting newlib

Posted: Tue Dec 08, 2020 1:43 am
by kotovalexarian
True. https://wiki.osdev.org/Porting_Newlib says:
The newlib source is organized using "Cygnus style," which is unsupported in Automake versions 1.12 and beyond. Therefore, to be able to build newlib, you need a version less than or equal to 1.11.
Why didn't authors of Newlib changed this since 2012, when the next minor version of Automake was released? Should I build Automake to just build Newlib? Genius.

UPD: Automake 1.11 doesn't even work for me. Automake creators are genius too. They drop feature support as minor version change, they don't provide message that feature is not supported.

Re: compile errors when porting newlib

Posted: Sun Aug 25, 2024 8:30 am
by techdude17
Hi all! I was having a similar issue to this and I hope I can shed some light on what fixed it for me.

I was using Newlib 3.0.0 (if it matters, 20180206) and was encountering the same issue. Changing versions of autoconf and automake did not help (although the newlib README is bad and doesn't specify that you need a Cygnus-compatible automake and autoconf).

However, if you look a little further up in the build log, you might spot some compile errors from GCC for your C files. For some reason, the Makefile just ignores these errors and tries to continue, which can be misleading. Look a little further up in your compilation logs to see if there are any.

For reference here are the versions of tools I used for Newlib 3:
- autoconf: 2.69
- automake: 1.12.1
- aclocal: 1.12.1

Hope this helps!