summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2022-01-06 15:51:19 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2022-05-01 17:06:43 -0500
commitd2cb97d825484349a7272cf8c4553841f4781637 (patch)
tree20bfa978eceaba8eae64e7203c87e7fc6a0b9b5e
parentc27c06e34f0c5f7aabb278218e85672393cb6354 (diff)
downloadpackages-d2cb97d825484349a7272cf8c4553841f4781637.tar.gz
packages-d2cb97d825484349a7272cf8c4553841f4781637.tar.bz2
packages-d2cb97d825484349a7272cf8c4553841f4781637.tar.xz
packages-d2cb97d825484349a7272cf8c4553841f4781637.zip
system/libelf: patch headers to help kernel build. become maintainer.
-rw-r--r--system/libelf/APKBUILD11
-rw-r--r--system/libelf/preprocessor-warnings.patch264
2 files changed, 271 insertions, 4 deletions
diff --git a/system/libelf/APKBUILD b/system/libelf/APKBUILD
index 3ff6f8583..266591533 100644
--- a/system/libelf/APKBUILD
+++ b/system/libelf/APKBUILD
@@ -1,8 +1,8 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
-# Maintainer:
+# Maintainer: Zach van Rijn <me@zv.io>
pkgname=libelf
pkgver=0.8.13
-pkgrel=4
+pkgrel=5
pkgdesc="ELF object file access library"
url=" " # Dead upstream: http://www.mr511.de/software/
arch="all"
@@ -10,7 +10,9 @@ license="LGPL-2.0+"
depends=""
makedepends=""
subpackages="$pkgname-dev"
-source="https://distfiles.adelielinux.org/source/$pkgname-$pkgver.tar.gz"
+source="https://distfiles.adelielinux.org/source/$pkgname-$pkgver.tar.gz
+ preprocessor-warnings.patch
+"
prepare() {
default_prepare
@@ -36,4 +38,5 @@ package() {
make install prefix="$pkgdir"/usr
}
-sha512sums="d2a4ea8ccc0bbfecac38fa20fbd96aefa8e86f8af38691fb6991cd9c5a03f587475ecc2365fc89a4954c11a679d93460ee9a5890693112f6133719af3e6582fe libelf-0.8.13.tar.gz"
+sha512sums="d2a4ea8ccc0bbfecac38fa20fbd96aefa8e86f8af38691fb6991cd9c5a03f587475ecc2365fc89a4954c11a679d93460ee9a5890693112f6133719af3e6582fe libelf-0.8.13.tar.gz
+6f5e4a50c1fee7bae39c7fca237bbcad005b2b865ff9fbd835c7772f92f4a31324e958b7c583a378a5069eb5c43500d9a8881013f0a7a169310efba75b2f01e8 preprocessor-warnings.patch"
diff --git a/system/libelf/preprocessor-warnings.patch b/system/libelf/preprocessor-warnings.patch
new file mode 100644
index 000000000..e04c8ee20
--- /dev/null
+++ b/system/libelf/preprocessor-warnings.patch
@@ -0,0 +1,264 @@
+diff --git a/lib/elf_repl.h b/lib/elf_repl.h
+index c5cf90f..7e1e8df 100644
+--- a/lib/elf_repl.h
++++ b/lib/elf_repl.h
+@@ -45,7 +45,7 @@ typedef __libelf_u32_t Elf32_Word;
+ #define ELF32_FSZ_SWORD 4
+ #define ELF32_FSZ_WORD 4
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+
+ typedef __libelf_u64_t Elf64_Addr;
+ typedef __libelf_u16_t Elf64_Half;
+@@ -93,7 +93,7 @@ typedef struct {
+ Elf32_Half e_shstrndx;
+ } Elf32_Ehdr;
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+ unsigned char e_ident[EI_NIDENT];
+ Elf64_Half e_type;
+@@ -307,7 +307,7 @@ typedef struct {
+ Elf32_Word sh_entsize;
+ } Elf32_Shdr;
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+ Elf64_Word sh_name;
+ Elf64_Word sh_type;
+@@ -434,7 +434,7 @@ typedef struct {
+ Elf32_Half st_shndx;
+ } Elf32_Sym;
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+ Elf64_Word st_name;
+ unsigned char st_info;
+@@ -457,7 +457,7 @@ typedef struct {
+ #define ELF32_ST_TYPE(i) ((i)&0xf)
+ #define ELF32_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ #define ELF64_ST_BIND(i) ((i)>>4)
+ #define ELF64_ST_TYPE(i) ((i)&0xf)
+ #define ELF64_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
+@@ -495,7 +495,7 @@ typedef struct {
+ * Macros for manipulating st_other
+ */
+ #define ELF32_ST_VISIBILITY(o) ((o)&0x3)
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ #define ELF64_ST_VISIBILITY(o) ((o)&0x3)
+ #endif /* __LIBELF64 */
+
+@@ -521,7 +521,7 @@ typedef struct {
+ Elf32_Sword r_addend;
+ } Elf32_Rela;
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+ Elf64_Addr r_offset;
+ Elf64_Xword r_info;
+@@ -541,7 +541,7 @@ typedef struct {
+ #define ELF32_R_TYPE(i) ((unsigned char)(i))
+ #define ELF32_R_INFO(s,t) (((s)<<8)+(unsigned char)(t))
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ #define ELF64_R_SYM(i) ((Elf64_Xword)(i)>>32)
+ #define ELF64_R_TYPE(i) ((i)&0xffffffffL)
+ #define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
+@@ -556,7 +556,7 @@ typedef struct {
+ Elf32_Word n_type; /* descriptor type */
+ } Elf32_Nhdr;
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ /* Solaris and GNU use this layout. Be compatible. */
+ /* XXX: Latest ELF specs say it's 64-bit!!! */
+ typedef struct {
+@@ -587,7 +587,7 @@ typedef struct {
+ Elf32_Word p_align;
+ } Elf32_Phdr;
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+ Elf64_Word p_type;
+ Elf64_Word p_flags;
+@@ -654,7 +654,7 @@ typedef struct {
+ } d_un;
+ } Elf32_Dyn;
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+ Elf64_Sxword d_tag;
+ union {
+@@ -798,7 +798,7 @@ typedef struct {
+ Elf32_Half si_flags;
+ } Elf32_Syminfo;
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+ Elf64_Half si_boundto;
+ Elf64_Half si_flags;
+@@ -863,7 +863,7 @@ typedef struct {
+
+ typedef Elf32_Half Elf32_Versym;
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+
+ typedef struct {
+ Elf64_Half vd_version;
+@@ -933,7 +933,7 @@ typedef Elf64_Half Elf64_Versym;
+ /*
+ * Move section
+ */
+-#if __LIBELF64
++#if defined(__LIBELF64)
+
+ typedef struct {
+ Elf32_Lword m_value;
+@@ -973,7 +973,7 @@ typedef struct {
+ } c_un;
+ } Elf32_Cap;
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+
+ typedef struct {
+ Elf64_Xword c_tag;
+diff --git a/lib/gelf.h b/lib/gelf.h
+index 5af0558..98a759c 100644
+--- a/lib/gelf.h
++++ b/lib/gelf.h
+@@ -22,15 +22,15 @@
+ #ifndef _GELF_H
+ #define _GELF_H
+
+-#if __LIBELF_INTERNAL__
++#if defined(__LIBELF_INTERNAL__)
+ #include <libelf.h>
+ #else /* __LIBELF_INTERNAL__ */
+ #include <libelf/libelf.h>
+ #endif /* __LIBELF_INTERNAL__ */
+
+-#if __LIBELF_NEED_LINK_H
++#if defined(__LIBELF_NEED_LINK_H)
+ #include <link.h>
+-#elif __LIBELF_NEED_SYS_LINK_H
++#elif defined(__LIBELF_NEED_SYS_LINK_H)
+ #include <sys/link.h>
+ #endif /* __LIBELF_NEED_LINK_H */
+
+@@ -46,7 +46,7 @@ extern "C" {
+ # endif /* __STDC__ || defined(__cplusplus) */
+ #endif /* __P */
+
+-#if !__LIBELF64
++#if !defined(__LIBELF64)
+
+ #error "GElf is not supported on this system."
+
+@@ -71,7 +71,7 @@ typedef Elf64_Sym GElf_Sym;
+ /*
+ * Symbol versioning
+ */
+-#if __LIBELF_SYMBOL_VERSIONS
++#if defined(__LIBELF_SYMBOL_VERSIONS)
+ typedef Elf64_Verdef GElf_Verdef;
+ typedef Elf64_Verneed GElf_Verneed;
+ typedef Elf64_Verdaux GElf_Verdaux;
+diff --git a/lib/libelf.h b/lib/libelf.h
+index 3ebd0f3..788482d 100644
+--- a/lib/libelf.h
++++ b/lib/libelf.h
+@@ -25,7 +25,7 @@
+ #include <stddef.h> /* for size_t */
+ #include <sys/types.h>
+
+-#if __LIBELF_INTERNAL__
++#if defined(__LIBELF_INTERNAL__)
+ #include <sys_elf.h>
+ #else /* __LIBELF_INTERNAL__ */
+ #include <libelf/sys_elf.h>
+@@ -224,7 +224,7 @@ extern Elf_Data *elf32_xlatetom __P((Elf_Data *__dst, const Elf_Data *__src,
+ */
+ extern long elf32_checksum __P((Elf *__elf));
+
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ /*
+ * 64-bit ELF functions
+ * Not available on all platforms
+diff --git a/lib/sys_elf.h.in b/lib/sys_elf.h.in
+index b71a20d..722051b 100644
+--- a/lib/sys_elf.h.in
++++ b/lib/sys_elf.h.in
+@@ -68,7 +68,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ #ifdef __LIBELF_HEADER_ELF_H
+ # include __LIBELF_HEADER_ELF_H
+ #else /* __LIBELF_HEADER_ELF_H */
+-# if __LIBELF_INTERNAL__
++# if defined(__LIBELF_INTERNAL__)
+ # include <elf_repl.h>
+ # else /* __LIBELF_INTERNAL__ */
+ # include <libelf/elf_repl.h>
+@@ -92,7 +92,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ # define STN_UNDEF 0
+ # endif /* STN_UNDEF */
+
+-# if __LIBELF64
++# if defined(__LIBELF64)
+
+ # ifndef ELF64_FSZ_ADDR
+ # define ELF64_FSZ_ADDR 8
+@@ -116,7 +116,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ # define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
+ # endif /* ELF64_R_SYM */
+
+-# if __LIBELF64_LINUX
++# if defined(__LIBELF64_LINUX)
+ typedef __libelf_u64_t Elf64_Addr;
+ typedef __libelf_u16_t Elf64_Half;
+ typedef __libelf_u64_t Elf64_Off;
+diff --git a/lib/sys_elf.h.w32 b/lib/sys_elf.h.w32
+index 0f93c55..7360104 100644
+--- a/lib/sys_elf.h.w32
++++ b/lib/sys_elf.h.w32
+@@ -68,7 +68,7 @@
+ #ifdef __LIBELF_HEADER_ELF_H
+ # include __LIBELF_HEADER_ELF_H
+ #else /* __LIBELF_HEADER_ELF_H */
+-# if __LIBELF_INTERNAL__
++# if defined(__LIBELF_INTERNAL__)
+ # include <elf_repl.h>
+ # else /* __LIBELF_INTERNAL__ */
+ # include <libelf/elf_repl.h>
+@@ -92,7 +92,7 @@
+ # define STN_UNDEF 0
+ # endif /* STN_UNDEF */
+
+-# if __LIBELF64
++# if defined(__LIBELF64)
+
+ # ifndef ELF64_FSZ_ADDR
+ # define ELF64_FSZ_ADDR 8
+@@ -116,7 +116,7 @@
+ # define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
+ # endif /* ELF64_R_SYM */
+
+-# if __LIBELF64_LINUX
++# if defined(__LIBELF64_LINUX)
+ typedef __libelf_u64_t Elf64_Addr;
+ typedef __libelf_u16_t Elf64_Half;
+ typedef __libelf_u64_t Elf64_Off;