public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] BaseTools: Add COREBOOT tools definition
@ 2017-06-30 22:39 Patrick Georgi
  2017-07-03  3:08 ` Gao, Liming
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Georgi @ 2017-06-30 22:39 UTC (permalink / raw)
  To: edk2-devel

That toolset is defined as the current coreboot toolchain[0] at commit
time. Right now this is gcc 6.3, iasl and GNU make, with minor patches
as deemed necessary for firmware development by the coreboot maintainers.

COREBOOT is primarily supposed to build CorebootPayloadPkg (and its
dependencies), but should be suitable for other builds as well.
It's tested to build a usable Ovmf image.

For now, COREBOOT is a copy of the GCC5 rules, but it may diverge over
time.

[0] As built by https://review.coreboot.org/cgit/coreboot.git/tree/util/
crossgcc

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Patrick Georgi <pgeorgi@google.com>

-- 
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft:
Hamburg
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] BaseTools: Add COREBOOT tools definition
  2017-06-30 22:39 Patrick Georgi
@ 2017-07-03  3:08 ` Gao, Liming
  2017-07-07  9:16   ` Patrick Georgi
  0 siblings, 1 reply; 7+ messages in thread
From: Gao, Liming @ 2017-07-03  3:08 UTC (permalink / raw)
  To: Patrick Georgi, edk2-devel@lists.01.org

Hi, 
  Do you include your patch? I don't see it in the mail. 

Thanks
Liming
>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Patrick Georgi
>Sent: Saturday, July 01, 2017 6:39 AM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [PATCH] BaseTools: Add COREBOOT tools definition
>
>That toolset is defined as the current coreboot toolchain[0] at commit
>time. Right now this is gcc 6.3, iasl and GNU make, with minor patches
>as deemed necessary for firmware development by the coreboot maintainers.
>
>COREBOOT is primarily supposed to build CorebootPayloadPkg (and its
>dependencies), but should be suitable for other builds as well.
>It's tested to build a usable Ovmf image.
>
>For now, COREBOOT is a copy of the GCC5 rules, but it may diverge over
>time.
>
>[0] As built by https://review.coreboot.org/cgit/coreboot.git/tree/util/
>crossgcc
>
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Patrick Georgi <pgeorgi@google.com>
>
>--
>Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
>Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft:
>Hamburg
>Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] BaseTools: Add COREBOOT tools definition
@ 2017-07-04 15:22 Patrick Georgi
  2017-07-10 14:46 ` Gao, Liming
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Georgi @ 2017-07-04 15:22 UTC (permalink / raw)
  To: edk2-devel

That toolset is defined as the current coreboot toolchain[0] at commit
time. Right now this is gcc 6.3, iasl and GNU make, with minor patches
as deemed necessary for firmware development by the coreboot maintainers.

COREBOOT is primarily supposed to build CorebootPayloadPkg (and its
dependencies), but should be suitable for other builds as well.
It's tested to build a usable Ovmf image.

For now, COREBOOT is a copy of the GCC5 rules, but it may diverge over
time.

[0] As built by https://review.coreboot.org/cgit/coreboot.git/tree/util/crossgcc

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
---
 BaseTools/Conf/tools_def.template | 181 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 181 insertions(+)

diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 65f21061e6..08adb32e38 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -199,6 +199,12 @@ DEFINE GCC49_X64_PREFIX        = ENV(GCC49_BIN)
 DEFINE GCC5_IA32_PREFIX        = ENV(GCC5_BIN)
 DEFINE GCC5_X64_PREFIX         = ENV(GCC5_BIN)
 
+DEFINE COREBOOT_PREFIX         = ENV(COREBOOT_SDK_PATH)
+DEFINE COREBOOT_IA32_PREFIX    = DEF(COREBOOT_PREFIX)i386-elf-
+DEFINE COREBOOT_X64_PREFIX     = DEF(COREBOOT_PREFIX)x86_64-elf-
+DEFINE COREBOOT_ARM_PREFIX     = DEF(COREBOOT_PREFIX)arm-eabi-
+DEFINE COREBOOT_AARCH64_PREFIX = DEF(COREBOOT_PREFIX)aarch64-elf-
+
 DEFINE UNIX_IASL_BIN           = ENV(IASL_PREFIX)iasl
 DEFINE WIN_IASL_BIN            = ENV(IASL_PREFIX)iasl.exe
 DEFINE WIN_ASL_BIN             = ENV(IASL_PREFIX)asl.exe
@@ -4493,6 +4499,28 @@ DEFINE GCC5_AARCH64_DLINK2_FLAGS     = DEF(GCC49_AARCH64_DLINK2_FLAGS) -Wno-erro
 DEFINE GCC5_ARM_ASLDLINK_FLAGS       = DEF(GCC49_ARM_ASLDLINK_FLAGS)
 DEFINE GCC5_AARCH64_ASLDLINK_FLAGS   = DEF(GCC49_AARCH64_ASLDLINK_FLAGS)
 
+DEFINE COREBOOT_IA32_CC_FLAGS            = DEF(GCC5_IA32_CC_FLAGS)
+DEFINE COREBOOT_X64_CC_FLAGS             = DEF(GCC5_X64_CC_FLAGS)
+DEFINE COREBOOT_IA32_X64_DLINK_COMMON    = DEF(GCC5_IA32_X64_DLINK_COMMON)
+DEFINE COREBOOT_IA32_X64_ASLDLINK_FLAGS  = DEF(GCC5_IA32_X64_ASLDLINK_FLAGS)
+DEFINE COREBOOT_IA32_X64_DLINK_FLAGS     = DEF(GCC5_IA32_X64_DLINK_FLAGS)
+DEFINE COREBOOT_IA32_DLINK2_FLAGS        = DEF(GCC5_IA32_DLINK2_FLAGS)
+DEFINE COREBOOT_X64_DLINK_FLAGS          = DEF(GCC5_X64_DLINK_FLAGS)
+DEFINE COREBOOT_X64_DLINK2_FLAGS         = DEF(GCC5_X64_DLINK2_FLAGS)
+DEFINE COREBOOT_ASM_FLAGS                = DEF(GCC5_ASM_FLAGS)
+DEFINE COREBOOT_ARM_ASM_FLAGS            = DEF(GCC5_ARM_ASM_FLAGS)
+DEFINE COREBOOT_AARCH64_ASM_FLAGS        = DEF(GCC5_AARCH64_ASM_FLAGS)
+DEFINE COREBOOT_ARM_CC_FLAGS             = DEF(GCC5_ARM_CC_FLAGS)
+DEFINE COREBOOT_ARM_CC_XIPFLAGS          = DEF(GCC5_ARM_CC_XIPFLAGS)
+DEFINE COREBOOT_AARCH64_CC_FLAGS         = DEF(GCC5_AARCH64_CC_FLAGS)
+DEFINE COREBOOT_AARCH64_CC_XIPFLAGS      = DEF(GCC5_AARCH64_CC_XIPFLAGS)
+DEFINE COREBOOT_ARM_DLINK_FLAGS          = DEF(GCC5_ARM_DLINK_FLAGS)
+DEFINE COREBOOT_ARM_DLINK2_FLAGS         = DEF(GCC5_ARM_DLINK2_FLAGS)
+DEFINE COREBOOT_AARCH64_DLINK_FLAGS      = DEF(GCC5_AARCH64_DLINK_FLAGS)
+DEFINE COREBOOT_AARCH64_DLINK2_FLAGS     = DEF(GCC5_AARCH64_DLINK2_FLAGS)
+DEFINE COREBOOT_ARM_ASLDLINK_FLAGS       = DEF(GCC5_ARM_ASLDLINK_FLAGS)
+DEFINE COREBOOT_AARCH64_ASLDLINK_FLAGS   = DEF(GCC5_AARCH64_ASLDLINK_FLAGS)
+
 ####################################################################################
 #
 # Unix GCC And Intel Linux ACPI Compiler
