commit: 2e6b6a5e8a24555f4d421ca9b166b7ae7cc986cf
parent 49f60b7f236dbd4fc4839a1c17632ddafb91c001
Author: Michael Forney <mforney@mforney.org>
Date: Fri, 7 Jun 2019 21:00:49 -0700
Add elftoolchain 0.7.1
Diffstat:
8 files changed, 117 insertions(+), 0 deletions(-)
diff --git a/pkg/elftoolchain/.gitignore b/pkg/elftoolchain/.gitignore
@@ -0,0 +1,2 @@
+/elftoolchain-0.7.1.tgz
+/src
diff --git a/pkg/elftoolchain/gen.lua b/pkg/elftoolchain/gen.lua
@@ -0,0 +1,78 @@
+cflags{
+ '-Wall',
+ '-I $dir',
+ '-I $srcdir/common',
+ '-I $srcdir/libelf',
+ '-idirafter pkg/openbsd/src/sys',
+}
+
+pkg.hdrs = {
+ copy('$outdir/include', '$srcdir/libelf', {'libelf.h', 'gelf.h'}),
+ copy('$outdir/include', '$srcdir/common', {'elfdefinitions.h'}),
+}
+
+rule('m4', 'm4 -D SRCDIR=$srcdir/libelf $in >$out.tmp && mv $out.tmp $out')
+build('m4', '$outdir/libelf_convert.c', {'$srcdir/libelf/libelf_convert.m4', '|', '$srcdir/libelf/elf_types.m4'})
+build('m4', '$outdir/libelf_fsize.c', {'$srcdir/libelf/libelf_fsize.m4', '|', '$srcdir/libelf/elf_types.m4'})
+build('m4', '$outdir/libelf_msize.c', {'$srcdir/libelf/libelf_msize.m4', '|', '$srcdir/libelf/elf_types.m4'})
+
+lib('libelf.a', [[
+ libelf/(
+ elf.c
+ elf_begin.c
+ elf_cntl.c
+ elf_end.c elf_errmsg.c elf_errno.c
+ elf_data.c
+ elf_fill.c
+ elf_flag.c
+ elf_getarhdr.c
+ elf_getarsym.c
+ elf_getbase.c
+ elf_getident.c
+ elf_hash.c
+ elf_kind.c
+ elf_memory.c
+ elf_next.c
+ elf_open.c
+ elf_rand.c
+ elf_rawfile.c
+ elf_phnum.c
+ elf_shnum.c
+ elf_shstrndx.c
+ elf_scn.c
+ elf_strptr.c
+ elf_update.c
+ elf_version.c
+ gelf_cap.c
+ gelf_checksum.c
+ gelf_dyn.c
+ gelf_ehdr.c
+ gelf_getclass.c
+ gelf_fsize.c
+ gelf_move.c
+ gelf_phdr.c
+ gelf_rel.c
+ gelf_rela.c
+ gelf_shdr.c
+ gelf_sym.c
+ gelf_syminfo.c
+ gelf_symshndx.c
+ gelf_xlate.c
+ libelf_align.c
+ libelf_allocate.c
+ libelf_ar.c
+ libelf_ar_util.c
+ libelf_checksum.c
+ libelf_data.c
+ libelf_ehdr.c
+ libelf_extended.c
+ libelf_memory.c
+ libelf_open.c
+ libelf_phdr.c
+ libelf_shdr.c
+ libelf_xlate.c
+ )
+ $outdir/(libelf_convert.c libelf_fsize.c libelf_msize.c)
+]])
+
+fetch 'curl'
diff --git a/pkg/elftoolchain/native-elf-format.h b/pkg/elftoolchain/native-elf-format.h
@@ -0,0 +1,3 @@
+#define ELFTC_CLASS ELFCLASS64
+#define ELFTC_ARCH EM_X86_64
+#define ELFTC_BYTEORDER ELFDATA2LSB
diff --git a/pkg/elftoolchain/patch/0001-Ensure-that-the-value-of-a-32-bit-parameter-passed.patch b/pkg/elftoolchain/patch/0001-Ensure-that-the-value-of-a-32-bit-parameter-passed.patch
@@ -0,0 +1,30 @@
+From 6d5954e185dac4e24dd1936e53f09b6b3c1122c8 Mon Sep 17 00:00:00 2001
+From: jkoshy <jkoshy@95820547-d848-0410-985e-9ae8fe0fa350>
+Date: Sun, 9 Jun 2019 17:01:37 +0000
+Subject: [PATCH] Ensure that the value of a 32-bit parameter passed to the
+ ELF64_R_INFO() macro does not get lost.
+
+Submitted by: Michael Forney on -developers
+
+git-svn-id: https://svn.code.sf.net/p/elftoolchain/code/trunk@3742 95820547-d848-0410-985e-9ae8fe0fa350
+---
+ common/elfdefinitions.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/common/elfdefinitions.h b/common/elfdefinitions.h
+index 7f8d9043..dae45583 100644
+--- a/common/elfdefinitions.h
++++ b/common/elfdefinitions.h
+@@ -2606,7 +2606,8 @@ typedef struct {
+
+ #define ELF64_R_SYM(I) ((I) >> 32)
+ #define ELF64_R_TYPE(I) ((I) & 0xFFFFFFFFUL)
+-#define ELF64_R_INFO(S,T) (((S) << 32) + ((T) & 0xFFFFFFFFUL))
++#define ELF64_R_INFO(S,T) \
++ (((Elf64_Xword) (S) << 32) + ((T) & 0xFFFFFFFFUL))
+
+ /*
+ * Symbol versioning structures.
+--
+2.20.1
+
diff --git a/pkg/elftoolchain/sha256 b/pkg/elftoolchain/sha256
@@ -0,0 +1 @@
+92bfe36f886024bbc433846483b026c7ce44d553b9b941a0fd13e451911ae297 elftoolchain-0.7.1.tgz
diff --git a/pkg/elftoolchain/url b/pkg/elftoolchain/url
@@ -0,0 +1 @@
+url = "https://sourceforge.net/projects/elftoolchain/files/Sources/elftoolchain-0.7.1/elftoolchain-0.7.1.tgz"
diff --git a/pkg/elftoolchain/ver b/pkg/elftoolchain/ver
@@ -0,0 +1 @@
+0.7.1 r0
diff --git a/pkg/gen.lua b/pkg/gen.lua
@@ -13,6 +13,7 @@ subgen 'dmenu'
subgen 'e2fsprogs'
subgen 'efibootmgr'
subgen 'efivar'
+subgen 'elftoolchain'
subgen 'elfutils'
subgen 'expat'
subgen 'farbfeld'