On Mon, Aug 24, 2015 at 06:25:14PM +0200, Szabolcs Nagy wrote:
> * David Edelsohn <dje....@gmail.com> [2015-08-24 10:21:05 -0400]:
> > Patch v2.
> > 
> > Powerpc does not include the top level linux.h, so I had to
> > repeat the include order fixes from there in rs6000/sysv4.h.
> > 
> > I corrected the endianness handling (the "le" suffix should
> > be added correctly now).
> > 
> > gcc/Changelog:
> > 
> > 2015-04-24  Gregor Richards  <gregor.richa...@uwaterloo.ca>
> >    Szabolcs Nagy  <szabolcs.n...@arm.com>
> > 
> > * config.gcc (secure_plt): Add *-linux*-musl*.
> > * config/rs6000/linux64.h (MUSL_DYNAMIC_LINKER32): Define.
> > (MUSL_DYNAMIC_LINKER64): Define.
> > (GNU_USER_DYNAMIC_LINKER32): Update.
> > (GNU_USER_DYNAMIC_LINKER64): Update.
> > (CHOOSE_DYNAMIC_LINKER): Update.
> > 
> > * config/rs6000/secureplt.h (LINK_SECURE_PLT_DEFAULT_SPEC): Define.
> > * config/rs6000/sysv4.h (GNU_USER_DYNAMIC_LINKER): Update.
> > (MUSL_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER_E,)
> > (INCLUDE_DEFAULTS_MUSL_GPP, INCLUDE_DEFAULTS_MUSL_LOCAL,)
> > (INCLUDE_DEFAULTS_MUSL_PREFIX, INCLUDE_DEFAULTS_MUSL_CROSS,)
> > (INCLUDE_DEFAULTS_MUSL_TOOL, INCLUDE_DEFAULTS_MUSL_NATIVE): Define.
> > (LINK_SECURE_PLT_DEFAULT_SPEC): Define.
> > (CHOOSE_DYNAMIC_LINKER, LINK_TARGET_SPEC, LINK_OS_LINUX_SPEC): Update.
> > 
> > * config/rs6000/sysv4le.h (MUSL_DYNAMIC_LINKER_E): Define.
> > 
> > This patch is generally okay, but why all of the secure PLT changes?
> > 
> 
> i'm not sure.. i kept that from a previous version of the patch
> 
> musl dynamic linker only supports secure plt and it seems
> gcc (configured with --enable-secureplt) does not pass
> --secure-plt to ld, the ld manual says this flag is only
> needed for non-pic code otherwise it will figure out the
> plt abi, so it is probably not needed.  i will check.

Dynamic-linked code can be non-PIC (in the main program) so maybe
that's the problem? I would make sure to test all cases before
removing this.

> >  /* Override the default target of the linker.  */
> >  #define LINK_TARGET_SPEC \
> > -  ENDIAN_SELECT("", " --oformat elf32-powerpcle", "")
> > +  ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") \
> > +  "%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
> > 
> > elf32-powerpcle is not defined and does not exist.  The original
> > change in sysv4.h seems to be an errant search-and-replace error.
> > 
> 
> ok so that line should be removed.
> 
> meanwhile i found another bug in my patch:
> 
> soft float abi is different so it needs a different dynamic
> linker name for musl.  this is problematic because i don't
> see an easy way to determine if the target is soft-float.
> (i will probably have to have a long list of cpu types and
> handle -msoft-float, -mhard-float too which will be ugly in
> the link spec syntax).

Yes. We don't have soft-float ABI support yet, but it's an open
request on the musl mailing list and not having GCC logic for choosing
the right dynamic linker is what's blocking my acceptance of the
patch. Once it looks like the path for doing that is clear on the GCC
side I'll go ahead and add it in musl.

Rich

Reply via email to