Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/mac-fdisk/files/, sys-fs/mac-fdisk/
Date: Sat, 14 Jul 2018 22:25:42
Message-Id: 1531607132.f08e87dd650304c365a439efbb3f52197392d01a.slyfox@gentoo
1 commit: f08e87dd650304c365a439efbb3f52197392d01a
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jul 14 22:25:23 2018 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 14 22:25:32 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f08e87dd
7
8 sys-fs/mac-fdisk: workaround link failure on gcc-7
9
10 Reported-by: hotaronohanako
11 Package-Manager: Portage-2.3.42, Repoman-2.3.9
12
13 .../files/mac-fdisk-0.1_p16-ppc-inline.patch | 21 +++++++++++++++++++++
14 sys-fs/mac-fdisk/mac-fdisk-0.1_p16.ebuild | 4 +++-
15 2 files changed, 24 insertions(+), 1 deletion(-)
16
17 diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-ppc-inline.patch b/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-ppc-inline.patch
18 new file mode 100644
19 index 00000000000..032c68d9637
20 --- /dev/null
21 +++ b/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-ppc-inline.patch
22 @@ -0,0 +1,21 @@
23 +on gcc-7.3.0 build failed as:
24 + # CFLAGS="-mcpu=powerpc -Os -pipe" emerge -v1 sys-fs/mac-fdisk
25 + cc fdisk.o fdisklabel.o -o fdisk
26 + fdisk.o: In function `check_consistency':
27 + fdisk.c:(.text+0x64): undefined reference to `__swap32'
28 + fdisk.c:(.text+0x70): undefined reference to `__swap32'
29 +
30 +Avoid exporting inline symbols and workaround build failure.
31 +--- a/fdisk.c
32 ++++ b/fdisk.c
33 +@@ -247,8 +247,8 @@ char read_char(char *mesg);
34 + jmp_buf listingbuf;
35 +
36 +-inline unsigned short __swap16(unsigned short x) {
37 ++static inline unsigned short __swap16(unsigned short x) {
38 + return (((__u16)(x) & 0xFF) << 8) | (((__u16)(x) & 0xFF00) >> 8);
39 + }
40 +-inline __u32 __swap32(__u32 x) {
41 ++static inline __u32 __swap32(__u32 x) {
42 + return (((__u32)(x) & 0xFF) << 24) | (((__u32)(x) & 0xFF00) << 8) | (((__u32)(x) & 0xFF0000) >> 8) | (((__u32)(x) & 0xFF000000) >> 24);
43 + }
44
45 diff --git a/sys-fs/mac-fdisk/mac-fdisk-0.1_p16.ebuild b/sys-fs/mac-fdisk/mac-fdisk-0.1_p16.ebuild
46 index 19b9fff8a39..32ae45a5601 100644
47 --- a/sys-fs/mac-fdisk/mac-fdisk-0.1_p16.ebuild
48 +++ b/sys-fs/mac-fdisk/mac-fdisk-0.1_p16.ebuild
49 @@ -1,4 +1,4 @@
50 -# Copyright 1999-2015 Gentoo Foundation
51 +# Copyright 1999-2018 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53
54 EAPI=5
55 @@ -34,6 +34,8 @@ src_prepare() {
56 ### Note that >=2TB disks may not work due to limitations of the Mac
57 ### Partition Table structure, this needs to be investigated
58 epatch "${FILESDIR}"/big_pt.patch
59 +
60 + epatch "${FILESDIR}"/${PN}-0.1_p16-ppc-inline.patch
61 }
62
63 src_compile() {