aboutsummaryrefslogtreecommitdiffstats
path: root/main/gummiboot
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2016-08-20 00:50:38 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2016-08-20 00:50:48 +0000
commit28af1a276a13207da834f35b392eacd8015605ad (patch)
treed0a5f77f4877a3ed1a461d59f30cbc61e0bcbd8a /main/gummiboot
parentfcbb052ec933fba64b3c476b198f044e092429d9 (diff)
downloadaports-28af1a276a13207da834f35b392eacd8015605ad.tar.bz2
aports-28af1a276a13207da834f35b392eacd8015605ad.tar.xz
main/gummiboot: set arch to all
Diffstat (limited to 'main/gummiboot')
-rw-r--r--main/gummiboot/APKBUILD37
-rw-r--r--main/gummiboot/gummiboot-aarch64-support.patch231
2 files changed, 249 insertions, 19 deletions
diff --git a/main/gummiboot/APKBUILD b/main/gummiboot/APKBUILD
index 752fbfeef9..9b0c1a6802 100644
--- a/main/gummiboot/APKBUILD
+++ b/main/gummiboot/APKBUILD
@@ -4,7 +4,7 @@ pkgver=48.1
pkgrel=0
pkgdesc="Simple EFI Boot Manager"
url="http://freedesktop.org/wiki/Software/gummiboot"
-arch="x86 x86_64"
+arch="all"
license="LGPLv2+"
depends=""
depends_dev="util-linux-dev"
@@ -12,37 +12,36 @@ makedepends="$depends_dev gnu-efi-dev autoconf automake docbook-xsl libxslt"
install=""
subpackages="$pkgname-doc"
#source="http://cgit.freedesktop.org/gummiboot/snapshot/gummiboot-$pkgver.tar.gz"
-source="http://dev.alpinelinux.org/archive/gummiboot/gummiboot-$pkgver.tar.gz"
+source="http://dev.alpinelinux.org/archive/gummiboot/gummiboot-$pkgver.tar.gz
+ gummiboot-aarch64-support.patch
+ "
+
+builddir="$srcdir"/gummiboot-$pkgver
-_builddir="$srcdir"/gummiboot-$pkgver
prepare() {
- local i
- cd "$_builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
- if ! [ -f ./configure ]; then
- ./autogen.sh
- fi
+ cd "$builddir"
+ default_prepare || return 1
+ ./autogen.sh || return 1
}
build() {
- cd "$_builddir"
+ cd "$builddir"
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
|| return 1
- make EFI_CFLAGS="$CFLAGS -std=gnu89"
+ make -j1 EFI_CFLAGS="$CFLAGS -std=gnu89"
}
package() {
- cd "$_builddir"
+ cd "$builddir"
make install DESTDIR="$pkgdir" || return 1
}
-md5sums="0cc22c57505e243eb8115abe82d174a4 gummiboot-48.1.tar.gz"
-sha256sums="2b649a6eb22007cd34bb355ba4ca6c1a8058e115c13048985f09a0f11f3d5295 gummiboot-48.1.tar.gz"
-sha512sums="a536db10ee384fa2cd38d22bd43f87215501c38471612a1d30986748d645d970e67b3f3d38fc9d6b53fe8532ec18283690f88d77b056dd737db5efb50bf63293 gummiboot-48.1.tar.gz"
+md5sums="0cc22c57505e243eb8115abe82d174a4 gummiboot-48.1.tar.gz
+a2a839382a217fbb7806bd0ee2be9a0f gummiboot-aarch64-support.patch"
+sha256sums="2b649a6eb22007cd34bb355ba4ca6c1a8058e115c13048985f09a0f11f3d5295 gummiboot-48.1.tar.gz
+d2d8bb1f2b0572fca61c2fc881acfbdf370abc3dd330f5018a959a3253d7ead2 gummiboot-aarch64-support.patch"
+sha512sums="a536db10ee384fa2cd38d22bd43f87215501c38471612a1d30986748d645d970e67b3f3d38fc9d6b53fe8532ec18283690f88d77b056dd737db5efb50bf63293 gummiboot-48.1.tar.gz
+6acc971c59b917616d75f5935859d109efff14c55b8fb26075ee89b6e4141f1c91708c1fc77f0acb2239d9030f4b350eaf1dac59ebb37e7a9ae5682eb52687cf gummiboot-aarch64-support.patch"
diff --git a/main/gummiboot/gummiboot-aarch64-support.patch b/main/gummiboot/gummiboot-aarch64-support.patch
new file mode 100644
index 0000000000..4f14ce5b34
--- /dev/null
+++ b/main/gummiboot/gummiboot-aarch64-support.patch
@@ -0,0 +1,231 @@
+From koen.kooi at linaro.org Sat Apr 11 01:23:22 2015
+From: koen.kooi at linaro.org (Koen Kooi)
+Date: Sat, 11 Apr 2015 10:23:22 +0200
+Subject: [systemd-devel] [gummiboot][PATCH 1/5] Makefile: support non-x86
+ builds
+Message-ID: <1428740606-30060-1-git-send-email-koen.kooi@linaro.org>
+
+Move the no-mmx/no-sse CFLAGS to X86-64 and IA32 defines in preparation
+for ARM32 and Aarch64 support.
+
+Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
+---
+ Makefile.am | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 6568a35..2cca313 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -94,17 +94,23 @@ efi_cflags = \
+ -ffreestanding \
+ -fno-strict-aliasing \
+ -fno-stack-protector \
+- -Wsign-compare \
+- -mno-sse \
+- -mno-mmx
++ -Wsign-compare
+
+ if ARCH_X86_64
+ efi_cflags += \
+ -mno-red-zone \
++ -mno-sse \
++ -mno-mmx
+ -DEFI_FUNCTION_WRAPPER \
+ -DGNU_EFI_USE_MS_ABI
+ endif
+
++if ARCH_IA32
++efi_cflags += \
++ -mno-sse \
++ -mno-mmx
++endif
++
+ efi_ldflags = \
+ $(EFI_LDFLAGS) \
+ -T $(EFI_LDS_DIR)/elf_$(ARCH)_efi.lds \
+--
+2.0.1
+
+
+From koen.kooi at linaro.org Sat Apr 11 01:23:23 2015
+From: koen.kooi at linaro.org (Koen Kooi)
+Date: Sat, 11 Apr 2015 10:23:23 +0200
+Subject: [systemd-devel] [gummiboot][PATCH 2/5] util: use x86 ASM only on
+ x86(-64) platforms.
+In-Reply-To: <1428740606-30060-1-git-send-email-koen.kooi@linaro.org>
+References: <1428740606-30060-1-git-send-email-koen.kooi@linaro.org>
+Message-ID: <1428740606-30060-2-git-send-email-koen.kooi@linaro.org>
+
+Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
+---
+ src/efi/util.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/efi/util.c b/src/efi/util.c
+index ba5ed7d..689bc7c 100644
+--- a/src/efi/util.c
++++ b/src/efi/util.c
+@@ -33,7 +33,9 @@ UINT64 ticks_read(VOID) {
+ __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
+ return (d << 32) | a;
+ }
+-#else
++#endif
++
++#ifdef __i386__
+ UINT64 ticks_read(VOID) {
+ UINT64 val;
+ __asm__ volatile ("rdtsc" : "=A" (val));
+--
+2.0.1
+
+
+From koen.kooi at linaro.org Sat Apr 11 01:23:24 2015
+From: koen.kooi at linaro.org (Koen Kooi)
+Date: Sat, 11 Apr 2015 10:23:24 +0200
+Subject: [systemd-devel] [gummiboot][PATCH 3/5] configure: add AARCH64
+ support
+In-Reply-To: <1428740606-30060-1-git-send-email-koen.kooi@linaro.org>
+References: <1428740606-30060-1-git-send-email-koen.kooi@linaro.org>
+Message-ID: <1428740606-30060-3-git-send-email-koen.kooi@linaro.org>
+
+This is just plumbing to add ARCH_AARCH64 for makefile tests and
+defining the machine name.
+
+Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
+---
+ configure.ac | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 27bbe1d..c2077b1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -51,6 +51,7 @@ dnl Define ARCH_<NAME> conditionals
+ SET_ARCH(IA32, i*86*)
+ SET_ARCH(X86_64, x86_64*)
+ SET_ARCH(IA64, ia64*)
++SET_ARCH(AARCH64, aarch64*)
+
+ ARCH=`echo $host | sed "s/\(-\).*$//"`
+
+@@ -61,6 +62,9 @@ AM_COND_IF(ARCH_IA32, [
+ AM_COND_IF(ARCH_X86_64, [
+ MACHINE_TYPE_NAME=x64])
+
++AM_COND_IF(ARCH_AARCH64, [
++ MACHINE_TYPE_NAME=aa64])
++
+ AC_SUBST([ARCH])
+ AC_SUBST([MACHINE_TYPE_NAME])
+
+--
+2.0.1
+
+
+From koen.kooi at linaro.org Sat Apr 11 01:23:25 2015
+From: koen.kooi at linaro.org (Koen Kooi)
+Date: Sat, 11 Apr 2015 10:23:25 +0200
+Subject: [systemd-devel] [gummiboot][PATCH 4/5] util: confine x86 asm to x86
+ architectures
+In-Reply-To: <1428740606-30060-1-git-send-email-koen.kooi@linaro.org>
+References: <1428740606-30060-1-git-send-email-koen.kooi@linaro.org>
+Message-ID: <1428740606-30060-4-git-send-email-koen.kooi@linaro.org>
+
+Also add a stub function that just returns '1' to avoid missing symbols.
+
+Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
+---
+ src/efi/util.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/efi/util.c b/src/efi/util.c
+index 689bc7c..6ce1f18 100644
+--- a/src/efi/util.c
++++ b/src/efi/util.c
+@@ -33,14 +33,17 @@ UINT64 ticks_read(VOID) {
+ __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
+ return (d << 32) | a;
+ }
+-#endif
+-
+-#ifdef __i386__
++#elif __i386__
+ UINT64 ticks_read(VOID) {
+ UINT64 val;
+ __asm__ volatile ("rdtsc" : "=A" (val));
+ return val;
+ }
++#else
++UINT64 ticks_read(VOID) {
++ UINT64 val = 1;
++ return val;
++}
+ #endif
+
+ /* count TSC ticks during a millisecond delay */
+--
+2.0.1
+
+
+From koen.kooi at linaro.org Sat Apr 11 01:23:26 2015
+From: koen.kooi at linaro.org (Koen Kooi)
+Date: Sat, 11 Apr 2015 10:23:26 +0200
+Subject: [systemd-devel] [gummiboot][PATCH 5/5] Makefile.am: Add support for
+ AARCH64
+In-Reply-To: <1428740606-30060-1-git-send-email-koen.kooi@linaro.org>
+References: <1428740606-30060-1-git-send-email-koen.kooi@linaro.org>
+Message-ID: <1428740606-30060-5-git-send-email-koen.kooi@linaro.org>
+
+Aarch64 and ARM32 lack an EFI capable objcopy, so use the ldflags + -O
+binary trick gnu-efi and the Red Hat shimloader are using.
+
+Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
+---
+ Makefile.am | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 2cca313..eba5ec4 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -121,6 +121,17 @@ efi_ldflags = \
+ -L $(EFI_LIB_DIR) \
+ $(EFI_LDS_DIR)/crt0-efi-$(ARCH).o
+
++# Aarch64 and ARM32 don't have an EFI capable objcopy
++if ARCH_AARCH64
++efi_ldflags += \
++ --defsym=EFI_SUBSYSTEM=0xa
++
++FORMAT = -O binary
++else
++FORMAT = --target=efi-app-$(ARCH)
++endif
++
++
+ # ------------------------------------------------------------------------------
+ gummiboot_headers = \
+ src/efi/util.h \
+@@ -156,7 +167,7 @@ $(gummiboot_solib): $(gummiboot_objects)
+ $(gummiboot): $(gummiboot_solib)
+ $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
+ -j .dynsym -j .rel -j .rela -j .reloc \
+- --target=efi-app-$(ARCH) $< $@
++ $(FORMAT) $< $@
+
+ # ------------------------------------------------------------------------------
+ stub_headers = \
+@@ -191,7 +202,7 @@ $(stub_solib): $(stub_objects)
+ $(stub): $(stub_solib)
+ $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
+ -j .dynsym -j .rel -j .rela -j .reloc \
+- --target=efi-app-$(ARCH) $< $@
++ $(FORMAT) $< $@
+
+ # ------------------------------------------------------------------------------
+ CLEANFILES += test-disk.img
+--
+2.0.1
+