summaryrefslogtreecommitdiff
path: root/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-ppc-inline.patch
blob: 032c68d9637817a453c14d2e99bf59dbcd17dea0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
on gcc-7.3.0 build failed as:
    # CFLAGS="-mcpu=powerpc -Os -pipe" emerge -v1 sys-fs/mac-fdisk
    cc   fdisk.o fdisklabel.o   -o fdisk
    fdisk.o: In function `check_consistency':
    fdisk.c:(.text+0x64): undefined reference to `__swap32'
    fdisk.c:(.text+0x70): undefined reference to `__swap32'

Avoid exporting inline symbols and workaround build failure.
--- a/fdisk.c
+++ b/fdisk.c
@@ -247,8 +247,8 @@ char read_char(char *mesg);
 jmp_buf listingbuf;
 
-inline unsigned short __swap16(unsigned short x) {
+static inline unsigned short __swap16(unsigned short x) {
 	return (((__u16)(x) & 0xFF) << 8) | (((__u16)(x) & 0xFF00) >> 8);
 }
-inline __u32 __swap32(__u32 x) {
+static inline __u32 __swap32(__u32 x) {
 	return (((__u32)(x) & 0xFF) << 24) | (((__u32)(x) & 0xFF00) << 8) | (((__u32)(x) & 0xFF0000) >> 8) | (((__u32)(x) & 0xFF000000) >> 24);
 }