Patchwork [ARM] Extend uclinux LINK_GCC_C_SEQUENCE_SPEC

login
register
mail settings
Submitter Zhenqiang Chen
Date March 19, 2013, 9:15 a.m.
Message ID <000001ce2482$3dddfd70$b999f850$@arm.com>
Download mbox | patch
Permalink /patch/228981/
State New
Headers show

Comments

Zhenqiang Chen - March 19, 2013, 9:15 a.m.
Hi,

libstdc++ configure will check "shl_load". If shared library is disabled in
gcc and uclibc configure, the libstdc++ configure will fail for options like
-mthumb -march=armv7-r. The fail logs like:

.../libgcc.a(unwind-arm.o): In function `unwind_phase2_forced':
unwind-arm.c:(.text+0x282): undefined reference to `memcpy'
unwind-arm.c:(.text+0x2b0): undefined reference to `memcpy'
collect2: error: ld returned 1 exit status

Logs show uclibc depends on "__aeabi_unwind_cpp_pr1" from libgcc. And
unwind_phase2_forced from libgcc depends on memcpy from uclibc. So an
additional %L is required for non-static link.

Is it OK for trunk?

Thanks!
-Zhenqiang

2013-03-19  Zhenqiang Chen <zhenqiang.chen@arm.com>

	* config/arm/uclinux-elf.h: Add %L to LINK_GCC_C_SEQUENCE_SPEC for
non- static link
Ramana Radhakrishnan - March 26, 2013, 2:02 p.m.
On Tue, Mar 19, 2013 at 9:15 AM, Zhenqiang Chen <zhenqiang.chen@arm.com> wrote:
> Hi,
>
> libstdc++ configure will check "shl_load". If shared library is disabled in
> gcc and uclibc configure, the libstdc++ configure will fail for options like
> -mthumb -march=armv7-r. The fail logs like:
>
> .../libgcc.a(unwind-arm.o): In function `unwind_phase2_forced':
> unwind-arm.c:(.text+0x282): undefined reference to `memcpy'
> unwind-arm.c:(.text+0x2b0): undefined reference to `memcpy'
> collect2: error: ld returned 1 exit status
>
> Logs show uclibc depends on "__aeabi_unwind_cpp_pr1" from libgcc. And
> unwind_phase2_forced from libgcc depends on memcpy from uclibc. So an
> additional %L is required for non-static link.
>
> Is it OK for trunk?
>
> Thanks!
> -Zhenqiang
>
> 2013-03-19  Zhenqiang Chen <zhenqiang.chen@arm.com>
>
>         * config/arm/uclinux-elf.h: Add %L to LINK_GCC_C_SEQUENCE_SPEC for
> non- static link
>
> diff --git a/gcc/config/arm/uclinux-elf.h b/gcc/config/arm/uclinux-elf.h
> index c1fe9f1..74d63df 100644
> --- a/gcc/config/arm/uclinux-elf.h
> +++ b/gcc/config/arm/uclinux-elf.h
> @@ -65,7 +65,7 @@
>
>  #undef LINK_GCC_C_SEQUENCE_SPEC
>  #define LINK_GCC_C_SEQUENCE_SPEC \
> -  "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
> +  "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G %L}"
>
>  /* Use --as-needed -lgcc_s for eh support.  */  #ifdef HAVE_LD_AS_NEEDED
>
>
>

Ok .

Ramana

Patch

diff --git a/gcc/config/arm/uclinux-elf.h b/gcc/config/arm/uclinux-elf.h
index c1fe9f1..74d63df 100644
--- a/gcc/config/arm/uclinux-elf.h
+++ b/gcc/config/arm/uclinux-elf.h
@@ -65,7 +65,7 @@ 

 #undef LINK_GCC_C_SEQUENCE_SPEC
 #define LINK_GCC_C_SEQUENCE_SPEC \
-  "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+  "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G %L}"

 /* Use --as-needed -lgcc_s for eh support.  */  #ifdef HAVE_LD_AS_NEEDED