mailing list of musl libc
 help / color / mirror / code / Atom feed
* ARM unwind issue
@ 2013-01-28 23:02 Andre Renaud
  2013-01-29  0:44 ` Rich Felker
  2013-01-29  5:03 ` Isaac Dunham
  0 siblings, 2 replies; 5+ messages in thread
From: Andre Renaud @ 2013-01-28 23:02 UTC (permalink / raw)
  To: musl

Hi,
I'm trying to build some software using musl on an ARM platform, and
am getting the following error:
arm-none-linux-gnueabi-gcc
-specs=/home/andre/work/package-builder/staging/lib/musl-gcc.specs -o
program program.o
/tools/arm/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld:
program: hidden symbol `__aeabi_unwind_cpp_pr0' in
/tools/arm/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/libgcc_eh.a(unwind-arm.o)
is referenced by DSO

Any ideas on what I've messed up in either my musl build, or my
cflags/lflags to cause this?

Regards,
Andre


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ARM unwind issue
  2013-01-28 23:02 ARM unwind issue Andre Renaud
@ 2013-01-29  0:44 ` Rich Felker
  2013-01-29  5:03 ` Isaac Dunham
  1 sibling, 0 replies; 5+ messages in thread
From: Rich Felker @ 2013-01-29  0:44 UTC (permalink / raw)
  To: musl

On Tue, Jan 29, 2013 at 12:02:37PM +1300, Andre Renaud wrote:
> Hi,
> I'm trying to build some software using musl on an ARM platform, and
> am getting the following error:
> arm-none-linux-gnueabi-gcc
> -specs=/home/andre/work/package-builder/staging/lib/musl-gcc.specs -o
> program program.o
> /tools/arm/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld:
> program: hidden symbol `__aeabi_unwind_cpp_pr0' in
> /tools/arm/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/libgcc_eh.a(unwind-arm.o)
> is referenced by DSO
> 
> Any ideas on what I've messed up in either my musl build, or my
> cflags/lflags to cause this?

musl itself does not use any unwinding facilities. However, on ARM, at
least with some gcc versions, some arithmetic functions in libgcc.a
are pulling in exception stuff for no good reason. I believe this is a
bug in the CFLAGS gcc is using to build libgcc, rather than an
intentional bad behavior, but I haven't looked into it in depth.

With that said, it looks like the problem is that, when musl libc.so
was built, it contained references to __aeabi_unwind_cpp_pr0 (from
libgcc.a) which were not resolved. Normally musl's configure script
also includes -lgcc_eh in $(LIBCC) for precisely this reason, so the
first thing I would do is check your config.mak and see what configure
chose for $(LIBCC).

If you figure out what went wrong, please report it to the list so we
can try to avoid the same thing happening for other users.

Rich


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ARM unwind issue
  2013-01-28 23:02 ARM unwind issue Andre Renaud
  2013-01-29  0:44 ` Rich Felker
@ 2013-01-29  5:03 ` Isaac Dunham
  2013-01-29 19:56   ` Andre Renaud
  1 sibling, 1 reply; 5+ messages in thread
From: Isaac Dunham @ 2013-01-29  5:03 UTC (permalink / raw)
  To: musl

On Tue, 29 Jan 2013 12:02:37 +1300
Andre Renaud <andre@bluewatersys.com> wrote:

> Hi,
> I'm trying to build some software using musl on an ARM platform, and
> am getting the following error:
> arm-none-linux-gnueabi-gcc
> -specs=/home/andre/work/package-builder/staging/lib/musl-gcc.specs -o
> program program.o
> /tools/arm/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld:
> program: hidden symbol `__aeabi_unwind_cpp_pr0' in
> /tools/arm/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/libgcc_eh.a(unwind-arm.o)
> is referenced by DSO

A few details that might be informative:

1: I'm guessing that this is a prepackaged glibc-targetted x86->armel cross toolchain from Linaro, specifically their 2010 release?

2: I guess you're manually duplicating 
REALGCC=/tools/arm/arm-2010q1/bin/gcc musl-gcc program.c -o program.o

3: Does this occur even with a trivial program (hello world or 
int main(){ }) ?

> Any ideas on what I've messed up in either my musl build, or my
> cflags/lflags to cause this?

Googling "hidden symbol is referenced by DSO" I find that similar problems occurr with newlib when not linked with libgcc.
So it would probably help figure it out if you attached your config.mak and musl-gcc.specs.


> Regards,
> Andre

-- 
Isaac Dunham <idunham@lavabit.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ARM unwind issue
  2013-01-29  5:03 ` Isaac Dunham
@ 2013-01-29 19:56   ` Andre Renaud
  2013-01-29 23:55     ` Rich Felker
  0 siblings, 1 reply; 5+ messages in thread
From: Andre Renaud @ 2013-01-29 19:56 UTC (permalink / raw)
  To: musl

>> I'm trying to build some software using musl on an ARM platform, and
>> am getting the following error:
>> arm-none-linux-gnueabi-gcc
>> -specs=/home/andre/work/package-builder/staging/lib/musl-gcc.specs -o
>> program program.o
>> /tools/arm/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld:
>> program: hidden symbol `__aeabi_unwind_cpp_pr0' in
>> /tools/arm/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/libgcc_eh.a(unwind-arm.o)
>> is referenced by DSO
>
> A few details that might be informative:
>
> 1: I'm guessing that this is a prepackaged glibc-targetted x86->armel cross toolchain from Linaro, specifically their 2010 release?

It's the codesourcery 2010q1 release.

> 2: I guess you're manually duplicating
> REALGCC=/tools/arm/arm-2010q1/bin/gcc musl-gcc program.c -o program.o
I actually wasn't using musl-gcc, I was manually adding the '-spec' line.

It turns out that the root cause was a mistake on my behalf when
configuring musl, which resulted in LIBCC not being set properly in
config.mak.

Regards,
Andre


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ARM unwind issue
  2013-01-29 19:56   ` Andre Renaud
@ 2013-01-29 23:55     ` Rich Felker
  0 siblings, 0 replies; 5+ messages in thread
From: Rich Felker @ 2013-01-29 23:55 UTC (permalink / raw)
  To: musl

On Wed, Jan 30, 2013 at 08:56:27AM +1300, Andre Renaud wrote:
> > 2: I guess you're manually duplicating
> > REALGCC=/tools/arm/arm-2010q1/bin/gcc musl-gcc program.c -o program.o
> I actually wasn't using musl-gcc, I was manually adding the '-spec' line.
> 
> It turns out that the root cause was a mistake on my behalf when
> configuring musl, which resulted in LIBCC not being set properly in
> config.mak.

Yes, that would do it. BTW, note that musl is _not_ using libgcc_eh
for anything itself. The need for libgcc_eh is due to libgcc having
unwanted dependencies on it, and musl needing those parts of libgcc.

Rich


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-01-29 23:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-28 23:02 ARM unwind issue Andre Renaud
2013-01-29  0:44 ` Rich Felker
2013-01-29  5:03 ` Isaac Dunham
2013-01-29 19:56   ` Andre Renaud
2013-01-29 23:55     ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).