You are not logged in.

#1 2008-08-19 03:41:09

samwise
Member
From: Sydney, Australia
Registered: 2008-07-26
Posts: 53
Website

cross-arm-elf-binutils build fail (SOLVED)

I was trying to use the cross-arm-elf-binutils and cross-arm-elf-gcc-base packages to do some ARM assembly and C programming, but gas was segfaulting:

12:16, in exp1 $ make -k
make -e -f flash-v1.make 
make[1]: Entering directory `/home/samwise/C-programs/elec2142/labs/exp1'
arm-elf-as -marm7tdmi --gdwarf2 flash-v1.s -o flash-v1.o
make[1]: *** [flash-v1.o] Segmentation fault
make[1]: *** Deleting file `flash-v1.o'
make[1]: Target `all' not remade because of errors.
make[1]: Leaving directory `/home/samwise/C-programs/elec2142/labs/exp1'
make: *** [all] Error 2
12:16, in exp1 $ ls
Makefile  cstart.o  cstart.s  flash-v1.make  flash-v1.s  flash-v2.make  flash-v2.s  flash.c  flash.h  flash.make
12:16, in exp1 $ make -f flash.make
arm-elf-gcc -c -mcpu=arm7tdmi -O2 -g -Wall flash.c -o flash.o
arm-elf-ld  flash.o cstart.o   -o flash.elf
arm-elf-ld: ERROR: cstart.o uses hardware FP, whereas flash.elf uses software FP
arm-elf-ld: failed to merge target specific data of file cstart.o
make: *** [flash.elf] Error 1

I suspected it was a 64 bit issue as I'm using Arch64. So I tried to build the cross-arm-elf-binutils package using the PKGBUILD on the AUR, but I get a build error:

make[4]: Entering directory `/home/samwise/ABS/cross-arm-elf-binutils/src/binutils-2.17/gas'
gcc -DHAVE_CONFIG_H -I. -I.././gas -I. -D_GNU_SOURCE -I. -I.././gas -I../bfd -I.././gas/config -I.././gas/../include -I.././gas/.. -I.././gas/../bfd -I.././gas/../intl -I../intl -DLOCALEDIR="\"/usr/share/locale\""   -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -march=x86-64 -mtune=generic -O2 -pipe -c app.c
cc1: warnings being treated as errors
app.c: In function 'do_scrub_chars':
app.c:566: error: array subscript is below array bounds
make[4]: *** [app.o] Error 1
make[4]: Leaving directory `/home/samwise/ABS/cross-arm-elf-binutils/src/binutils-2.17/gas'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/samwise/ABS/cross-arm-elf-binutils/src/binutils-2.17/gas'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/samwise/ABS/cross-arm-elf-binutils/src/binutils-2.17/gas'
make[1]: *** [all-gas] Error 2
make[1]: Leaving directory `/home/samwise/ABS/cross-arm-elf-binutils/src/binutils-2.17'
make: *** [all] Error 2

'array subscript is below array bounds' - could this be the source of the segfault? I'm new to cross-compiling and I understand it's finicky, however any help would be appreciated.
(I did once try Linux From Scratch, but gave up after I realized I had just compiled a compiler to compile my compiler and my head exploded)

Last edited by samwise (2008-08-21 08:58:52)


"He was perfect except for the fact that he was an engineer"

Offline

#2 2008-08-21 08:52:43

samwise
Member
From: Sydney, Australia
Registered: 2008-07-26
Posts: 53
Website

Re: cross-arm-elf-binutils build fail (SOLVED)

OK I have it working with this patch to the PKGBUILD:

--- /var/abs/community/devel/cross-arm-elf-binutils/PKGBUILD    2007-08-01 00:31:18.000000000 +1000
+++ PKGBUILD    2008-08-21 18:26:19.000000000 +1000
@@ -1,5 +1,5 @@
 pkgname=cross-arm-elf-binutils
-pkgver=2.17
+pkgver=2.18
 pkgrel=1
 pkgdesc="A set of programs to assemble and manipulate binary and object files"
 arch=(i686 x86_64)
@@ -8,7 +8,7 @@
 url="http://sources.redhat.com/binutils"
 depends=('glibc')
 source=(ftp://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.bz2)
-md5sums=('e26e2e06b6e4bf3acf1dc8688a94c0d1')
+md5sums=('9d22ee4dafa3a194457caf4706f9cf01')
 
 _prefix=/usr
 
@@ -27,8 +27,6 @@
   make tooldir=${startdir}/pkg/$_prefix || return 1
   make prefix=${startdir}/pkg/$_prefix tooldir=${startdir}/pkg/$_prefix install || return 1
 
-  cp -v include/libiberty.h $startdir/pkg/$_prefix/lib/binutils/arm-elf
-
   rm -f ${startdir}/pkg/$_prefix/man/man1/{dlltool,nlmconv,windres}* || return 1
 
   rm -f $startdir/pkg/usr/bin/ar || return 1
@@ -36,8 +34,10 @@
   rm -f $startdir/pkg/usr/bin/ld || return 1
   rm -f $startdir/pkg/usr/bin/nm || return 1
   rm -f $startdir/pkg/usr/bin/objdump || return 1
+  rm -f $startdir/pkg/usr/bin/objcopy || return 1
   rm -f $startdir/pkg/usr/bin/ranlib || return 1
   rm -f $startdir/pkg/usr/bin/strip || return 1
   rm -f $startdir/pkg/usr/lib/libiberty.a || return 1
-  rm -rf $startdir/pkg/usr/share
+  rm -rf $startdir/pkg/usr/share || return 1
+  rm -rf $startdir/pkg/usr/info || return 1
 }

"He was perfect except for the fact that he was an engineer"

Offline

Board footer

Powered by FluxBB