diff options
author | Roberto Oliveira <robertoguimaraes8@gmail.com> | 2017-04-18 17:54:33 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2017-04-19 11:59:11 +0000 |
commit | f909cdda508620a32548c406223a50c90c22be0d (patch) | |
tree | e340411f7980c7bc2015acaf2f4b9771a4f7665a /main/libbsd/fix-build-with-musl-on-ppc64le.patch | |
parent | 4529845afe2cf9ef8185fc097113d861d54883b0 (diff) | |
download | aports-f909cdda508620a32548c406223a50c90c22be0d.tar.bz2 aports-f909cdda508620a32548c406223a50c90c22be0d.tar.xz |
main/libbsd: enable build on ppc64le
Libbsd includes a.out.h header to get some definitions, like struct nlist,
struct exec.
In Alpine x86_64 this header is provided by linux-headers package (linux/a.out.h),
in Ubuntu ppc64le it is provided by glibc (a.out.h), but in Alpine ppc64le it is not
available.
A workaround for this problem is to define the types that are being used
by libbsd instead of including the invalid header for ppc64le.
Diffstat (limited to 'main/libbsd/fix-build-with-musl-on-ppc64le.patch')
-rw-r--r-- | main/libbsd/fix-build-with-musl-on-ppc64le.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/main/libbsd/fix-build-with-musl-on-ppc64le.patch b/main/libbsd/fix-build-with-musl-on-ppc64le.patch new file mode 100644 index 0000000000..0385f38175 --- /dev/null +++ b/main/libbsd/fix-build-with-musl-on-ppc64le.patch @@ -0,0 +1,60 @@ +Libbsd includes a.out.h header to get some definitions like struct nlist, struct exec. + +In Alpine x86_64 this header is provided by linux-headers package (linux/a.out.h), +in Ubuntu ppc64le it is provided by glibc (a.out.h), but in Alpine ppc64le it is not +available. + +A workaround for this problem is to define the types that are being used +by libbsd instead of including the invalid header for ppc64le. +=== +--- libbsd-0.8.3.orig/src/nlist.c ++++ libbsd-0.8.3/src/nlist.c +@@ -40,7 +40,48 @@ + + #include <errno.h> + #include <fcntl.h> ++ ++#ifndef __powerpc64__ + #include <linux/a.out.h> ++#else ++// Copied from a.out.h, because it is not available on ppc64le with musl ++struct nlist ++{ ++ union ++ { ++ char *n_name; ++ struct nlist *n_next; ++ long n_strx; ++ } n_un; ++ unsigned char n_type; ++ char n_other; ++ short n_desc; ++ unsigned long n_value; ++}; ++ ++struct exec ++{ ++ unsigned long a_info; /* Use macros N_MAGIC, etc for access. */ ++ unsigned int a_text; /* Length of text, in bytes. */ ++ unsigned int a_data; /* Length of data, in bytes. */ ++ unsigned int a_bss; /* Length of uninitialized data area for file, in bytes. */ ++ unsigned int a_syms; /* Length of symbol table data in file, in bytes. */ ++ unsigned int a_entry; /* Start address. */ ++ unsigned int a_trsize;/* Length of relocation info for text, in bytes. */ ++ unsigned int a_drsize;/* Length of relocation info for data, in bytes. */ ++}; ++ ++#define N_UNDF 0 ++#define N_ABS 2 ++#define N_TEXT 4 ++#define N_DATA 6 ++#define N_BSS 8 ++#define N_FN 15 ++#define N_EXT 1 ++#define N_STAB 0340 ++ ++#endif ++ + #include <stdio.h> + #include <string.h> + #include <unistd.h> |