[Patch, Ada, Darwin] Adjust architecture for built shared libs.

Arnaud Charlet charlet@adacore.com
Mon Sep 5 19:03:00 GMT 2011


> ld needs to be passed the correct arch flag when building shared libs.
> 
> This means that the multi-libs built for 4.6.x and trunk contain junk
> (essentially all the input objects are rejected as having the wrong arch).
> 
> The attached corrects this.
> 
> OK for trunk and 4.6 (since this is a wrong-code issue)?

Well, the patch attached is OK. The patch inline in your mail body is NOT
(contains unrelated hunks).

I'd recommend that you do not duplicate patches like that, in particular not
if both are different, since this is very confusing and error prone.

> ada:
> 	* gcc-interface/Makefile.in (darwin, SO_OPTS): Provide architecture
> 	size
> switches to the link
> 	phase for shared libs.

Again, same problem with too longer lines in your changelog entry.

To clarify, the patch which is OK is the following:

> diff --git a/gcc/ada/gcc-interface/Makefile.in
> b/gcc/ada/gcc-interface/Makefile.in
> index 4be366e..8974a99 100644
> --- a/gcc/ada/gcc-interface/Makefile.in
> +++ b/gcc/ada/gcc-interface/Makefile.in
> @@ -2164,6 +2164,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(arch)
> $(osys))),)
>  endif
>  
>  ifeq ($(strip $(filter-out darwin%,$(osys))),)
> +  SO_OPTS = -Wl,-flat_namespace -shared-libgcc
>    ifeq ($(strip $(filter-out %86,$(arch))),)
>      LIBGNAT_TARGET_PAIRS = \
>      a-intnam.ads<a-intnam-darwin.ads \
> @@ -2184,6 +2185,7 @@ ifeq ($(strip $(filter-out darwin%,$(osys))),)
>        LIBGNAT_TARGET_PAIRS += \
>          $(X86_64_TARGET_PAIRS) \
>          system.ads<system-darwin-x86_64.ads
> +      SO_OPTS += -m64
>      else
>        LIBGNAT_TARGET_PAIRS += \
>          $(X86_TARGET_PAIRS) \
> @@ -2211,6 +2213,7 @@ ifeq ($(strip $(filter-out darwin%,$(osys))),)
>        LIBGNAT_TARGET_PAIRS += \
>          $(X86_TARGET_PAIRS) \
>          system.ads<system-darwin-x86.ads
> +      SO_OPTS += -m32
>      else
>        LIBGNAT_TARGET_PAIRS += \
>          $(X86_64_TARGET_PAIRS) \
> @@ -2243,7 +2246,6 @@ ifeq ($(strip $(filter-out darwin%,$(osys))),)
>  
>    EH_MECHANISM=-gcc
>    GNATLIB_SHARED = gnatlib-shared-darwin
> -  SO_OPTS = -Wl,-flat_namespace -shared-libgcc
>    RANLIB = ranlib -c
>    GMEM_LIB = gmemlib
>    LIBRARY_VERSION := $(LIB_VERSION)



More information about the Gcc-patches mailing list