This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, committed] AIX libstdc++ LD_FLAGS

On 10/30/2014 03:19 PM, David Edelsohn wrote:
> AIX has been unable to bootstrap since the match-and-simplify merge.
> Richard Biener and I tracked this back to a bad interaction between a
> GCC optimization and the AIX linker -G option to allow for SVR4-style
> runtime linking.

As the -G linker option is the equivalent of specifying the options
"-berok -brtl -bnortllib -bnosymbolic -bnoautoexp -bM:SRE", did you
track down which one exactly interacts with that GCC optimization?

Background is that I do rely on the "-brtl" linker flag actually, to
allow Linux-like filename-based sharedlib versioning, using plain text
"Import Files" as member of the archive. We talked about
that years ago, and I do plan to redo "aix-soname" for gcc-trunk.

> The following patch removes the linker option from the libstdc++
> build.  This will prevent runtime function interposition, e.g.
> overriding operator new, when using libstdc++, but that is rarely
> needed.

While I agree things like overriding operator new is rarely needed, I
doubt it is acceptable to prevent this deliberately on an otherwise
fully supportable platform. As far as I can see, even IBM is after
getting as many Linux-known features as possible into AIX...

Would it work to use sth. like "-G -bsymbolic" instead?


> This patch also uses the default atomic support
> Bootstrapped on powerpc-ibm-aix7.1.0.0
> 2014-10-30  David Edelsohn  <>
>         * (aix5+): New stanza.
>         (aix4.3+): Do not use -G in link command.
> Index:
> ===================================================================
> ---      (revision 216851)
> +++      (working copy)
> @@ -212,14 +212,20 @@
>  # CPU-specifc, set those here too.
>  case "${host_os}" in
> -  aix4.[3456789]* | aix[56789]*)
> +  aix[56789]*)
> +    # Newer versions of AIX only support PowerPC architecture, so use
> +    # atomic instructions directly.
> +    os_include_dir="os/aix"
> +    atomicity_dir="cpu/generic"
> +    atomic_word_dir="os/aix"
> +    ;;
> +  aix4.[3456789]*)
>      # We set os_include_dir to os/aix only on AIX 4.3 and newer, but
>      # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we
>      # explicitly duplicate the directory for 4.[<3].
>      os_include_dir="os/aix"
>      atomicity_dir="os/aix"
>      atomic_word_dir="os/aix"
> -    OPT_LDFLAGS="-Wl,-G"
>      ;;
>    aix4.*)
>      os_include_dir="os/generic"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]