Page 1 of 1

Further GCC Cross compiler errors

Posted: Sun Sep 09, 2012 5:47 am
by halofreak1990
I, too, am having difficulties building a cross-compiler.
I've followed the article in the wiki to the letter, but when I try to compile binutils, I get these errors:

Code: Select all

cp ../../binutils-2.22/ld/emultempl/astring.sed stringify.sed
LIB_PATH='' /bin/sh ../../binutils-2.22/ld/genscripts.sh "../../binutils-2.22/ld
" "/usr/local/cross/lib" "/usr/local/cross" "/usr/local/cross" i686-pc-cygwin i5
86-pc-elf i586-elf "elf_i386" "/usr/local/lib /lib /usr/lib" no no elf_i386 "i58
6-elf"
sed: kan bestand stringify.sed niet openen: Permission denied
sed: kan bestand stringify.sed niet openen: Permission denied
sed: kan bestand stringify.sed niet openen: Permission denied
sed: kan bestand stringify.sed niet openen: Permission denied
sed: kan bestand stringify.sed niet openen: Permission denied
sed: kan bestand stringify.sed niet openen: Permission denied
sed: kan bestand stringify.sed niet openen: Permission denied
sed: kan bestand stringify.sed niet openen: Permission denied
sed: kan bestand stringify.sed niet openen: Permission denied
sed: kan bestand stringify.sed niet openen: Permission denied
sed: kan bestand stringify.sed niet openen: Permission denied
sed: kan bestand stringify.sed niet openen: Permission denied
sed: kan bestand stringify.sed niet openen: Permission denied
source='eelf_i386.c' object='eelf_i386.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../../binutils-2.22/ld/../depcomp \
gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.22/ld  -I. -I../../binutils-2.22/ld -
I../bfd -I../../binutils-2.22/ld/../bfd -I../../binutils-2.22/ld/../include   -g
 -O2 -DENABLE_PLUGINS  -DLOCALEDIR="\"/usr/local/cross/share/locale\""   -W -Wal
l -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c eelf_i386.c
../../binutils-2.22/ld/emultempl/elf32.em: In function `gldelf_i386_get_script':

../../binutils-2.22/ld/emultempl/elf32.em:1995: let op: `return' with no value,in function returning non-void
../../binutils-2.22/ld/emultempl/elf32.em:1996: let op: `return' with no value,in function returning non-void
../../binutils-2.22/ld/emultempl/elf32.em:1997: let op: `return' with no value,in function returning non-void
../../binutils-2.22/ld/emultempl/elf32.em:1998: let op: `return' with no value,in function returning non-void
../../binutils-2.22/ld/emultempl/elf32.em:2001: let op: `return' with no value,in function returning non-void
../../binutils-2.22/ld/emultempl/elf32.em:2002: let op: `return' with no value,in function returning non-void
../../binutils-2.22/ld/emultempl/elf32.em:2003: let op: `return' with no value,in function returning non-void
../../binutils-2.22/ld/emultempl/elf32.em:2006: let op: `return' with no value,in function returning non-void
../../binutils-2.22/ld/emultempl/elf32.em:2007: let op: `return' with no value,in function returning non-void
../../binutils-2.22/ld/emultempl/elf32.em:2008: let op: `return' with no value,in function returning non-void
../../binutils-2.22/ld/emultempl/elf32.em:2010: let op: `return' with no value,in function returning non-void
../../binutils-2.22/ld/emultempl/elf32.em:2011: let op: `return' with no value,in function returning non-void
../../binutils-2.22/ld/emultempl/elf32.em:2012: let op: `return' with no value,in function returning non-void
Makefile:1419: recipe for target `eelf_i386.o' failed
make[4]: *** [eelf_i386.o] Error 1
make[4]: Map '/usr/src/build-binutils/ld' wordt verlaten
Makefile:1642: recipe for target `all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Map '/usr/src/build-binutils/ld' wordt verlaten
Makefile:910: recipe for target `all' failed
make[2]: *** [all] Error 2
make[2]: Map '/usr/src/build-binutils/ld' wordt verlaten
Makefile:7015: recipe for target `all-ld' failed
make[1]: *** [all-ld] Error 2
make[1]: Map '/usr/src/build-binutils' wordt verlaten
Makefile:842: recipe for target `all' failed
make: *** [all] Error 2
I'm building this using Cygwin, on a 32-bit Windows 7 machine.

Re: GCC Cross compiler errors

Posted: Sun Sep 09, 2012 9:06 am
by Combuster
Permission denied
Have you tried running with administrator privileges?

Re: GCC Cross compiler errors

Posted: Sun Sep 09, 2012 9:37 am
by halofreak1990
Combuster wrote:
Permission denied
Have you tried running with administrator privileges?
Yeah, I should've guessed that was the problem. Though I'm curious... I've compiled many things with cygwin before, and I never needed it to be run with admin privileges. Why now?

Thanks anyway.

Re: Further GCC Cross compiler errors

Posted: Fri Nov 23, 2012 9:47 am
by halofreak1990
One of my development machines is now running a 64-bit Windows 8, and of course the previously compiled cross compiler no longer works.
However, re-doing all the steps in the Cross-compiler tutorials doesn't produce a working environment.
Binutils compiles fine, but during the compilation of GCC, I run into the following errors:

Code: Select all

Configuring in ./fixincludes
configure: loading cache ./config.cache
configure: error: `target_alias' has changed since the previous run:
configure:   former value:  `i686-pc-cygwin'
configure:   current value: `i586-elf'
configure: error: in `/usr/src/build-gcc/fixincludes':
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm ./config.cache' and start over
Makefile:3236: recipe for target `configure-fixincludes' failed
make: *** [configure-fixincludes] Error 1
I have not changed anything between running

Code: Select all

cd /usr/src/build-binutils
../binutils-x.xx/configure --target=$TARGET --prefix=$PREFIX --disable-nls
make all
make install
and the build of GCC, yet, for some reason, it seems as though my target gets changed.

Re: GCC Cross compiler errors

Posted: Mon Nov 26, 2012 2:54 pm
by qw
halofreak1990 wrote:Yeah, I should've guessed that was the problem. Though I'm curious... I've compiled many things with cygwin before, and I never needed it to be run with admin privileges. Why now?
I don't have the answer to that question but I did have the same problem once: Solved problem building cross compiler.

Re: Further GCC Cross compiler errors

Posted: Sat Dec 22, 2012 5:37 pm
by halofreak1990
I finally managed to compile GCC. I re-ran cygwin setup, reinstalled the required libs and updated some programs, and that produced a working GCC, but now I get a different error when trying to compile my kernel, namely:

Code: Select all

 /usr/local/cross/bin/i586-elf-ld.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
This is the exact error that made me recompile my GCC previously. (I had simply copied it over from my 32-bit machine, hoping it would work on 64-bit also)


EDIT: Running GCC from cmd showed that it couldn't find cygwin1.dll
After adding the cygwin bin directory to my PATH the error went away.