@@ -5413,6 +5441,159 @@ RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(W
   NOOPT_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 -O0
   NOOPT_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 -O0
 
+####################################################################################
+#
+# COREBOOT - This configuration is used to compile under Linux to produce
+#         PE/COFF binaries using coreboot's toolchain
+#
+####################################################################################
+*_COREBOOT_*_*_FAMILY                = GCC
+
+*_COREBOOT_*_MAKE_PATH               = DEF(COREBOOT_PREFIX)make
+*_COREBOOT_*_*_DLL                   = ENV(COREBOOT_DLL)
+*_COREBOOT_*_ASL_PATH                = DEF(COREBOOT_PREFIX)iasl
+
+*_COREBOOT_*_PP_FLAGS                = DEF(GCC_PP_FLAGS)
+*_COREBOOT_*_ASLPP_FLAGS             = DEF(GCC_ASLPP_FLAGS)
+*_COREBOOT_*_ASLCC_FLAGS             = DEF(GCC_ASLCC_FLAGS)
+*_COREBOOT_*_VFRPP_FLAGS             = DEF(GCC_VFRPP_FLAGS)
+*_COREBOOT_*_APP_FLAGS               =
+*_COREBOOT_*_ASL_FLAGS               = DEF(IASL_FLAGS)
+*_COREBOOT_*_ASL_OUTFLAGS            = DEF(IASL_OUTFLAGS)
+
+##################
+# COREBOOT IA32 definitions
+##################
+*_COREBOOT_IA32_OBJCOPY_PATH         = DEF(COREBOOT_IA32_PREFIX)objcopy
+*_COREBOOT_IA32_CC_PATH              = DEF(COREBOOT_IA32_PREFIX)gcc
+*_COREBOOT_IA32_SLINK_PATH           = DEF(COREBOOT_IA32_PREFIX)gcc-ar
+*_COREBOOT_IA32_DLINK_PATH           = DEF(COREBOOT_IA32_PREFIX)gcc
+*_COREBOOT_IA32_ASLDLINK_PATH        = DEF(COREBOOT_IA32_PREFIX)gcc
+*_COREBOOT_IA32_ASM_PATH             = DEF(COREBOOT_IA32_PREFIX)gcc
+*_COREBOOT_IA32_PP_PATH              = DEF(COREBOOT_IA32_PREFIX)gcc
+*_COREBOOT_IA32_VFRPP_PATH           = DEF(COREBOOT_IA32_PREFIX)gcc
+*_COREBOOT_IA32_ASLCC_PATH           = DEF(COREBOOT_IA32_PREFIX)gcc
+*_COREBOOT_IA32_ASLPP_PATH           = DEF(COREBOOT_IA32_PREFIX)gcc
+*_COREBOOT_IA32_RC_PATH              = DEF(COREBOOT_IA32_PREFIX)objcopy
+
+*_COREBOOT_IA32_ASLCC_FLAGS          = DEF(GCC_ASLCC_FLAGS) -m32 -fno-lto
+*_COREBOOT_IA32_ASLDLINK_FLAGS       = DEF(COREBOOT_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_i386
+*_COREBOOT_IA32_ASM_FLAGS            = DEF(COREBOOT_ASM_FLAGS) -m32 -march=i386
+*_COREBOOT_IA32_DLINK2_FLAGS         = DEF(COREBOOT_IA32_DLINK2_FLAGS)
+*_COREBOOT_IA32_RC_FLAGS             = DEF(GCC_IA32_RC_FLAGS)
+*_COREBOOT_IA32_OBJCOPY_FLAGS        =
+*_COREBOOT_IA32_NASM_FLAGS           = -f elf32
+
+  DEBUG_COREBOOT_IA32_CC_FLAGS       = DEF(COREBOOT_IA32_CC_FLAGS) -flto -Os
+  DEBUG_COREBOOT_IA32_DLINK_FLAGS    = DEF(COREBOOT_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386
+
+RELEASE_COREBOOT_IA32_CC_FLAGS       = DEF(COREBOOT_IA32_CC_FLAGS) -flto -Os -Wno-unused-but-set-variable
+RELEASE_COREBOOT_IA32_DLINK_FLAGS    = DEF(COREBOOT_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386
+
+  NOOPT_COREBOOT_IA32_CC_FLAGS       = DEF(COREBOOT_IA32_CC_FLAGS) -O0
+  NOOPT_COREBOOT_IA32_DLINK_FLAGS    = DEF(COREBOOT_IA32_X64_DLINK_FLAGS) -Wl,-m,elf_i386,--oformat=elf32-i386 -O0
+
+##################
+# COREBOOT X64 definitions
+##################
+*_COREBOOT_X64_OBJCOPY_PATH          = DEF(COREBOOT_X64_PREFIX)objcopy
+*_COREBOOT_X64_CC_PATH               = DEF(COREBOOT_X64_PREFIX)gcc
+*_COREBOOT_X64_SLINK_PATH            = DEF(COREBOOT_X64_PREFIX)gcc-ar
+*_COREBOOT_X64_DLINK_PATH            = DEF(COREBOOT_X64_PREFIX)gcc
+*_COREBOOT_X64_ASLDLINK_PATH         = DEF(COREBOOT_X64_PREFIX)gcc
+*_COREBOOT_X64_ASM_PATH              = DEF(COREBOOT_X64_PREFIX)gcc
+*_COREBOOT_X64_PP_PATH               = DEF(COREBOOT_X64_PREFIX)gcc
+*_COREBOOT_X64_VFRPP_PATH            = DEF(COREBOOT_X64_PREFIX)gcc
+*_COREBOOT_X64_ASLCC_PATH            = DEF(COREBOOT_X64_PREFIX)gcc
+*_COREBOOT_X64_ASLPP_PATH            = DEF(COREBOOT_X64_PREFIX)gcc
+*_COREBOOT_X64_RC_PATH               = DEF(COREBOOT_X64_PREFIX)objcopy
+
+*_COREBOOT_X64_ASLCC_FLAGS           = DEF(GCC_ASLCC_FLAGS) -m64 -fno-lto
+*_COREBOOT_X64_ASLDLINK_FLAGS        = DEF(COREBOOT_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_x86_64
+*_COREBOOT_X64_ASM_FLAGS             = DEF(COREBOOT_ASM_FLAGS) -m64
+*_COREBOOT_X64_DLINK2_FLAGS          = DEF(COREBOOT_X64_DLINK2_FLAGS)
+*_COREBOOT_X64_RC_FLAGS              = DEF(GCC_X64_RC_FLAGS)
+*_COREBOOT_X64_OBJCOPY_FLAGS         =
+*_COREBOOT_X64_NASM_FLAGS            = -f elf64
+
+  DEBUG_COREBOOT_X64_CC_FLAGS        = DEF(COREBOOT_X64_CC_FLAGS) -flto -DUSING_LTO -Os
+  DEBUG_COREBOOT_X64_DLINK_FLAGS     = DEF(COREBOOT_X64_DLINK_FLAGS) -flto -Os
+
+RELEASE_COREBOOT_X64_CC_FLAGS        = DEF(COREBOOT_X64_CC_FLAGS) -flto -DUSING_LTO -Os -Wno-unused-but-set-variable
+RELEASE_COREBOOT_X64_DLINK_FLAGS     = DEF(COREBOOT_X64_DLINK_FLAGS) -flto -Os
+
+  NOOPT_COREBOOT_X64_CC_FLAGS        = DEF(COREBOOT_X64_CC_FLAGS) -O0
+  NOOPT_COREBOOT_X64_DLINK_FLAGS     = DEF(COREBOOT_X64_DLINK_FLAGS) -O0
+
+##################
+# COREBOOT ARM definitions
+##################
+*_COREBOOT_ARM_CC_PATH               = ENV(COREBOOT_ARM_PREFIX)gcc
+*_COREBOOT_ARM_SLINK_PATH            = ENV(COREBOOT_ARM_PREFIX)gcc-ar
+*_COREBOOT_ARM_DLINK_PATH            = ENV(COREBOOT_ARM_PREFIX)gcc
+*_COREBOOT_ARM_ASLDLINK_PATH         = ENV(COREBOOT_ARM_PREFIX)gcc
+*_COREBOOT_ARM_ASM_PATH              = ENV(COREBOOT_ARM_PREFIX)gcc
+*_COREBOOT_ARM_PP_PATH               = ENV(COREBOOT_ARM_PREFIX)gcc
+*_COREBOOT_ARM_VFRPP_PATH            = ENV(COREBOOT_ARM_PREFIX)gcc
+*_COREBOOT_ARM_ASLCC_PATH            = ENV(COREBOOT_ARM_PREFIX)gcc
+*_COREBOOT_ARM_ASLPP_PATH            = ENV(COREBOOT_ARM_PREFIX)gcc
+*_COREBOOT_ARM_RC_PATH               = ENV(COREBOOT_ARM_PREFIX)objcopy
+
+*_COREBOOT_ARM_ARCHCC_FLAGS          = -mthumb
+*_COREBOOT_ARM_ASLCC_FLAGS           = DEF(GCC_ASLCC_FLAGS)
+*_COREBOOT_ARM_ASLDLINK_FLAGS        = DEF(COREBOOT_ARM_ASLDLINK_FLAGS)
+*_COREBOOT_ARM_ASM_FLAGS             = DEF(COREBOOT_ARM_ASM_FLAGS)
+*_COREBOOT_ARM_DLINK2_FLAGS          = DEF(COREBOOT_ARM_DLINK2_FLAGS)
+*_COREBOOT_ARM_PLATFORM_FLAGS        = -march=armv7-a
+*_COREBOOT_ARM_PP_FLAGS              = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
+*_COREBOOT_ARM_RC_FLAGS              = DEF(GCC_ARM_RC_FLAGS)
+*_COREBOOT_ARM_VFRPP_FLAGS           = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
+*_COREBOOT_ARM_CC_XIPFLAGS           = DEF(COREBOOT_ARM_CC_XIPFLAGS)
+
+  DEBUG_COREBOOT_ARM_CC_FLAGS        = DEF(COREBOOT_ARM_CC_FLAGS) -O0
+  DEBUG_COREBOOT_ARM_DLINK_FLAGS     = DEF(COREBOOT_ARM_DLINK_FLAGS)
+
+RELEASE_COREBOOT_ARM_CC_FLAGS        = DEF(COREBOOT_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable
+RELEASE_COREBOOT_ARM_DLINK_FLAGS     = DEF(COREBOOT_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
+
+  NOOPT_COREBOOT_ARM_CC_FLAGS        = DEF(COREBOOT_ARM_CC_FLAGS) -O0
+  NOOPT_COREBOOT_ARM_DLINK_FLAGS     = DEF(COREBOOT_ARM_DLINK_FLAGS) -O0
+
+##################
+# COREBOOT AARCH64 definitions
+##################
+*_COREBOOT_AARCH64_CC_PATH           = ENV(COREBOOT_AARCH64_PREFIX)gcc
+*_COREBOOT_AARCH64_SLINK_PATH        = ENV(COREBOOT_AARCH64_PREFIX)gcc-ar
+*_COREBOOT_AARCH64_DLINK_PATH        = ENV(COREBOOT_AARCH64_PREFIX)gcc
+*_COREBOOT_AARCH64_ASLDLINK_PATH     = ENV(COREBOOT_AARCH64_PREFIX)gcc
+*_COREBOOT_AARCH64_ASM_PATH          = ENV(COREBOOT_AARCH64_PREFIX)gcc
+*_COREBOOT_AARCH64_PP_PATH           = ENV(COREBOOT_AARCH64_PREFIX)gcc
+*_COREBOOT_AARCH64_VFRPP_PATH        = ENV(COREBOOT_AARCH64_PREFIX)gcc
+*_COREBOOT_AARCH64_ASLCC_PATH        = ENV(COREBOOT_AARCH64_PREFIX)gcc
+*_COREBOOT_AARCH64_ASLPP_PATH        = ENV(COREBOOT_AARCH64_PREFIX)gcc
+*_COREBOOT_AARCH64_RC_PATH           = ENV(COREBOOT_AARCH64_PREFIX)objcopy
+
+*_COREBOOT_AARCH64_ASLCC_FLAGS       = DEF(GCC_ASLCC_FLAGS)
+*_COREBOOT_AARCH64_ASLDLINK_FLAGS    = DEF(COREBOOT_AARCH64_ASLDLINK_FLAGS)
+*_COREBOOT_AARCH64_ASM_FLAGS         = DEF(COREBOOT_AARCH64_ASM_FLAGS)
+*_COREBOOT_AARCH64_DLINK2_FLAGS      = DEF(COREBOOT_AARCH64_DLINK2_FLAGS)
+*_COREBOOT_AARCH64_PLATFORM_FLAGS    =
+*_COREBOOT_AARCH64_PP_FLAGS          = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
+*_COREBOOT_AARCH64_RC_FLAGS          = DEF(GCC_AARCH64_RC_FLAGS)
+*_COREBOOT_AARCH64_VFRPP_FLAGS       = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
+*_COREBOOT_AARCH64_CC_XIPFLAGS       = DEF(COREBOOT_AARCH64_CC_XIPFLAGS)
+
+  DEBUG_COREBOOT_AARCH64_CC_FLAGS    = DEF(COREBOOT_AARCH64_CC_FLAGS) -O0 -mcmodel=small
+  DEBUG_COREBOOT_AARCH64_DLINK_FLAGS = DEF(COREBOOT_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000
+  DEBUG_COREBOOT_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
+
+RELEASE_COREBOOT_AARCH64_CC_FLAGS    = DEF(COREBOOT_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -mcmodel=tiny -fomit-frame-pointer
+RELEASE_COREBOOT_AARCH64_DLINK_FLAGS = DEF(COREBOOT_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
+
+  NOOPT_COREBOOT_AARCH64_CC_FLAGS    = DEF(COREBOOT_AARCH64_CC_FLAGS) -O0 -mcmodel=small
+  NOOPT_COREBOOT_AARCH64_DLINK_FLAGS = DEF(COREBOOT_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 -O0
+  NOOPT_COREBOOT_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 -O0
+
 ####################################################################################
 #
 # CLANG35   - This configuration is used to compile under Linux to produce
-- 
2.13.2.725.g09c95d1e9-goog



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] BaseTools: Add COREBOOT tools definition
  2017-07-03  3:08 ` Gao, Liming
@ 2017-07-07  9:16   ` Patrick Georgi
  0 siblings, 0 replies; 7+ messages in thread
From: Patrick Georgi @ 2017-07-07  9:16 UTC (permalink / raw)
  To: Gao, Liming; +Cc: edk2-devel@lists.01.org

2017-07-03 5:08 GMT+02:00 Gao, Liming <liming.gao@intel.com>:

> Hi,
>   Do you include your patch? I don't see it in the mail.
>

Oops, sorry. I added it as attachment, but somehow that was scrubbed.
Finally figured out how to setup git send-email, so I started a new thread
at https://lists.01.org/pipermail/edk2-devel/2017-July/012110.html


Thanks,
Patrick


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] BaseTools: Add COREBOOT tools definition
  2017-07-04 15:22 [PATCH] BaseTools: Add COREBOOT tools definition Patrick Georgi
@ 2017-07-10 14:46 ` Gao, Liming
  2017-07-10 15:05   ` Patrick Georgi
  0 siblings, 1 reply; 7+ messages in thread
From: Gao, Liming @ 2017-07-10 14:46 UTC (permalink / raw)
  To: Patrick Georgi, edk2-devel@lists.01.org

Patrick:
  Compared GCC5 and COREBOOT, the difference is that GCC5_IA32_PREFIX and GCC5_X64_PREFIX. CoreBoot tool chain has the different style. So, it can't reuse GCC5 tool chain. If GCC5 is update to refer to ENV (GCC5_IA32_PREFIX) and ENV (GCC5_X64_PREFIX) like ENV(GCC5_ARM_PREFIX) in CC_PATH, GCC5 can support COREBOOT usage. For the future, the different FLAG can be appended in [BuildOptions] of platform.dsc. So, I suggest to reuse GCC5 tool chain for coreboot. 

GCC5:
DEFINE GCC5_IA32_PREFIX        = ENV(GCC5_BIN)
DEFINE GCC5_X64_PREFIX         = ENV(GCC5_BIN)
*_GCC5_*_*_DLL                = ENV(GCC5_DLL)

COREBOOT:
DEFINE COREBOOT_IA32_PREFIX    = DEF(COREBOOT_PREFIX)i386-elf-
DEFINE COREBOOT_X64_PREFIX     = DEF(COREBOOT_PREFIX)x86_64-elf-
*_COREBOOT_*_*_DLL            = ENV(COREBOOT_DLL)

Thanks
Liming
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Patrick Georgi
> Sent: Tuesday, July 4, 2017 11:23 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH] BaseTools: Add COREBOOT tools definition
> 
> That toolset is defined as the current coreboot toolchain[0] at commit
> time. Right now this is gcc 6.3, iasl and GNU make, with minor patches
> as deemed necessary for firmware development by the coreboot maintainers.
> 
> COREBOOT is primarily supposed to build CorebootPayloadPkg (and its
> dependencies), but should be suitable for other builds as well.
> It's tested to build a usable Ovmf image.
> 
> For now, COREBOOT is a copy of the GCC5 rules, but it may diverge over
> time.
> 
> [0] As built by https://review.coreboot.org/cgit/coreboot.git/tree/util/crossgcc
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Patrick Georgi <pgeorgi@google.com>
> ---
>  BaseTools/Conf/tools_def.template | 181 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 181 insertions(+)
> 
> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
> index 65f21061e6..08adb32e38 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -199,6 +199,12 @@ DEFINE GCC49_X64_PREFIX        = ENV(GCC49_BIN)
>  DEFINE GCC5_IA32_PREFIX        = ENV(GCC5_BIN)
>  DEFINE GCC5_X64_PREFIX         = ENV(GCC5_BIN)
> 
> +DEFINE COREBOOT_PREFIX         = ENV(COREBOOT_SDK_PATH)
> +DEFINE COREBOOT_IA32_PREFIX    = DEF(COREBOOT_PREFIX)i386-elf-
> +DEFINE COREBOOT_X64_PREFIX     = DEF(COREBOOT_PREFIX)x86_64-elf-
> +DEFINE COREBOOT_ARM_PREFIX     = DEF(COREBOOT_PREFIX)arm-eabi-
> +DEFINE COREBOOT_AARCH64_PREFIX = DEF(COREBOOT_PREFIX)aarch64-elf-
> +
>  DEFINE UNIX_IASL_BIN           = ENV(IASL_PREFIX)iasl
>  DEFINE WIN_IASL_BIN            = ENV(IASL_PREFIX)iasl.exe
>  DEFINE WIN_ASL_BIN             = ENV(IASL_PREFIX)asl.exe
> @@ -4493,6 +4499,28 @@ DEFINE GCC5_AARCH64_DLINK2_FLAGS     = DEF(GCC49_AARCH64_DLINK2_FLAGS) -Wno-erro
>  DEFINE GCC5_ARM_ASLDLINK_FLAGS       = DEF(GCC49_ARM_ASLDLINK_FLAGS)
>  DEFINE GCC5_AARCH64_ASLDLINK_FLAGS   = DEF(GCC49_AARCH64_ASLDLINK_FLAGS)
> 
> +DEFINE COREBOOT_IA32_CC_FLAGS            = DEF(GCC5_IA32_CC_FLAGS)
> +DEFINE COREBOOT_X64_CC_FLAGS             = DEF(GCC5_X64_CC_FLAGS)
> +DEFINE COREBOOT_IA32_X64_DLINK_COMMON    = DEF(GCC5_IA32_X64_DLINK_COMMON)
> +DEFINE COREBOOT_IA32_X64_ASLDLINK_FLAGS  = DEF(GCC5_IA32_X64_ASLDLINK_FLAGS)
> +DEFINE COREBOOT_IA32_X64_DLINK_FLAGS     = DEF(GCC5_IA32_X64_DLINK_FLAGS)
> +DEFINE COREBOOT_IA32_DLINK2_FLAGS        = DEF(GCC5_IA32_DLINK2_FLAGS)
> +DEFINE COREBOOT_X64_DLINK_FLAGS          = DEF(GCC5_X64_DLINK_FLAGS)
> +DEFINE COREBOOT_X64_DLINK2_FLAGS         = DEF(GCC5_X64_DLINK2_FLAGS)
> +DEFINE COREBOOT_ASM_FLAGS                = DEF(GCC5_ASM_FLAGS)
> +DEFINE COREBOOT_ARM_ASM_FLAGS            = DEF(GCC5_ARM_ASM_FLAGS)
> +DEFINE COREBOOT_AARCH64_ASM_FLAGS        = DEF(GCC5_AARCH64_ASM_FLAGS)
> +DEFINE COREBOOT_ARM_CC_FLAGS             = DEF(GCC5_ARM_CC_FLAGS)
> +DEFINE COREBOOT_ARM_CC_XIPFLAGS          = DEF(GCC5_ARM_CC_XIPFLAGS)
> +DEFINE COREBOOT_AARCH64_CC_FLAGS         = DEF(GCC5_AARCH64_CC_FLAGS)
> +DEFINE COREBOOT_AARCH64_CC_XIPFLAGS      = DEF(GCC5_AARCH64_CC_XIPFLAGS)
> +DEFINE COREBOOT_ARM_DLINK_FLAGS          = DEF(GCC5_ARM_DLINK_FLAGS)
> +DEFINE COREBOOT_ARM_DLINK2_FLAGS         = DEF(GCC5_ARM_DLINK2_FLAGS)
> +DEFINE COREBOOT_AARCH64_DLINK_FLAGS      = DEF(GCC5_AARCH64_DLINK_FLAGS)
> +DEFINE COREBOOT_AARCH64_DLINK2_FLAGS     = DEF(GCC5_AARCH64_DLINK2_FLAGS)
> +DEFINE COREBOOT_ARM_ASLDLINK_FLAGS       = DEF(GCC5_ARM_ASLDLINK_FLAGS)
> +DEFINE COREBOOT_AARCH64_ASLDLINK_FLAGS   = DEF(GCC5_AARCH64_ASLDLINK_FLAGS)
> +
>  ####################################################################################
>  #
>  # Unix GCC And Intel Linux ACPI Compiler
> @@ -5413,6 +5441,159 @@ RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(W
>    NOOPT_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 -O0
>    NOOPT_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 -O0
> 
> +####################################################################################
> +#
> +# COREBOOT - This configuration is used to compile under Linux to produce
> +#         PE/COFF binaries using coreboot's toolchain
> +#
> +####################################################################################
> +*_COREBOOT_*_*_FAMILY                = GCC
> +
> +*_COREBOOT_*_MAKE_PATH               = DEF(COREBOOT_PREFIX)make
> +*_COREBOOT_*_*_DLL                   = ENV(COREBOOT_DLL)
> +*_COREBOOT_*_ASL_PATH                = DEF(COREBOOT_PREFIX)iasl
> +
> +*_COREBOOT_*_PP_FLAGS                = DEF(GCC_PP_FLAGS)
> +*_COREBOOT_*_ASLPP_FLAGS             = DEF(GCC_ASLPP_FLAGS)
> +*_COREBOOT_*_ASLCC_FLAGS             = DEF(GCC_ASLCC_FLAGS)
> +*_COREBOOT_*_VFRPP_FLAGS             = DEF(GCC_VFRPP_FLAGS)
> +*_COREBOOT_*_APP_FLAGS               =
> +*_COREBOOT_*_ASL_FLAGS               = DEF(IASL_FLAGS)
> +*_COREBOOT_*_ASL_OUTFLAGS            = DEF(IASL_OUTFLAGS)
> +
> +##################
> +# COREBOOT IA32 definitions
> +##################
> +*_COREBOOT_IA32_OBJCOPY_PATH         = DEF(COREBOOT_IA32_PREFIX)objcopy
> +*_COREBOOT_IA32_CC_PATH              = DEF(COREBOOT_IA32_PREFIX)gcc
> +*_COREBOOT_IA32_SLINK_PATH           = DEF(COREBOOT_IA32_PREFIX)gcc-ar
> +*_COREBOOT_IA32_DLINK_PATH           = DEF(COREBOOT_IA32_PREFIX)gcc
> +*_COREBOOT_IA32_ASLDLINK_PATH        = DEF(COREBOOT_IA32_PREFIX)gcc
> +*_COREBOOT_IA32_ASM_PATH             = DEF(COREBOOT_IA32_PREFIX)gcc
> +*_COREBOOT_IA32_PP_PATH              = DEF(COREBOOT_IA32_PREFIX)gcc
> +*_COREBOOT_IA32_VFRPP_PATH           = DEF(COREBOOT_IA32_PREFIX)gcc
> +*_COREBOOT_IA32_ASLCC_PATH           = DEF(COREBOOT_IA32_PREFIX)gcc
> +*_COREBOOT_IA32_ASLPP_PATH           = DEF(COREBOOT_IA32_PREFIX)gcc
> +*_COREBOOT_IA32_RC_PATH              = DEF(COREBOOT_IA32_PREFIX)objcopy
> +
> +*_COREBOOT_IA32_ASLCC_FLAGS          = DEF(GCC_ASLCC_FLAGS) -m32 -fno-lto
> +*_COREBOOT_IA32_ASLDLINK_FLAGS       = DEF(COREBOOT_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_i386
> +*_COREBOOT_IA32_ASM_FLAGS            = DEF(COREBOOT_ASM_FLAGS) -m32 -march=i386
> +*_COREBOOT_IA32_DLINK2_FLAGS         = DEF(COREBOOT_IA32_DLINK2_FLAGS)
> +*_COREBOOT_IA32_RC_FLAGS             = DEF(GCC_IA32_RC_FLAGS)
> +*_COREBOOT_IA32_OBJCOPY_FLAGS        =
> +*_COREBOOT_IA32_NASM_FLAGS           = -f elf32
> +
> +  DEBUG_COREBOOT_IA32_CC_FLAGS       = DEF(COREBOOT_IA32_CC_FLAGS) -flto -Os
> +  DEBUG_COREBOOT_IA32_DLINK_FLAGS    = DEF(COREBOOT_IA32_X64_DLINK_FLAGS) -flto -Os
> -Wl,-m,elf_i386,--oformat=elf32-i386
> +
> +RELEASE_COREBOOT_IA32_CC_FLAGS       = DEF(COREBOOT_IA32_CC_FLAGS) -flto -Os -Wno-unused-but-set-variable
> +RELEASE_COREBOOT_IA32_DLINK_FLAGS    = DEF(COREBOOT_IA32_X64_DLINK_FLAGS) -flto -Os
> -Wl,-m,elf_i386,--oformat=elf32-i386
> +
> +  NOOPT_COREBOOT_IA32_CC_FLAGS       = DEF(COREBOOT_IA32_CC_FLAGS) -O0
> +  NOOPT_COREBOOT_IA32_DLINK_FLAGS    = DEF(COREBOOT_IA32_X64_DLINK_FLAGS) -Wl,-m,elf_i386,--oformat=elf32-i386
> -O0
> +
> +##################
> +# COREBOOT X64 definitions
> +##################
> +*_COREBOOT_X64_OBJCOPY_PATH          = DEF(COREBOOT_X64_PREFIX)objcopy
> +*_COREBOOT_X64_CC_PATH               = DEF(COREBOOT_X64_PREFIX)gcc
> +*_COREBOOT_X64_SLINK_PATH            = DEF(COREBOOT_X64_PREFIX)gcc-ar
> +*_COREBOOT_X64_DLINK_PATH            = DEF(COREBOOT_X64_PREFIX)gcc
> +*_COREBOOT_X64_ASLDLINK_PATH         = DEF(COREBOOT_X64_PREFIX)gcc
> +*_COREBOOT_X64_ASM_PATH              = DEF(COREBOOT_X64_PREFIX)gcc
> +*_COREBOOT_X64_PP_PATH               = DEF(COREBOOT_X64_PREFIX)gcc
> +*_COREBOOT_X64_VFRPP_PATH            = DEF(COREBOOT_X64_PREFIX)gcc
> +*_COREBOOT_X64_ASLCC_PATH            = DEF(COREBOOT_X64_PREFIX)gcc
> +*_COREBOOT_X64_ASLPP_PATH            = DEF(COREBOOT_X64_PREFIX)gcc
> +*_COREBOOT_X64_RC_PATH               = DEF(COREBOOT_X64_PREFIX)objcopy
> +
> +*_COREBOOT_X64_ASLCC_FLAGS           = DEF(GCC_ASLCC_FLAGS) -m64 -fno-lto
> +*_COREBOOT_X64_ASLDLINK_FLAGS        = DEF(COREBOOT_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_x86_64
> +*_COREBOOT_X64_ASM_FLAGS             = DEF(COREBOOT_ASM_FLAGS) -m64
> +*_COREBOOT_X64_DLINK2_FLAGS          = DEF(COREBOOT_X64_DLINK2_FLAGS)
> +*_COREBOOT_X64_RC_FLAGS              = DEF(GCC_X64_RC_FLAGS)
> +*_COREBOOT_X64_OBJCOPY_FLAGS         =
> +*_COREBOOT_X64_NASM_FLAGS            = -f elf64
> +
> +  DEBUG_COREBOOT_X64_CC_FLAGS        = DEF(COREBOOT_X64_CC_FLAGS) -flto -DUSING_LTO -Os
> +  DEBUG_COREBOOT_X64_DLINK_FLAGS     = DEF(COREBOOT_X64_DLINK_FLAGS) -flto -Os
> +
> +RELEASE_COREBOOT_X64_CC_FLAGS        = DEF(COREBOOT_X64_CC_FLAGS) -flto -DUSING_LTO -Os
> -Wno-unused-but-set-variable
> +RELEASE_COREBOOT_X64_DLINK_FLAGS     = DEF(COREBOOT_X64_DLINK_FLAGS) -flto -Os
> +
> +  NOOPT_COREBOOT_X64_CC_FLAGS        = DEF(COREBOOT_X64_CC_FLAGS) -O0
> +  NOOPT_COREBOOT_X64_DLINK_FLAGS     = DEF(COREBOOT_X64_DLINK_FLAGS) -O0
> +
> +##################
> +# COREBOOT ARM definitions
> +##################
> +*_COREBOOT_ARM_CC_PATH               = ENV(COREBOOT_ARM_PREFIX)gcc
> +*_COREBOOT_ARM_SLINK_PATH            = ENV(COREBOOT_ARM_PREFIX)gcc-ar
> +*_COREBOOT_ARM_DLINK_PATH            = ENV(COREBOOT_ARM_PREFIX)gcc
> +*_COREBOOT_ARM_ASLDLINK_PATH         = ENV(COREBOOT_ARM_PREFIX)gcc
> +*_COREBOOT_ARM_ASM_PATH              = ENV(COREBOOT_ARM_PREFIX)gcc
> +*_COREBOOT_ARM_PP_PATH               = ENV(COREBOOT_ARM_PREFIX)gcc
> +*_COREBOOT_ARM_VFRPP_PATH            = ENV(COREBOOT_ARM_PREFIX)gcc
> +*_COREBOOT_ARM_ASLCC_PATH            = ENV(COREBOOT_ARM_PREFIX)gcc
> +*_COREBOOT_ARM_ASLPP_PATH            = ENV(COREBOOT_ARM_PREFIX)gcc
> +*_COREBOOT_ARM_RC_PATH               = ENV(COREBOOT_ARM_PREFIX)objcopy
> +
> +*_COREBOOT_ARM_ARCHCC_FLAGS          = -mthumb
> +*_COREBOOT_ARM_ASLCC_FLAGS           = DEF(GCC_ASLCC_FLAGS)
> +*_COREBOOT_ARM_ASLDLINK_FLAGS        = DEF(COREBOOT_ARM_ASLDLINK_FLAGS)
> +*_COREBOOT_ARM_ASM_FLAGS             = DEF(COREBOOT_ARM_ASM_FLAGS)
> +*_COREBOOT_ARM_DLINK2_FLAGS          = DEF(COREBOOT_ARM_DLINK2_FLAGS)
> +*_COREBOOT_ARM_PLATFORM_FLAGS        = -march=armv7-a
> +*_COREBOOT_ARM_PP_FLAGS              = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
> +*_COREBOOT_ARM_RC_FLAGS              = DEF(GCC_ARM_RC_FLAGS)
> +*_COREBOOT_ARM_VFRPP_FLAGS           = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
> +*_COREBOOT_ARM_CC_XIPFLAGS           = DEF(COREBOOT_ARM_CC_XIPFLAGS)
> +
> +  DEBUG_COREBOOT_ARM_CC_FLAGS        = DEF(COREBOOT_ARM_CC_FLAGS) -O0
> +  DEBUG_COREBOOT_ARM_DLINK_FLAGS     = DEF(COREBOOT_ARM_DLINK_FLAGS)
> +
> +RELEASE_COREBOOT_ARM_CC_FLAGS        = DEF(COREBOOT_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable
> +RELEASE_COREBOOT_ARM_DLINK_FLAGS     = DEF(COREBOOT_ARM_DLINK_FLAGS) -flto -Os
> -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +
> +  NOOPT_COREBOOT_ARM_CC_FLAGS        = DEF(COREBOOT_ARM_CC_FLAGS) -O0
> +  NOOPT_COREBOOT_ARM_DLINK_FLAGS     = DEF(COREBOOT_ARM_DLINK_FLAGS) -O0
> +
> +##################
> +# COREBOOT AARCH64 definitions
> +##################
> +*_COREBOOT_AARCH64_CC_PATH           = ENV(COREBOOT_AARCH64_PREFIX)gcc
> +*_COREBOOT_AARCH64_SLINK_PATH        = ENV(COREBOOT_AARCH64_PREFIX)gcc-ar
> +*_COREBOOT_AARCH64_DLINK_PATH        = ENV(COREBOOT_AARCH64_PREFIX)gcc
> +*_COREBOOT_AARCH64_ASLDLINK_PATH     = ENV(COREBOOT_AARCH64_PREFIX)gcc
> +*_COREBOOT_AARCH64_ASM_PATH          = ENV(COREBOOT_AARCH64_PREFIX)gcc
> +*_COREBOOT_AARCH64_PP_PATH           = ENV(COREBOOT_AARCH64_PREFIX)gcc
> +*_COREBOOT_AARCH64_VFRPP_PATH        = ENV(COREBOOT_AARCH64_PREFIX)gcc
> +*_COREBOOT_AARCH64_ASLCC_PATH        = ENV(COREBOOT_AARCH64_PREFIX)gcc
> +*_COREBOOT_AARCH64_ASLPP_PATH        = ENV(COREBOOT_AARCH64_PREFIX)gcc
> +*_COREBOOT_AARCH64_RC_PATH           = ENV(COREBOOT_AARCH64_PREFIX)objcopy
> +
> +*_COREBOOT_AARCH64_ASLCC_FLAGS       = DEF(GCC_ASLCC_FLAGS)
> +*_COREBOOT_AARCH64_ASLDLINK_FLAGS    = DEF(COREBOOT_AARCH64_ASLDLINK_FLAGS)
> +*_COREBOOT_AARCH64_ASM_FLAGS         = DEF(COREBOOT_AARCH64_ASM_FLAGS)
> +*_COREBOOT_AARCH64_DLINK2_FLAGS      = DEF(COREBOOT_AARCH64_DLINK2_FLAGS)
> +*_COREBOOT_AARCH64_PLATFORM_FLAGS    =
> +*_COREBOOT_AARCH64_PP_FLAGS          = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
> +*_COREBOOT_AARCH64_RC_FLAGS          = DEF(GCC_AARCH64_RC_FLAGS)
> +*_COREBOOT_AARCH64_VFRPP_FLAGS       = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
> +*_COREBOOT_AARCH64_CC_XIPFLAGS       = DEF(COREBOOT_AARCH64_CC_XIPFLAGS)
> +
> +  DEBUG_COREBOOT_AARCH64_CC_FLAGS    = DEF(COREBOOT_AARCH64_CC_FLAGS) -O0 -mcmodel=small
> +  DEBUG_COREBOOT_AARCH64_DLINK_FLAGS = DEF(COREBOOT_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000
> +  DEBUG_COREBOOT_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
> +
> +RELEASE_COREBOOT_AARCH64_CC_FLAGS    = DEF(COREBOOT_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable
> -mcmodel=tiny -fomit-frame-pointer
> +RELEASE_COREBOOT_AARCH64_DLINK_FLAGS = DEF(COREBOOT_AARCH64_DLINK_FLAGS) -flto -Os
> -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> +
> +  NOOPT_COREBOOT_AARCH64_CC_FLAGS    = DEF(COREBOOT_AARCH64_CC_FLAGS) -O0 -mcmodel=small
> +  NOOPT_COREBOOT_AARCH64_DLINK_FLAGS = DEF(COREBOOT_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 -O0
> +  NOOPT_COREBOOT_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 -O0
> +
>  ####################################################################################
>  #
>  # CLANG35   - This configuration is used to compile under Linux to produce
> --
> 2.13.2.725.g09c95d1e9-goog
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] BaseTools: Add COREBOOT tools definition
  2017-07-10 14:46 ` Gao, Liming
@ 2017-07-10 15:05   ` Patrick Georgi
  2017-07-11 14:00     ` Gao, Liming
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Georgi @ 2017-07-10 15:05 UTC (permalink / raw)
  To: Gao, Liming; +Cc: edk2-devel@lists.01.org

Hi Liming,

thank you for the review!

2017-07-10 16:46 GMT+02:00 Gao, Liming <liming.gao@intel.com>:

> Patrick:
>   Compared GCC5 and COREBOOT, the difference is that GCC5_IA32_PREFIX and
> GCC5_X64_PREFIX. CoreBoot tool chain has the different style. So, it can't
> reuse GCC5 tool chain. If GCC5 is update to refer to ENV (GCC5_IA32_PREFIX)
> and ENV (GCC5_X64_PREFIX) like ENV(GCC5_ARM_PREFIX) in CC_PATH, GCC5 can
> support COREBOOT usage. For the future, the different FLAG can be appended
> in [BuildOptions] of platform.dsc. So, I suggest to reuse GCC5 tool chain
> for coreboot.
>
We also use our own make and iasl binaries.
*_COREBOOT_*_MAKE_PATH               = DEF(COREBOOT_PREFIX)make
*_COREBOOT_*_ASL_PATH                = DEF(COREBOOT_PREFIX)iasl

The coreboot toolchain is gcc 6.3 based right now but will move to
something newer at some point. That the GCC5 configuration is sufficient
for now is a coincidence (although appreciated since it meant less work for
me). Unfortunately I likely won't be able to get away with that forever.
Asking people to adapt their Tianocore config because the toolchain was
updated is a bad user experience IMHO.

The two main benefits of using a well-defined, maintained toolchain and
configuration are:
1. a portable toolchain: you get the same results no matter the OS you're on
2. reproducible builds: with a given source tree and configuratoin, we get
bit identical binaries, which is rather useful for trust/security
assessments. See
https://tests.reproducible-builds.org/coreboot/coreboot.html

It might be useful to extend this effort to payloads such as
CorebootPayloadPkg. Dealing with random compilers (and their configs) is
something we at coreboot left behind ~10 years ago, and it was for the
better. (although I understand that the coreboot toolchain is just as
"random" to you as any other).
But if you feel this is too much extra stuff in your config files, I'll
have to see how to deal with the existing config sets instead.


Patrick
-- 
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft:
Hamburg
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] BaseTools: Add COREBOOT tools definition
  2017-07-10 15:05   ` Patrick Georgi
@ 2017-07-11 14:00     ` Gao, Liming
  0 siblings, 0 replies; 7+ messages in thread
From: Gao, Liming @ 2017-07-11 14:00 UTC (permalink / raw)
  To: Patrick Georgi; +Cc: edk2-devel@lists.01.org

Patrick:
  In current tools_def.txt, iasl path is ENV(IASL_PREFIX)iasl. So, you can configure IASL_PREFIX env to point the your directory. In edk2, GCC5 is the tool chain configuration with LTO support, not specific to the compiler version. Since COREBOOT has the same configuration, it can reuse GCC5 tool chain. To let user correctly use GCC5 tool chain build CorebootPayloadPkg, you can add readme.md in CorebootPayloadPkg to introduce how to generate the cross compiler and how to configure GCC5_PREFIX and IASL_PREFIX env. In fact, even if COREBOOT tool chain is added, you also need to document these steps. 

Thanks
Liming
>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Patrick Georgi
>Sent: Monday, July 10, 2017 11:06 PM
>To: Gao, Liming <liming.gao@intel.com>
>Cc: edk2-devel@lists.01.org
>Subject: Re: [edk2] [PATCH] BaseTools: Add COREBOOT tools definition
>
>Hi Liming,
>
>thank you for the review!
>
>2017-07-10 16:46 GMT+02:00 Gao, Liming <liming.gao@intel.com>:
>
>> Patrick:
>>   Compared GCC5 and COREBOOT, the difference is that GCC5_IA32_PREFIX
>and
>> GCC5_X64_PREFIX. CoreBoot tool chain has the different style. So, it can't
>> reuse GCC5 tool chain. If GCC5 is update to refer to ENV (GCC5_IA32_PREFIX)
>> and ENV (GCC5_X64_PREFIX) like ENV(GCC5_ARM_PREFIX) in CC_PATH,
>GCC5 can
>> support COREBOOT usage. For the future, the different FLAG can be
>appended
>> in [BuildOptions] of platform.dsc. So, I suggest to reuse GCC5 tool chain
>> for coreboot.
>>
>We also use our own make and iasl binaries.
>*_COREBOOT_*_MAKE_PATH               = DEF(COREBOOT_PREFIX)make
>*_COREBOOT_*_ASL_PATH                = DEF(COREBOOT_PREFIX)iasl
>
>The coreboot toolchain is gcc 6.3 based right now but will move to
>something newer at some point. That the GCC5 configuration is sufficient
>for now is a coincidence (although appreciated since it meant less work for
>me). Unfortunately I likely won't be able to get away with that forever.
>Asking people to adapt their Tianocore config because the toolchain was
>updated is a bad user experience IMHO.
>
>The two main benefits of using a well-defined, maintained toolchain and
>configuration are:
>1. a portable toolchain: you get the same results no matter the OS you're on
>2. reproducible builds: with a given source tree and configuratoin, we get
>bit identical binaries, which is rather useful for trust/security
>assessments. See
>https://tests.reproducible-builds.org/coreboot/coreboot.html
>
>It might be useful to extend this effort to payloads such as
>CorebootPayloadPkg. Dealing with random compilers (and their configs) is
>something we at coreboot left behind ~10 years ago, and it was for the
>better. (although I understand that the coreboot toolchain is just as
>"random" to you as any other).
>But if you feel this is too much extra stuff in your config files, I'll
>have to see how to deal with the existing config sets instead.
>
>
>Patrick
>--
>Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
>Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft:
>Hamburg
>Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-07-11 13:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-04 15:22 [PATCH] BaseTools: Add COREBOOT tools definition Patrick Georgi
2017-07-10 14:46 ` Gao, Liming
2017-07-10 15:05   ` Patrick Georgi
2017-07-11 14:00     ` Gao, Liming
  -- strict thread matches above, loose matches on Subject: below --
2017-06-30 22:39 Patrick Georgi
2017-07-03  3:08 ` Gao, Liming
2017-07-07  9:16   ` Patrick Georgi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox