Discussion:
Error on compile
Tobias Matt
2010-07-06 07:09:28 UTC
Permalink
Hi,

I tried to compile dietlibc on my little Debian Server an became the
following error:

bin-arm/diet gcc -D__dietlibc__ -pipe -nostdinc -Os
-fomit-frame-pointer -fstrict-aliasing -mabi=aapcs-linux
-mfloat-abi=soft -mno-thumb-interwork -W -Wall -Wextra
-Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations
-Wno-switch -Wno-unused -Wredundant-decls -o bin-arm/elftrunc
contrib/elftrunc.c
make: *** [bin-arm/elftrunc] Speicherzugriffsfehler

I have no idea, what's the problem. Can someone give me a hint?

Thanks,
Tobias
Felix von Leitner
2010-07-06 11:28:42 UTC
Permalink
Post by Tobias Matt
I tried to compile dietlibc on my little Debian Server an became the
bin-arm/diet gcc -D__dietlibc__ -pipe -nostdinc -Os
-fomit-frame-pointer -fstrict-aliasing -mabi=aapcs-linux
-mfloat-abi=soft -mno-thumb-interwork -W -Wall -Wextra
-Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations
-Wno-switch -Wno-unused -Wredundant-decls -o bin-arm/elftrunc
contrib/elftrunc.c
make: *** [bin-arm/elftrunc] Speicherzugriffsfehler
I have no idea, what's the problem. Can someone give me a hint?
That indicates an error in the startup code.
Can you please do this:

$ make clean
$ make DEBUG=1

It should crash at the same point but this time you have debug symbols.
Then do this:

$ gdb bin-arm/diet
[...]
(gdb) r

it should tell you the program crashed, and where. Then send us that
information.

Felix
Tobias Matt
2010-07-06 16:22:03 UTC
Permalink
Post by Felix von Leitner
Post by Tobias Matt
I tried to compile dietlibc on my little Debian Server an became the
bin-arm/diet gcc -D__dietlibc__ -pipe -nostdinc -Os
-fomit-frame-pointer -fstrict-aliasing -mabi=aapcs-linux
-mfloat-abi=soft -mno-thumb-interwork -W -Wall -Wextra
-Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations
-Wno-switch -Wno-unused -Wredundant-decls -o bin-arm/elftrunc
contrib/elftrunc.c
make: *** [bin-arm/elftrunc] Speicherzugriffsfehler
I have no idea, what's the problem. Can someone give me a hint?
That indicates an error in the startup code.
 $ make clean
 $ make DEBUG=1
It should crash at the same point but this time you have debug symbols.
 $ gdb bin-arm/diet
 [...]
 (gdb) r
it should tell you the program crashed, and where.  Then send us that
information.
Ok, I tried this, but then I don't become the error. (make => Error,
make DEBUG=1 => No Error). I tried it a lot of times.
If I run gdb bin-arm/diet I get this output:

$ gdb bin-arm/diet
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabi"...
(no debugging symbols found)
(gdb) r
Starting program: /home/tobias/fefe/dietlibc/bin-arm/diet
diet version dietlibc-0.33 (non-install version in source tree)

usage: diet [-v] [-Os] gcc command line
e.g. diet -Os gcc -c t.c
or diet sparc-linux-gcc -o foo foo.c bar.o

Program exited with code 01.


Also I tried make DEBUG=1 without a make clean. Then I get the following output:

$ gdb bin-arm/diet
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabi"...
(no debugging symbols found)
(gdb) r
Starting program: /home/tobias/fefe/dietlibc/bin-arm/diet

Program received signal SIGSEGV, Segmentation fault.
0x622f81a8 in ?? ()

I hope it helps a little bit.

Tobias
Tilman Sauerbeck
2010-07-06 19:15:17 UTC
Permalink
Post by Tobias Matt
Post by Felix von Leitner
Post by Tobias Matt
I tried to compile dietlibc on my little Debian Server an became the
bin-arm/diet gcc -D__dietlibc__ -pipe -nostdinc -Os
-fomit-frame-pointer -fstrict-aliasing -mabi=aapcs-linux
-mfloat-abi=soft -mno-thumb-interwork -W -Wall -Wextra
-Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations
-Wno-switch -Wno-unused -Wredundant-decls -o bin-arm/elftrunc
contrib/elftrunc.c
make: *** [bin-arm/elftrunc] Speicherzugriffsfehler
I have no idea, what's the problem. Can someone give me a hint?
That indicates an error in the startup code.
 $ make clean
 $ make DEBUG=1
It should crash at the same point but this time you have debug symbols.
 $ gdb bin-arm/diet
 [...]
 (gdb) r
it should tell you the program crashed, and where.  Then send us that
information.
Ok, I tried this, but then I don't become the error. (make => Error,
make DEBUG=1 => No Error). I tried it a lot of times.
Same here. On my test system (armv5tel-softfloat-linux-gnueabi), the
second alloca() in diet.c seems to fail (diet.c:100), causing the
following strcpy() to die.

Regards,
Tilman
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Felix von Leitner
2010-07-09 14:52:58 UTC
Permalink
Post by Tilman Sauerbeck
Same here. On my test system (armv5tel-softfloat-linux-gnueabi), the
second alloca() in diet.c seems to fail (diet.c:100), causing the
following strcpy() to die.
alloca does not fail.

So, if you get a crash in that line, then either strlen or getenv is
broken. Since getenv calls strlen, it's probably getenv.

I'm having a different problem right now. I updated my ARM toolchain to
gcc 4.5 and now it does not compile any arm code for me anymore. The
error message is:

arm/start.S:1:0: error: FPA is unsupported in the AAPCS

This is caused by -mabi=aapcs-linux, which was given to me as the option
to pass to gcc to get EABI support. Can some ARM specialist please find
out how to fix this, preferable in a way that does not require me to run
gcc twice (once to find out the version)?

Felix
Johannes Stezenbach
2010-07-09 16:20:47 UTC
Permalink
Post by Felix von Leitner
I'm having a different problem right now. I updated my ARM toolchain to
gcc 4.5 and now it does not compile any arm code for me anymore. The
arm/start.S:1:0: error: FPA is unsupported in the AAPCS
EABI uses IEEE-754 floating point format, FPA format is history.
Post by Felix von Leitner
This is caused by -mabi=aapcs-linux, which was given to me as the option
to pass to gcc to get EABI support. Can some ARM specialist please find
out how to fix this, preferable in a way that does not require me to run
gcc twice (once to find out the version)?
How did you configure your toolchain? --with-float=soft ?

I guess you used hard float for smaller code size.
What is your target CPU? For ARMv4 architecture FPA was default,
for ARMv5 it is VFP -- and EABI is only specified for ARMv5+
(although there is a kludge for ARMv4).
The Linux kernel contains a VFP emulator.

Try one or more of:
-march=armv5
-mfloat-abi=softfp
-mfpu=vfp

but you better fix your gcc configuration to get a working libgcc.


HTH,
Johannes

Loading...