Bug 93157 - gcc should use -mabi=elfv2 on powerpc64-*-linux-*musl* target by default.
Summary: gcc should use -mabi=elfv2 on powerpc64-*-linux-*musl* target by default.
Status: WAITING
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-05 05:02 UTC by gyakovlev
Modified: 2020-01-27 14:03 UTC (History)
4 users (show)

See Also:
Host:
Target: powerpc64-*-linux-*musl*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-01-21 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gyakovlev 2020-01-05 05:02:58 UTC
encountered with 9.2.0 but I think all versions affected.


By default at configuration time gcc assumes that powerpc64-*-linux-* (big endian ppc64) targets use ELFv1 ABI, and ELFv2 abi on little-endian.

But musl libc does not support ELFv1 at all on either endian ppc64.

Their INSTALL file clearly mentions:
* PowerPC64
    * Both little and big endian variants are supported
    * Compiler toolchain must provide 64-bit long double, not IBM
      double-double or IEEE quad
    * Compiler toolchain must use the new (ELFv2) ABI regardless of
      whether it is for little or big endian

I think gcc configuration should default to --with-abi=elfv2 on powerpc64-*-linux-*musl* target.


 * Configuring GCC with:
 *      --host=powerpc64-unknown-linux-gnu
 *      --target=powerpc64-unknown-linux-musl
 *      --build=powerpc64-unknown-linux-gnu



after that musl fails
checking whether linker accepts -lgcc_eh... yes
using compiler runtime libraries: -lgcc -lgcc_eh
checking preprocessor condition _CALL_ELF == 2... false
./configure: error: unsupported powerpc64 ABI
Comment 1 Martin Liška 2020-01-21 14:18:40 UTC
@Segher: Can you please take a look?
Comment 2 Segher Boessenkool 2020-01-23 14:20:37 UTC
Someone who can test this should send a patch, and Cc: the Musl OS port maintainer
(is there one?  There should be!)