Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sat, 04 Jan 2020 18:45:24
Message-Id: 1578163509.5136179f9356f0bcb34fa5b8c5d0d0817f316ec9.gyakovlev@gentoo
1 commit: 5136179f9356f0bcb34fa5b8c5d0d0817f316ec9
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 4 09:07:30 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 4 18:45:09 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5136179f
7
8 toolchain.eclass: enable elfv2 abi on powerpc64-*-musl unconditionally
9
10 on ppc64 gcc assumes the following:
11 from gcc ppc64 manual:
12 -mabi=elfv1
13
14 Change the current ABI to use the ELFv1 ABI. This is the default ABI
15 for big-endian PowerPC 64-bit Linux. Overriding the default ABI
16 requires special system support and is likely to fail in spectacular
17 ways.
18 -mabi=elfv2
19
20 Change the current ABI to use the ELFv2 ABI. This is the default
21 ABI for little-endian PowerPC 64-bit Linux. Overriding the
22 default ABI requires special system support and is likely to
23 fail in spectacular ways.
24
25 Since we are taking gcc defaults, let's pass --with-abi=elfv2 on musl
26 targets
27 without it it will fail, since musl does not support elfv1 at all.
28 from musl INSTALL file:
29
30 * PowerPC64
31 * Both little and big endian variants are supported
32 * Compiler toolchain must provide 64-bit long double, not IBM
33 double-double or IEEE quad
34 * Compiler toolchain must use the new (ELFv2) ABI regardless of
35 whether it is for little or big endian
36
37 https://git.musl-libc.org/cgit/musl/tree/INSTALL
38 Closes: https://github.com/gentoo/gentoo/pull/14234
39 Closes: https://bugs.gentoo.org/704784
40 Revieved-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
41 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
42
43 eclass/toolchain.eclass | 8 ++++++++
44 1 file changed, 8 insertions(+)
45
46 diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
47 index 6d469564fa5..ada2e4496fc 100644
48 --- a/eclass/toolchain.eclass
49 +++ b/eclass/toolchain.eclass
50 @@ -1207,6 +1207,14 @@ toolchain_src_configure() {
51 is-flagq -mfloat-gprs=double && confgcc+=( --enable-e500-double )
52 [[ ${CTARGET//_/-} == *-e500v2-* ]] && confgcc+=( --enable-e500-double )
53 ;;
54 + ppc64)
55 + # On ppc64 big endian target gcc assumes elfv1 by default,
56 + # and elfv2 on little endian
57 + # but musl does not support elfv1 at all on any endian ppc64
58 + # see https://git.musl-libc.org/cgit/musl/tree/INSTALL
59 + # https://bugs.gentoo.org/704784
60 + [[ ${CTARGET} == powerpc64-*-musl ]] && confgcc+=( --with-abi=elfv2 )
61 + ;;
62 riscv)
63 # Add --with-abi flags to set default ABI
64 confgcc+=( --with-abi=$(gcc-abi-map ${TARGET_DEFAULT_ABI}) )