Include patches from upstream that are after 3.0.3 This should fix the arm

and aarch64 builds.

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2016-02-23 10:33:31 -05:00
parent 5b30b98578
commit 1b3f3620ea
11 changed files with 1894 additions and 32 deletions

View File

@ -0,0 +1,34 @@
From a912cb49eb0b6fa63cfb045e549a51746c704d23 Mon Sep 17 00:00:00 2001
From: Nigel Croxon <nigel.croxon@hpe.com>
Date: Wed, 19 Aug 2015 07:28:45 -0400
Subject: [PATCH 01/10] Add the missing URI device path to the unions.
Signed-off-by: Gary Ching-Pang Lin <chinpang@gmail.com>
SIgned-off-by: Nigel Croxon <nigel.croxon@hpe.com>
---
inc/efidevp.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/inc/efidevp.h b/inc/efidevp.h
index 38923d9..b20c839 100644
--- a/inc/efidevp.h
+++ b/inc/efidevp.h
@@ -491,6 +491,7 @@ typedef union {
MAC_ADDR_DEVICE_PATH MacAddr;
IPv4_DEVICE_PATH Ipv4;
IPv6_DEVICE_PATH Ipv6;
+ URI_DEVICE_PATH Uri;
INFINIBAND_DEVICE_PATH InfiniBand;
UART_DEVICE_PATH Uart;
@@ -525,6 +526,7 @@ typedef union {
MAC_ADDR_DEVICE_PATH *MacAddr;
IPv4_DEVICE_PATH *Ipv4;
IPv6_DEVICE_PATH *Ipv6;
+ URI_DEVICE_PATH *Uri;
INFINIBAND_DEVICE_PATH *InfiniBand;
UART_DEVICE_PATH *Uart;
--
2.5.0

View File

@ -0,0 +1,60 @@
From c875f9935c177161eecf4e7efddfe4cd52c038b7 Mon Sep 17 00:00:00 2001
From: Nigel Croxon <nigel.croxon@hpe.com>
Date: Thu, 17 Sep 2015 08:22:39 -0400
Subject: [PATCH 02/10] From: Pete Batard <pete@akeo.ie> Date: Wed, 16 Sep 2015
18:26:28 +0100 Subject: [PATCH] Fix VS2015 warnings
* Currently, Visual Studio 2015 generates a lot of warnings such as:
gnu-efi\inc\efipciio.h(7): warning C4091: 'typedef ': ignored on left of '_EFI_PCI_IO' when no variable is declared
* To address this, gnu-efi should define the INTERFACE_DECL() for MS compilers as it does for GNU
Signed-off-by: Pete Batard <pete@akeo.ie>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
---
inc/ia32/efibind.h | 2 +-
inc/ia64/efibind.h | 2 +-
inc/x86_64/efibind.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/inc/ia32/efibind.h b/inc/ia32/efibind.h
index b8db581..1b11f10 100644
--- a/inc/ia32/efibind.h
+++ b/inc/ia32/efibind.h
@@ -272,7 +272,7 @@ typedef uint32_t UINTN;
#ifdef NO_INTERFACE_DECL
#define INTERFACE_DECL(x)
#else
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(_MSC_EXTENSIONS)
#define INTERFACE_DECL(x) struct x
#else
#define INTERFACE_DECL(x) typedef struct x
diff --git a/inc/ia64/efibind.h b/inc/ia64/efibind.h
index 6f9a6f7..b415461 100644
--- a/inc/ia64/efibind.h
+++ b/inc/ia64/efibind.h
@@ -219,7 +219,7 @@ void __mf (void);
#ifdef NO_INTERFACE_DECL
#define INTERFACE_DECL(x)
#else
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(_MSC_EXTENSIONS)
#define INTERFACE_DECL(x) struct x
#else
#define INTERFACE_DECL(x) typedef struct x
diff --git a/inc/x86_64/efibind.h b/inc/x86_64/efibind.h
index 6bbd337..5ee620b 100644
--- a/inc/x86_64/efibind.h
+++ b/inc/x86_64/efibind.h
@@ -284,7 +284,7 @@ typedef uint64_t UINTN;
#ifdef NO_INTERFACE_DECL
#define INTERFACE_DECL(x)
#else
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(_MSC_EXTENSIONS)
#define INTERFACE_DECL(x) struct x
#else
#define INTERFACE_DECL(x) typedef struct x
--
2.5.0

View File

@ -0,0 +1,146 @@
From 1e745dbd820ca0f35a078a381480b308a750c624 Mon Sep 17 00:00:00 2001
From: Nigel Croxon <nigel.croxon@hpe.com>
Date: Wed, 23 Sep 2015 10:03:31 -0400
Subject: [PATCH 03/10] From: Pete Batard <pete@akeo.ie> Subject: [PATCH] Fix
MSVC breakage due to GNU align extensions in setjmp
* __attribute__((__aligned__(x))), which is used in setjmp, is GNU only => use a macro instead
Signed-off-by: Pete Batard <pete@akeo.ie>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
---
inc/aarch64/efisetjmp_arch.h | 4 +++-
inc/arm/efisetjmp_arch.h | 4 +++-
inc/efisetjmp.h | 6 ++++++
inc/ia32/efisetjmp_arch.h | 6 +++---
inc/ia64/efisetjmp_arch.h | 4 +++-
inc/x86_64/efisetjmp_arch.h | 4 +++-
6 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/inc/aarch64/efisetjmp_arch.h b/inc/aarch64/efisetjmp_arch.h
index bce9b73..abd7a0e 100644
--- a/inc/aarch64/efisetjmp_arch.h
+++ b/inc/aarch64/efisetjmp_arch.h
@@ -1,6 +1,8 @@
#ifndef GNU_EFI_AARCH64_SETJMP_H
#define GNU_EFI_AARCH64_SETJMP_H
+#define JMPBUF_ALIGN 8
+
typedef struct {
/* GP regs */
UINT64 X19;
@@ -26,6 +28,6 @@ typedef struct {
UINT64 D13;
UINT64 D14;
UINT64 D15;
-} __attribute__((__aligned__(8))) jmp_buf;
+} ALIGN(JMPBUF_ALIGN) jmp_buf;
#endif /* GNU_EFI_AARCH64_SETJMP_H */
diff --git a/inc/arm/efisetjmp_arch.h b/inc/arm/efisetjmp_arch.h
index 0faf2e2..3a09ea5 100644
--- a/inc/arm/efisetjmp_arch.h
+++ b/inc/arm/efisetjmp_arch.h
@@ -1,6 +1,8 @@
#ifndef GNU_EFI_ARM_SETJMP_H
#define GNU_EFI_ARM_SETJMP_H
+#define JMPBUF_ALIGN 4
+
typedef struct {
UINT32 R3; // A copy of R13
UINT32 R4;
@@ -14,6 +16,6 @@ typedef struct {
UINT32 R12;
UINT32 R13;
UINT32 R14;
-} __attribute__((__aligned__(4))) jmp_buf;
+} ALIGN(JMPBUF_ALIGN) jmp_buf;
#endif /* GNU_EFI_ARM_SETJMP_H */
diff --git a/inc/efisetjmp.h b/inc/efisetjmp.h
index da8d050..9cb6cec 100644
--- a/inc/efisetjmp.h
+++ b/inc/efisetjmp.h
@@ -1,6 +1,12 @@
#ifndef GNU_EFI_SETJMP_H
#define GNU_EFI_SETJMP_H
+#ifdef _MSC_EXTENSIONS
+#define ALIGN(x) __declspec(align(x))
+#else
+#define ALIGN(x) __attribute__((__aligned__(x)))
+#endif
+
#include "efisetjmp_arch.h"
extern UINTN setjmp(jmp_buf *env);
diff --git a/inc/ia32/efisetjmp_arch.h b/inc/ia32/efisetjmp_arch.h
index ca2e075..17184e7 100644
--- a/inc/ia32/efisetjmp_arch.h
+++ b/inc/ia32/efisetjmp_arch.h
@@ -1,6 +1,8 @@
#ifndef GNU_EFI_IA32_SETJMP_H
#define GNU_EFI_IA32_SETJMP_H
+#define JMPBUF_ALIGN 4
+
typedef struct {
UINT32 Ebx;
UINT32 Esi;
@@ -8,8 +10,6 @@ typedef struct {
UINT32 Ebp;
UINT32 Esp;
UINT32 Eip;
-} __attribute__((__aligned__(4))) jmp_buf;
-
-#define JMPBUF_ALIGN 4
+} ALIGN(JMPBUF_ALIGN) jmp_buf;
#endif /* GNU_EFI_IA32_SETJMP_H */
diff --git a/inc/ia64/efisetjmp_arch.h b/inc/ia64/efisetjmp_arch.h
index dadbe64..3afa044 100644
--- a/inc/ia64/efisetjmp_arch.h
+++ b/inc/ia64/efisetjmp_arch.h
@@ -1,6 +1,8 @@
#ifndef GNU_EFI_IA64_SETJMP_H
#define GNU_EFI_IA64_SETJMP_H
+#define JMPBUF_ALIGN 0x10
+
typedef struct {
UINT64 F2[2];
UINT64 F3[2];
@@ -40,6 +42,6 @@ typedef struct {
UINT64 Predicates;
UINT64 LoopCount;
UINT64 FPSR;
-} __attribute__((__aligned__(0x10))) jmp_buf;
+} ALIGN(JMPBUF_ALIGN) jmp_buf;
#endif /* GNU_EFI_IA64_SETJMP_H */
diff --git a/inc/x86_64/efisetjmp_arch.h b/inc/x86_64/efisetjmp_arch.h
index ce4e393..a489993 100644
--- a/inc/x86_64/efisetjmp_arch.h
+++ b/inc/x86_64/efisetjmp_arch.h
@@ -1,6 +1,8 @@
#ifndef GNU_EFI_X86_64_SETJMP_H
#define GNU_EFI_X86_64_SETJMP_H
+#define JMPBUF_ALIGN 8
+
typedef struct {
UINT64 Rbx;
UINT64 Rsp;
@@ -15,6 +17,6 @@ typedef struct {
UINT64 Rip;
UINT64 MxCsr;
UINT8 XmmBuffer[160]; // XMM6 - XMM15
-} __attribute__((__aligned__(8))) jmp_buf;
+} ALIGN(JMPBUF_ALIGN) jmp_buf;
#endif /* GNU_EFI_X86_64_SETJMP_H */
--
2.5.0

View File

@ -0,0 +1,60 @@
From b5f22f43118c2c18ae0cc6f2532e5485cdc3d131 Mon Sep 17 00:00:00 2001
From: Nigel Croxon <nigel.croxon@hpe.com>
Date: Mon, 30 Nov 2015 08:52:25 -0500
Subject: [PATCH 04/10] From: Julian Andres Klode <jak@debian.org> Subject:
[PATCH gnu-efi] lib/arm/setjmp.S: Use %function instead of @function
@ is a comment character on ARM, so use % instead.
Nigel adjusted the wordwrap on the copyright header.
Signed-off-by: Julian Andres Klode <jak@degian.org>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
---
lib/arm/setjmp.S | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/lib/arm/setjmp.S b/lib/arm/setjmp.S
index 6e3fbf0..bd61a8d 100644
--- a/lib/arm/setjmp.S
+++ b/lib/arm/setjmp.S
@@ -1,21 +1,18 @@
/*
* Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- * This program and the accompanying materials are licensed and made
-available
- * under the terms and conditions of the BSD License which accompanies
-this
- * distribution. The full text of the license may be found at
- * http://opensource.org/licenses/bsd-license.php.
+ * This program and the accompanying materials are licensed and made
+ * available under the terms and conditions of the BSD License which
+ * accompanies this distribution. The full text of the license may
+ * be found at http://opensource.org/licenses/bsd-license.php.
*
* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
-BASIS,
- * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
- * IMPLIED.
+ * BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED.
*/
.text
.arm
.globl setjmp
- .type setjmp, @function
+ .type setjmp, %function
setjmp:
mov r3, r13
stmia r0, {r3-r12,r14}
@@ -23,6 +20,6 @@ setjmp:
bx lr
.globl longjmp
- .type longjmp, @function
+ .type longjmp, %function
longjmp:
ldmia r0, {r3-r12,r14}
--
2.5.0

View File

@ -0,0 +1,165 @@
From 8ffbd27504e1c886c92b01b21a215dbb7bd60197 Mon Sep 17 00:00:00 2001
From: Nigel Croxon <nigel.croxon@hpe.com>
Date: Wed, 23 Dec 2015 08:19:46 -0500
Subject: [PATCH 05/10] From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH 1/2] Relicense ARM and AARCH64 source files as both BSD and
GPL
This updates the licenses of the files authored by me under lib/arm
and lib/aarch64 to be both 2-clause BSD and GPL v2+
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
---
gnuefi/crt0-efi-arm.S | 15 +++++++++++----
lib/aarch64/initplat.c | 17 +++++++++++------
lib/aarch64/math.c | 17 +++++++++++------
lib/arm/initplat.c | 17 +++++++++++------
lib/arm/math.c | 17 +++++++++++------
5 files changed, 55 insertions(+), 28 deletions(-)
diff --git a/gnuefi/crt0-efi-arm.S b/gnuefi/crt0-efi-arm.S
index 3efaf78..c5bb6d4 100644
--- a/gnuefi/crt0-efi-arm.S
+++ b/gnuefi/crt0-efi-arm.S
@@ -3,10 +3,17 @@
*
* Copright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice and this list of conditions, without modification.
+ * 2. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License as published by the Free Software Foundation;
+ * either version 2 of the License, or (at your option) any later version.
*/
.section .text.head
diff --git a/lib/aarch64/initplat.c b/lib/aarch64/initplat.c
index 1c34cef..b4d29a9 100644
--- a/lib/aarch64/initplat.c
+++ b/lib/aarch64/initplat.c
@@ -1,13 +1,18 @@
/*
- * aarch64/initplat.c
- *
* Copright (C) 2014 Linaro Ltd.
* Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice and this list of conditions, without modification.
+ * 2. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License as published by the Free Software Foundation;
+ * either version 2 of the License, or (at your option) any later version.
*/
#include "lib.h"
diff --git a/lib/aarch64/math.c b/lib/aarch64/math.c
index d836965..8c16444 100644
--- a/lib/aarch64/math.c
+++ b/lib/aarch64/math.c
@@ -1,13 +1,18 @@
/*
- * crt0-efi-aarch64.S - PE/COFF header for Aarch64 EFI applications
- *
* Copright (C) 2014 Linaro Ltd.
* Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice and this list of conditions, without modification.
+ * 2. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License as published by the Free Software Foundation;
+ * either version 2 of the License, or (at your option) any later version.
*/
#include "lib.h"
diff --git a/lib/arm/initplat.c b/lib/arm/initplat.c
index 934289c..a90a457 100644
--- a/lib/arm/initplat.c
+++ b/lib/arm/initplat.c
@@ -1,13 +1,18 @@
/*
- * aarch64/initplat.c
- *
* Copright (C) 2014 Linaro Ltd.
* Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice and this list of conditions, without modification.
+ * 2. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License as published by the Free Software Foundation;
+ * either version 2 of the License, or (at your option) any later version.
*/
#include "lib.h"
diff --git a/lib/arm/math.c b/lib/arm/math.c
index 2502a8e..adf79f9 100644
--- a/lib/arm/math.c
+++ b/lib/arm/math.c
@@ -1,13 +1,18 @@
/*
- * arm/math.c - math routines for ARM
- *
* Copright (C) 2014 Linaro Ltd.
* Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice and this list of conditions, without modification.
+ * 2. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License as published by the Free Software Foundation;
+ * either version 2 of the License, or (at your option) any later version.
*/
#include "lib.h"
--
2.5.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,48 @@
From 16409cad4cb4ccd7c914da4317740550cc00200c Mon Sep 17 00:00:00 2001
From: Nigel Croxon <nigel.croxon@hpe.com>
Date: Wed, 23 Dec 2015 08:38:24 -0500
Subject: [PATCH 07/10] From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH] Add ARM .note.gnu.build-id input section to a dedicated
output section
This fixes the builds for ARM and AARCH64, which currently fail at link
time with an error like this:
arm-linux-gnueabi-ld: section .note.gnu.build-id loaded at
[0000000000000000,0000000000000023] overlaps section .text loaded at
[0000000000000000,00000000000064cf]
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
---
gnuefi/elf_aarch64_efi.lds | 1 +
gnuefi/elf_arm_efi.lds | 1 +
2 files changed, 2 insertions(+)
diff --git a/gnuefi/elf_aarch64_efi.lds b/gnuefi/elf_aarch64_efi.lds
index 6494e59..8864757 100644
--- a/gnuefi/elf_aarch64_efi.lds
+++ b/gnuefi/elf_aarch64_efi.lds
@@ -50,6 +50,7 @@ SECTIONS
. = ALIGN(4096);
.dynstr : { *(.dynstr) }
. = ALIGN(4096);
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
/DISCARD/ :
{
*(.rel.reloc)
diff --git a/gnuefi/elf_arm_efi.lds b/gnuefi/elf_arm_efi.lds
index 63d31be..a2f1b01 100644
--- a/gnuefi/elf_arm_efi.lds
+++ b/gnuefi/elf_arm_efi.lds
@@ -50,6 +50,7 @@ SECTIONS
. = ALIGN(4096);
.dynstr : { *(.dynstr) }
. = ALIGN(4096);
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
/DISCARD/ :
{
*(.rel.reloc)
--
2.5.0

View File

@ -0,0 +1,105 @@
From af1a3ea3c2ca8023fd51e0b7190da43e3aaa1a95 Mon Sep 17 00:00:00 2001
From: Nigel Croxon <nigel.croxon@hpe.com>
Date: Thu, 7 Jan 2016 09:35:42 -0500
Subject: [PATCH 08/10] From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH v2] ARM/AARCH64: define C99 types explicitly when building
against older standard
This adds support for the C99 uintXX_t types when building for
older versions of the standard, like the other architectures
already implement.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
---
inc/aarch64/efibind.h | 33 ++++++++++++++++++++++++++++++++-
inc/arm/efibind.h | 31 +++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+), 1 deletion(-)
diff --git a/inc/aarch64/efibind.h b/inc/aarch64/efibind.h
index 693fe52..ef7148d 100644
--- a/inc/aarch64/efibind.h
+++ b/inc/aarch64/efibind.h
@@ -1,5 +1,36 @@
-
+/*
+ * Copright (C) 2014 - 2015 Linaro Ltd.
+ * Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice and this list of conditions, without modification.
+ * 2. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License as published by the Free Software Foundation;
+ * either version 2 of the License, or (at your option) any later version.
+ */
+
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L )
+
+// ANSI C 1999/2000 stdint.h integer width declarations
+
+typedef unsigned long uint64_t;
+typedef long int64_t;
+typedef unsigned int uint32_t;
+typedef int int32_t;
+typedef unsigned short uint16_t;
+typedef short int16_t;
+typedef unsigned char uint8_t;
+typedef signed char int8_t; // unqualified 'char' is unsigned on ARM
+
+#else
#include <stdint.h>
+#endif
//
// Basic EFI types of various widths
diff --git a/inc/arm/efibind.h b/inc/arm/efibind.h
index cc4b5c5..8c37f64 100644
--- a/inc/arm/efibind.h
+++ b/inc/arm/efibind.h
@@ -1,5 +1,36 @@
+/*
+ * Copright (C) 2014 - 2015 Linaro Ltd.
+ * Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice and this list of conditions, without modification.
+ * 2. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License as published by the Free Software Foundation;
+ * either version 2 of the License, or (at your option) any later version.
+ */
+
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L )
+// ANSI C 1999/2000 stdint.h integer width declarations
+
+typedef unsigned long long uint64_t;
+typedef long long int64_t;
+typedef unsigned int uint32_t;
+typedef int int32_t;
+typedef unsigned short uint16_t;
+typedef short int16_t;
+typedef unsigned char uint8_t;
+typedef signed char int8_t; // unqualified 'char' is unsigned on ARM
+
+#else
#include <stdint.h>
+#endif
/*
* This prevents GCC from emitting GOT based relocations, and use R_ARM_REL32
--
2.5.0

View File

@ -0,0 +1,40 @@
From b3a63019277282415e0c06942b0aa42c4e876582 Mon Sep 17 00:00:00 2001
From: Nigel Croxon <nigel.croxon@hpe.com>
Date: Wed, 17 Feb 2016 15:32:23 -0500
Subject: [PATCH 09/10] arm: fix linker script for building efi binaries
On arm, the linker script is missing section collection for data and
bss. This causes some symbols (notably static array symbols) not to
get relocated correctly and the resulting efi binary to crash. Fix
this by correctly collecting all the data and bss sections.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
---
gnuefi/elf_arm_efi.lds | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gnuefi/elf_arm_efi.lds b/gnuefi/elf_arm_efi.lds
index a2f1b01..2ca8fc6 100644
--- a/gnuefi/elf_arm_efi.lds
+++ b/gnuefi/elf_arm_efi.lds
@@ -22,7 +22,7 @@ SECTIONS
*(.sdata)
*(.data)
*(.data1)
- *(.data)
+ *(.data.*)
*(.got.plt)
*(.got)
@@ -34,6 +34,7 @@ SECTIONS
*(.scommon)
*(.dynbss)
*(.bss)
+ *(.bss.*)
*(COMMON)
. = ALIGN(16);
_bss_end = .;
--
2.5.0

View File

@ -1,7 +1,7 @@
From 5652abf9c4ede88d7b5cad25415db4ea530631a3 Mon Sep 17 00:00:00 2001
From 0587ab32cf5037fd759dfcec0e858a57372cb64f Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 15 Jul 2015 10:15:51 -0400
Subject: [PATCH] Explicitly place our build-id notes.
Subject: [PATCH 10/10] Explicitly place our build-id notes on all arches.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -26,43 +26,19 @@ ld -nostdlib --warn-common --no-undefined --fatal-warnings -shared \
ld: section .note.gnu.build-id loaded at [00000000,00000023] overlaps section .text loaded at [00000000,0000668f]
This shouldn't be a problem if we explicitly tell it where to put them.
I hope.
Ard added a patch to do this on Arm and aarch64 targets in 16409cad4cb,
but it needs to be everywhere.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
gnuefi/elf_aarch64_efi.lds | 1 +
gnuefi/elf_arm_efi.lds | 1 +
gnuefi/elf_ia32_efi.lds | 2 ++
gnuefi/elf_ia32_fbsd_efi.lds | 2 ++
gnuefi/elf_ia64_efi.lds | 2 ++
gnuefi/elf_x86_64_efi.lds | 2 ++
gnuefi/elf_x86_64_fbsd_efi.lds | 2 ++
7 files changed, 12 insertions(+)
5 files changed, 10 insertions(+)
diff --git a/gnuefi/elf_aarch64_efi.lds b/gnuefi/elf_aarch64_efi.lds
index 8864757..85f1582 100644
--- a/gnuefi/elf_aarch64_efi.lds
+++ b/gnuefi/elf_aarch64_efi.lds
@@ -38,6 +38,7 @@ SECTIONS
. = ALIGN(16);
_bss_end = .;
}
+
.rela.dyn : { *(.rela.dyn) }
.rela.plt : { *(.rela.plt) }
.rela.got : { *(.rela.got) }
diff --git a/gnuefi/elf_arm_efi.lds b/gnuefi/elf_arm_efi.lds
index 2ca8fc6..665bbdb 100644
--- a/gnuefi/elf_arm_efi.lds
+++ b/gnuefi/elf_arm_efi.lds
@@ -39,6 +39,7 @@ SECTIONS
. = ALIGN(16);
_bss_end = .;
}
+
.rel.dyn : { *(.rel.dyn) }
.rel.plt : { *(.rel.plt) }
.rel.got : { *(.rel.got) }
diff --git a/gnuefi/elf_ia32_efi.lds b/gnuefi/elf_ia32_efi.lds
index b164094..6cc4ce1 100644
--- a/gnuefi/elf_ia32_efi.lds

View File

@ -1,7 +1,7 @@
Summary: Development Libraries and headers for EFI
Name: gnu-efi
Version: 3.0.3
Release: 2%{?dist}
Release: 3%{?dist}
Epoch: 1
Group: Development/System
License: BSD
@ -10,7 +10,16 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
ExclusiveArch: %{ix86} x86_64 ia64 aarch64
BuildRequires: git
Source: http://superb-dca2.dl.sourceforge.net/project/gnu-efi/gnu-efi-%{version}.tar.bz2
Patch0001: 0001-Explicitly-place-our-build-id-notes.patch
Patch0001: 0001-Add-the-missing-URI-device-path-to-the-unions.patch
Patch0002: 0002-From-Pete-Batard-pete-akeo.ie.patch
Patch0003: 0003-From-Pete-Batard-pete-akeo.ie.patch
Patch0004: 0004-From-Julian-Andres-Klode-jak-debian.org.patch
Patch0005: 0005-From-Ard-Biesheuvel-ard.biesheuvel-linaro.org.patch
Patch0006: 0006-From-Ard-Biesheuvel-ard.biesheuvel-linaro.org.patch
Patch0007: 0007-From-Ard-Biesheuvel-ard.biesheuvel-linaro.org.patch
Patch0008: 0008-From-Ard-Biesheuvel-ard.biesheuvel-linaro.org.patch
Patch0009: 0009-arm-fix-linker-script-for-building-efi-binaries.patch
Patch0010: 0010-Explicitly-place-our-build-id-notes-on-all-arches.patch
%define debug_package %{nil}
@ -97,6 +106,10 @@ rm -rf %{buildroot}
%attr(0644,root,root) /boot/efi/EFI/%{efidir}/*.efi
%changelog
* Tue Feb 23 2016 Peter Jones <pjones@redhat.com> - 3.0.3-3
- Include patches from upstream that are after 3.0.3 This should fix the arm
and aarch64 builds.
* Tue Feb 23 2016 Peter Jones <pjones@redhat.com> - 3.0.3-2
- We still need build-id patches in some places.