summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fabo@debian.org>2012-09-13 09:25:26 +0300
committerFathi Boudra <fabo@debian.org>2012-09-13 09:25:26 +0300
commit2afe86f7c61995cc4065af1dacba093f0974adfd (patch)
treeb1d371a21ad9f86723ec93a6cb72c7ebde79f43e
downloaduefi-origen-ci-2afe86f7c61995cc4065af1dacba093f0974adfd.tar.gz
Origen UEFI (restore previous repo)
-rw-r--r--Fixed_GCC_4.6_build.patch31
-rw-r--r--Fixed_debug_build_with_-Werror_unused-but-set-variable.patch18
-rw-r--r--Removed_-combine.patch27
-rwxr-xr-xuefi.sh44
4 files changed, 120 insertions, 0 deletions
diff --git a/Fixed_GCC_4.6_build.patch b/Fixed_GCC_4.6_build.patch
new file mode 100644
index 0000000..e9e47c2
--- /dev/null
+++ b/Fixed_GCC_4.6_build.patch
@@ -0,0 +1,31 @@
+From 336f97bb69b615f681a7dd8d3de74b92914c16ea Mon Sep 17 00:00:00 2001
+From: Ryan Harkin <ryan.harkin@linaro.org>
+Date: Fri, 27 Jul 2012 15:40:30 +0100
+Subject: [PATCH] BaseTools: Fixed GCC 4.6 build (changed in tools_def.template)
+
+---
+ BaseTools/Conf/tools_def.template | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/BaseTools/Conf/tools_def.template
++++ b/BaseTools/Conf/tools_def.template
+@@ -2541,7 +2541,7 @@ DEFINE GCC_ALL_CC_FLAGS = -g
+ DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
+ DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
+ DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
+-DEFINE GCC_ARMGCC_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer
++DEFINE GCC_ARMGCC_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address
+ DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie
+ DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
+ DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT)
+@@ -4871,8 +4871,8 @@ RELEASE_ARMLINUXGCC_ARM_ASM_FLAGS = $(
+ *_ARMLINUXGCC_ARM_SLINK_FLAGS = -rc
+ *_ARMLINUXGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
+
+- DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-address -O0
+-RELEASE_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable
++ DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -fno-stack-protector -O0
++RELEASE_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -fno-stack-protector -Wno-unused-but-set-variable
+
+ #################
+ # ASM 16 linker defintions
diff --git a/Fixed_debug_build_with_-Werror_unused-but-set-variable.patch b/Fixed_debug_build_with_-Werror_unused-but-set-variable.patch
new file mode 100644
index 0000000..08e9cdb
--- /dev/null
+++ b/Fixed_debug_build_with_-Werror_unused-but-set-variable.patch
@@ -0,0 +1,18 @@
+From: Fathi Boudra <fathi.boudra@linaro.org>
+Subject: [PATCH] BaseTools: Fixed debug build with GCC 4.6 and -Werror=unused-but-set-variable
+
+---
+ BaseTools/Conf/tools_def.template | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/BaseTools/Conf/tools_def.template
++++ b/BaseTools/Conf/tools_def.template
+@@ -4871,7 +4871,7 @@ RELEASE_ARMLINUXGCC_ARM_ASM_FLAGS = $(
+ *_ARMLINUXGCC_ARM_SLINK_FLAGS = -rc
+ *_ARMLINUXGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
+
+- DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -fno-stack-protector -O0
++ DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -fno-stack-protector -Wno-unused-but-set-variable -O0
+ RELEASE_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -fno-stack-protector -Wno-unused-but-set-variable
+
+ #################
diff --git a/Removed_-combine.patch b/Removed_-combine.patch
new file mode 100644
index 0000000..d5c8678
--- /dev/null
+++ b/Removed_-combine.patch
@@ -0,0 +1,27 @@
+From b99b2e59c2a54a7b0685508121789a243c68ef29 Mon Sep 17 00:00:00 2001
+From: Ryan Harkin <ryan.harkin@linaro.org>
+Date: Fri, 27 Jul 2012 15:37:01 +0100
+Subject: [PATCH] BaseTools: removed '-combine' from tools_def.template
+
+This option is not supported any more by the latest version of GCC (v4.6).
+
+Note from the GCC mailing-list: The -combine option has been removed, it
+has been very buggy and has been superceeded by -flto. Either drop it, or
+build with -flto.
+---
+ BaseTools/Conf/tools_def.template | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/BaseTools/Conf/tools_def.template
++++ b/BaseTools/Conf/tools_def.template
+@@ -4813,8 +4813,8 @@ RELEASE_ARMGCC_ARM_ASM_FLAGS = $(ARCHA
+ *_ARMGCC_ARM_SLINK_FLAGS = -rc
+ *_ARMGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
+
+- DEBUG_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -combine -O0
+-RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -combine -Wno-unused
++ DEBUG_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -O0
++RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-unused
+
+ ####################################################################################
+ #
diff --git a/uefi.sh b/uefi.sh
new file mode 100755
index 0000000..28a5a87
--- /dev/null
+++ b/uefi.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+# Script used by CI to build UEFI for Origen board
+# Requirements: uuid-dev package
+
+set -e
+
+unset ARCH
+export EDK_WORKSPACE=${WORKSPACE}/edk2/edk2
+export EDK_TOOLS_PATH=${EDK_WORKSPACE}/BaseTools
+
+# Get the sources
+git clone git://git.linaro.org/mirror/edk2/edk2.git
+git clone git://git.linaro.org/mirror/edk2/edk2-fatdriver2.git
+cp -a ${WORKSPACE}/edk2-fatdriver2/FatPkg ${EDK_WORKSPACE}/
+git clone git://git.linaro.org/landing-teams/working/samsung/edk2-origen.git
+cp -a ${WORKSPACE}/edk2-origen/SamsungPlatformPkg ${EDK_WORKSPACE}/
+
+# Apply patches
+cd ${EDK_WORKSPACE}
+patch -p1 < ${WORKSPACE}/origen-uefi-ci/Removed_-combine.patch
+patch -p1 < ${WORKSPACE}/origen-uefi-ci/Fixed_GCC_4.6_build.patch
+patch -p1 < ${WORKSPACE}/origen-uefi-ci/Fixed_debug_build_with_-Werror_unused-but-set-variable.patch
+cd ${WORKSPACE}
+
+# Create source tarball
+tar -C ${WORKSPACE}/edk2 -jcf edk2-origen-uefi-`date +%Y%m%d`-${BUILD_NUMBER}.tar.bz2 edk2
+
+# Fix WORKSPACE environment variable conflict with Jenkins
+find ${EDK_WORKSPACE} -type f | xargs sed -i 's/WORKSPACE/EDK_WORKSPACE/g'
+
+# Get the toolchain
+#wget --progress=dot -e dotbytes=1M http://releases.linaro.org/12.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux.tar.bz2
+#tar -jxf gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux.tar.bz2
+#export ARMLINUXGCC_TOOLS_PATH=${WORKSPACE}/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/
+
+source ${EDK_WORKSPACE}/edksetup.sh
+
+make -C ${EDK_WORKSPACE}/BaseTools
+
+export ARCH=arm
+build -a ARM -b DEBUG -t ARMLINUXGCC -p SamsungPlatformPkg/OrigenBoardPkg/OrigenBoardPkg-Exynos.dsc
+
+# Rename binaries
+cp -a ${EDK_WORKSPACE}/Build/OrigenBoard-Exynos/DEBUG_ARMLINUXGCC/FV/ORIGENBOARD_EFI.fd ${EDK_WORKSPACE}/uefi_origen.bin