cannot find the library `sys/linux/

Jeroen Hofstee
Thu Apr 26 17:46:00 GMT 2012


I am trying to add newlib for a new target. Since the target does not 
support debugging, I though
it would be easier to first test on a pc, and thereafter test the target.

However, I ran into some issues on:
Linux laptop-xubunutu 3.0.0-17-generic #30-Ubuntu SMP Thu Mar 8 17:34:21 
UTC 2012 i686 i686 i386 GNU/Linux

make[6]: Entering directory 
/bin/bash ./libtool --tag=CC   --mode=link gcc     
-g -fno-stack-protector -Xcompiler -nostdlib  -o   
argz/ stdlib/ ctype/ 
search/ stdio/ stdio64/  
string/ signal/ time/ 
locale/ reent/  errno/ misc/ 
unix/ posix/  machine/i386/ 
libtool: link: cannot find the library `sys/linux/' or 
unhandled argument `sys/linux/'

This seems related to
but their patch contains $(DEB_HOST_MULTIARCH), which seems like a 
specific patch.

Anyone any idea why I get this error / how to fix it?

Jeroen Hofstee

-------------- next part --------------
#--- what/how to build ----
#--- end of what to build ---

gcc_config:=--enable-languages=${lang} --disable-nls --disable-multilib
build_gcc = ${target}_build_gcc

all: gcc_install

	sudo apt-get build-dep gcc


	rm -rf ${build_binutils} ${build_gcc} ${build_newlib}
	rm -f binutils_config binutils_make binutils_install
	rm -f gcc_bootstrap_config gcc_bootstrap_make gcc_bootstrap_install
	rm -f newlib_config newlib_make newlib_install
	rm -f gcc_config gcc_make gcc_install

distclean: clean
	rm -rf newlib gcc binutils
	rm ${binutils}.tar.gz ${gcc}.tar.bz2

#--- binutils ---

${binutils}.tar.gz :
	@echo "--- binutils downloading ---"

binutils: ${binutils}.tar.gz
	@echo "--- binutils extracting ---"
	tar -xzf ${binutils}.tar.gz
	mv ${binutils} binutils

binutils_config: binutils
	@echo "--- binutils config ---" 
	if [ ! -d ${build_binutils} ]; then mkdir ${build_binutils}; fi
	cd ${build_binutils}; ../binutils/configure --target=${target} --prefix=${prefix} && \
		touch ../binutils_config

binutils_make: binutils_config
	@echo "--- binutils make ---" 
	cd ${build_binutils}; make all ${make_args} && touch ../binutils_make

binutils_install: binutils_make
	@echo "--- binutils install ---" 
	cd ${build_binutils}; make install && touch ../binutils_install

#--- gcc download ---

	@echo "--- gcc downloading ---"

gcc: ${gcc}.tar.bz2
	@echo "--- gcc extracting ---"
	tar -xjf ${gcc}.tar.bz2
	mv ${gcc} gcc
	cd gcc; ./contrib/download_prerequisites

#--- gcc bootstrap ---

gcc_bootstrap_config: gcc binutils_install
	@echo "--- gcc bootstrap config ---"
	if [ ! -d ${build_gcc} ]; then mkdir ${build_gcc}; fi
	cd ${build_gcc}; 										\
	../gcc/configure --target=${target} --prefix=${prefix} --without-headers --with-newlib 	\
		--with-gnu-as --with-gnu-ld ${gcc_config} &&					\
		touch ../gcc_bootstrap_config

gcc_bootstrap_make: gcc_bootstrap_config
	@echo "--- gcc bootstrap make ---"
	cd ${build_gcc};										\
	make all-gcc ${make_args} &&								\
	touch ../gcc_bootstrap_make

gcc_bootstrap_install: gcc_bootstrap_make
	@echo "--- gcc bootstrap install ---"
	cd ${build_gcc}; 										\
	make install-gcc &&								\
	touch ../gcc_bootstrap_install

#--- newlib ---

newlib_fetch: gcc_bootstrap_install
	@echo "--- newlib downloading ---"
	if [ ! -d newlib ]; then git clone git://; fi
	cd newlib;										\
	touch ../newlib_fetch

newlib_config: newlib_fetch
	@echo "--- newlib config ---"
	if [ ! -d ${build_newlib} ]; then mkdir ${build_newlib}; fi
	cd ${build_newlib};									\
	export CFLAGS="-fno-stack-protector";					\
	../newlib/configure --target=${target} --prefix=${prefix} --with-newlib 		\
		--disable-multilib &&					\
	touch ../newlib_config

newlib_make: newlib_config
	echo ${PATH}
	@echo "--- newlib make ---"
	cd ${build_newlib}; 									\
	make all &&								\
	touch ../newlib_make

newlib_install: newlib_make
	@echo "--- newlib install  ---"
	cd ${build_newlib}; make install && 					\
	touch ../newlib_install

#--- gcc --

gcc_config: newlib_install
	@echo "--- gcc config ---"
	if [ ! -d ${build_gcc} ]; then mkdir ${build_gcc}; fi
	cd ${build_gcc}; 										\
	../gcc/configure --target=${target} --prefix=${prefix} --with-newlib 			\
		--with-gnu-as --with-gnu-ld ${gcc_config} &&					\
		touch ../gcc_config

gcc_make: gcc_config
	@echo "--- gcc make ---"
	cd ${build_gcc};										\
	make all ${make_args} && touch ../gcc_make

gcc_install: gcc_make
	@echo "--- gcc install ---"
	cd ${build_gcc}; 										\
	make install && touch ../gcc_install

More information about the Newlib mailing list