summaryrefslogtreecommitdiffstats
path: root/BaseTools/Conf/tools_def.template
Commit message (Collapse)AuthorAgeFilesLines
* BaseTools/tools_def CLANGDWARF: Permit text relocationsArd Biesheuvel2023-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | We rely on PIE executables to get the codegen that is suitable for PE/COFF conversion where the resulting executables can be loaded anywhere in the address space. However, ELF linkers may default to disallowing text relocations in PIE executables, as this would require text segments to be updated at runtime, which is bad for security and increases the copy-on-write footprint of ELF executables and shared libraries. However, none of those concerns apply to PE/COFF executables in the context of EFI, which are copied into memory rather than mmap()'ed, and fixed up by the loader before launch. So pass -z notext to the LLD linker to permit runtime relocations in read-only sections. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
* BaseTools/Conf/tools_def: Fix linking using CLANGDWARF_IA32Rebecca Cran2023-04-051-7/+7
| | | | | | | | | | | | | | | | The clang toolchain might default to fPIE/fPIC, which prevents lld from linking the objects into a binary. Specify -fno-pie -fno-pic as done on GCC to fix linking. Test: Building the Universal Payload using the command 'python UefiPayloadPkg/UniversalPayloadBuild.py -a IA32' actually works. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4356
* ArmPkg, BaseTools AARCH64: Add BTI ELF note to .hii objectsArd Biesheuvel2023-03-301-2/+3
| | | | | | | | | | | | | | | | The ELF based toolchains use objcopy to create HII object files, which contain only a single .hii section. This means no GNU note is inserted that describes the object as compatible with BTI, even though the lack of executable code in such an object makes the distinction irrelevant. However, the linker will not add the note globally to the resulting ELF executable, and this breaks BTI compatibility. So let's insert a GNU BTI-compatible ELF note by hand when generating such object files. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
* BaseTools/tools_def.template: Update -march parameter for RISC-VSunil V L2023-02-231-1/+1
| | | | | | | | | | | | | | | | | | Replace rv64imafdc with rv64gc so that it works for gcc 12. "g" means imafd in gcc < 12 and imafd_zifencei_zicsr in gcc >= 12. So, replacing rv64imafdc with rv64gc will work for both gcc <12 and gcc >=12. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Andrei Warkentin <andrei.warkentin@intel.com> Cc: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> Tested-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* tools_def: Remove duplicated -OsPierre Gondois2023-01-301-12/+12
| | | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2928 commit 17bd834eb5fd ("BaseTools: Factorize GCC flags") makes GCC48_ALL_CC_FLAGS inherit from GCC_ALL_CC_FLAGS. GCC_ALL_CC_FLAGS contains the '-Os' flag. The latest flag in a command line overrides the previous optimization option. This allows more specific build configuration to override the inherited '-Os' flag. If a build configuration includes GCC48_ALL_CC_FLAGS, hard-coded '-Os' options are not necessary anymore. Remove them. Reported-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/tools_def CLANG38: Suppress unaligned access warningArd Biesheuvel2023-01-171-1/+1
| | | | | | | | | | | | Even though the presence of the 'packed' pragma should be a strong hint that the misaligned placement of a GUID in a struct is intentional, recent Clang versions will object nonetheless, and break the build due to the presence of such GUIDs in the FPDT ACPI tables. This is obviously not something we can fix in the code, so let's just suppress the warning/error instead. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* BaseTools/tools_def ARM: Make choice for soft float ABI explicitArd Biesheuvel2023-01-171-2/+2
| | | | | | | | | | | | | | Recent GCC for ARM will complain when selecting the hard float ABI without specifying the FPU implementation, even when just running the preprocessor. This all happens under the hood, and we never bothered in the past, given that we don't emit floating point code anyway. However, to placate newer compilers, make it explicit that the floating point ABI is always the softfloat one, by moving the -msoft-float compiler option to PLATFORM_FLAGS. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* BaseTools/tools_def ARM AARCH64: Get rid of ARCHCC and ARCHASM flagsArd Biesheuvel2023-01-171-48/+41
| | | | | | | ARCHCC_FLAGS and ARCHASM_FLAGS no longer serve a useful purpose so drop all the definitions and references. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* BaseTools/tools_def RISCV: Make OpenSBI references RISCV-onlyArd Biesheuvel2023-01-171-2/+1
| | | | | | | | | | | | | | | The global GCC_PP_FLAGS tools_def variable now contains a reference to OpenSBI specific C preprocessor variables, which means they are added to the command line on every architecture, not just RISC-V. This does not currently result in any issues, but it is a bit sloppy so let's clean this up. Given that the GCC_PP_FLAGS definition appears twice, drop the one that carries the OpenSBI reference, and move that reference to a new RISC-V specific variable. Acked-by: Abner Chang <abner.chang@amd.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* BaseTools: Fix IA32 UINT64 alignment for CLANG toolchainsPedro Falcato2022-12-301-9/+9
| | | | | | | | | | | | | | | | | Currently, UINT64 is not 8-byte aligned for CLANG* toolchains on IA32, which causes ABI differences between IA32 and X64 in such simple examples as: struct S {UINT32 A; UINT64 B;}; Pass -malign-double to align it to 8 bytes, as is done for GCC already. Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com> Cc: Marvin H?user <mhaeuser@posteo.de> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* tools_def: add -fno-omit-frame-pointer to GCC48_{IA32,X64}_CC_FLAGSGerd Hoffmann2022-12-221-2/+2
| | | | | | | | Fixes problems due to code assuming it runs with frame pointers and thus updates rbp / ebp registers when switching stacks. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Liming Gao <gaoliming@byosoft.com.cn>
* tools_def: remove GCC_IA32_CC_FLAGS/GCC_X64_CC_FLAGSGerd Hoffmann2022-12-221-2/+0
| | | | | | | They are not used anywhere. Remove them. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Updated for GCC5 tool chain for LoongArch platfrom.Chao Li2022-10-141-6/+48
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053 BaseTools define template files changes for building EDK2 LoongArch platform. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Chao Li <lichao@loongson.cn> Co-authored-by: Dongyan Qian <qiandongyan@loongson.cn> Co-authored-by: Baoqi Zhang <zhangbaoqi@loongson.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* Revert "OvmfPkg/Sec: fix stack switch"Gerd Hoffmann2022-06-101-3/+3
| | | | | | | | | This reverts commit ff36b2550f94dc5fac838cf298ae5a23cfddf204. Has no effect because GCC_IA32_CC_FLAGS and GCC_X64_CC_FLAGS are unused. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* OvmfPkg/Sec: fix stack switchGerd Hoffmann2022-06-081-3/+3
| | | | | | | | | | | | | | | | | | | | The ebp/rbp register can either be used for the frame pointer or as general purpose register. With gcc (and clang) this depends on the -f(no-)omit-frame-pointer switch. This patch updates tools_def.template to explicitly set the compiler option and also add a define to allow conditionally compile code. The new define is used to fix stack switching in TemporaryRamMigration. The ebp/rbp must not be touched when the compiler can use it as general purpose register. With version 12 gcc starts actually using the register, so changing it leads to firmware crashes in some configurations. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3934 Reported-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* BaseTools: Remove RVCT supportedk2-stable202205-rc1Rebecca Cran2022-05-131-157/+0
| | | | | | | | RVCT is obsolete and no longer used. Remove support for it. Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* BaseTools: Upgrade the version of NASM toolJason2022-03-011-3/+3
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3790 Upgrade the version of NASM tool to avoid compilation errors when compiling NASM code change. Signed-off-by: Jason Lou <yun.lou@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
* BaseTools: Update CLANG{35,38}_WARNING_OVERRIDES to ignore unused varsedk2-stable202202-rc1Rebecca Cran2022-02-101-2/+2
| | | | | | | | | | | | Building with the CLANG35 and CLANG38 toolset fails because of variables which are set but not otherwise used in the RELEASE build. GCC added -Wno-unused-but-set-variable back in 2016, and later added -Wno-unused-const-variable. Add those to CLANG35_WARNING_OVERRIDES and CLANG38_WARNING_OVERRIDES. Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* BaseTools/Conf: Add new macro for customizing dll file reduction.Wei6 Xu2022-02-071-0/+1
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3810 New macro OBJCOPY_STRIPFLAG is added in build_rule.template to replace '--strip-unneeded -R .eh_frame', so that module can have some unique objcopy flags for its own purpose. In tools_def.template, set '--strip-unneeded -R .eh_frame' as default value of OBJCOPY_STRIPFLAG. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Change CLANG8ELF to CLANGDWARFNi, Ray2021-06-041-90/+91
| | | | | | | | | | | | | CLANGDWARF is more proper because it's similar to CLANGPDB that generates PE images but with DWARF debug symbols. This toolchain is needed for creating ELF format universal payload that follows https://universalpayload.github.io/documentation/. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Add new CLANG8ELF tool chain for new LLVM/CLANG8Liming Gao2021-06-041-0/+102
| | | | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1603 LLVM/CLANG8 formal release http://releases.llvm.org/download.html#8.0.0 It can be downloaded and installed in Windows/Linux/Mac OS. CLANG8ELF tool chain is added to generate ELF image, and convert to PE/COFF. On Windows OS, set CLANG_HOST_BIN=n, set CLANG8_BIN=LLVM installed directory For example: set CLANG_HOST_BIN=n # use windows nmake set CLANG8_BIN=C:\Program Files\LLVM\bin\ On Linux/Mac, set CLANG8_BIN=LLVM installed directory This tool chain can be used to compile the firmware code. On windows OS, Visual Studio is still required to compile BaseTools C tools and nmake.exe. On Linux/Mac OS, gcc is used to compile BaseTools C tools. make is used for makefile. This tool chain is verified on OVMF Ia32, X64 and Ia32X64 to boot Shell. This tool chain is verified in Windows/Linux and Mac OS. Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
* BaseTools: Add DTCPP_FLAGS for GCC5 RISCV64 toolchainDaniel Schaefer2021-05-171-0/+1
| | | | | | | | | | | | | | Some/all platforms are going to require EDK2 to build a device tree and use it in the early stages of boot. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Abner Chang <abner.chang@hpe.com> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools/Conf/tools_def.template: Remove redundant MAKE statementsMichael D Kinney2021-04-191-55/+0
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3337 Remove redundant MAKE_PATH and MAKE_FLAGS statements for VS20xx tool chains. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
* BaseTools/Conf: Fix MAKE_FLAGS typos in tools_def.templateMichael D Kinney2021-04-121-8/+8
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3313 Change MAKE_FLAG to MAKE_FLAGS to match required name from EDK II Build Specifications for VS20xx tool chains. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
* Revert "BaseTools: Add gcc flag to warn on void* pointer arithmetic"Bob Feng2020-07-241-3/+3
| | | | | | | | | | | | | | | | | This reverts commit dbd546a32d5abe225306e22d43a7d86e3a042eee. This patch also breaks about half of the ARM/AARCH64 platforms in edk2-platforms Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* BaseTools: Factorize GCC flagsPierre Gondois2020-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | GCC48_ALL_CC_FLAGS has no dependency on GCC_ALL_CC_FLAGS. By definition, there should be such dependency. The outcomes of this patch is that GCC48_ALL_CC_FLAGS and other dependent configurations will inherit from the additional "-Os" flag. The "-Os" flag optimizes a build in size, not breaking any build. In a gcc command line, the last optimization flag has precedence. This means that this "-Os" flag will be overriden by a more specific optimization configuration, provided that this more specific flag is appended at the end of the CC_FLAGS. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Suggested-by: Tomas Pilar <Tomas.Pilar@arm.com> Reviewed-by: Bob Feng<bob.c.feng@intel.com>
* BaseTools: Add gcc flag to warn on void* pointer arithmeticPierre Gondois2020-07-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | By default, gcc allows void* pointer arithmetic. This is a GCC extension. However: - the C reference manual states that void* pointer "cannot be operands of addition or subtraction operators". Cf s5.3.1 "Generic Pointers"; - Visual studio compiler treat such operation as an error. To prevent such pointer arithmetic, the "-Wpointer-arith" flag should be set for all GCC versions. The "-Wpointer-arith" allows to: "Warn about anything that depends on the "size of" a function type or of void. GNU C assigns these types a size of 1, for convenience in calculations with void * pointers and pointers to functions." This flag is available since GCC2.95.3 which came out in 2001. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Bob Feng<bob.c.feng@intel.com>
* BaseTools: Add external definitions for RISC-V assembly buildAbner Chang2020-06-241-0/+1
| | | | | | | | | | | | | | | Add opensbi external definitions to RISC-V build for assembly code. Use GCC5_RISCV_OPENSBI_TYPES to refer to edk2 data type for assembly files instead of using opensbi data type. Signed-off-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Leif Lindholm <leif.lindholm@linaro.org>
* BaseTools: Remove deprecated Visual Studio OptionSami Mujawar2020-05-211-9/+9
| | | | | | | | | | | | | | | | | | | The VS2017 compiler reports 'warning D9035 : option 'Gm' has been deprecated and will be removed in a future release' The documentation for the 'Gm' option at https://docs.microsoft.com/en-us/cpp/build/reference/gm-enable-minimal-rebuild?view=vs-2019 indicates that this option can be safely removed from the project. Therefore, remove the deprecated 'Gm' Visual Studio Compiler option. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2660 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: BaseTools changes for RISC-V platform.Abner Chang2020-04-291-2/+51
| | | | | | | | | | | | | | | Tools definitions template file changes for building EDK2 RISC-V platform. Signed-off-by: Abner Chang <abner.chang@hpe.com> Co-authored-by: Gilbert Chen <gilbert.chen@hpe.com> Co-authored-by: Daniel Helmut Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Gilbert Chen <gilbert.chen@hpe.com>
* BaseTools: Use SEH exceptions in CLANGPDB for IA32Vitaly Cheptsov2020-04-081-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2628 This patch reduces the size of IA32 binaries by ensuring that no .debug_frame / .eh_frame sections are generated through forcing SEH exception model, which is already the default in clang for X64. EDK II does not support exceptions, and in future we should disable them instead of switching to some other variant. Currently this is not possible due to the following LLVM bugs: https://bugs.llvm.org/show_bug.cgi?id=45324 https://bugs.llvm.org/show_bug.cgi?id=45325 Upon applying this patch OvmfPkgIA32.dsc compilation in DEBUG mode gets the following size decrease with clang 9.0.1. Before: FV Space Information SECFV [11%Full] 212992 total, 24512 used, 188480 free PEIFV [22%Full] 917504 total, 203048 used, 714456 free DXEFV [36%Full] 11534336 total, 4215672 used, 7318664 free FVMAIN_COMPACT [37%Full] 3440640 total, 1287776 used, 2152864 free After: FV Space Information SECFV [10%Full] 212992 total, 22112 used, 190880 free PEIFV [19%Full] 917504 total, 176392 used, 741112 free DXEFV [31%Full] 11534336 total, 3657112 used, 7877224 free FVMAIN_COMPACT [33%Full] 3440640 total, 1153896 used, 2286744 free Cc: Liming Gao <liming.gao@intel.com> Cc: Marvin H?user <mhaeuser@outlook.de> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
* BaseTools: remove -DNO_MSABI_VA_FUNCS option in CLANGPDB tool chainLiu, Zhiguang2020-02-131-1/+1
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2524 remove -DNO_MSABI_VA_FUNCS option in CLANGPDB tool chain After CLANGPDB is switched to GNU mode, to use MS ABI version of GCC built-in macros for variable argument lists as same as CLANG38 tool chain. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Switch to GNU mode for CLANGPDBVitaly Cheptsov2020-02-111-3/+3
| | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2397 Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Enhance call stack unwindability for CLANGPDB x64 binarySteven2020-02-071-7/+9
| | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2487 The call stack unwindability of the COFF X64 binary requires the binary to remain the pdata and xdata sections. Details see the MSVC X64 calling convertion doc in below link: https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention Current build options discard or zero the data in pdata and xdata sections which cause the debugger cannot correctly unwind the X64 binary call stack in the runtime. Enhance the build options to force emit the unwind tables and keep the data of pdata and xdata sections correct in the binary. Signed-off-by: Steven Shi <steven.shi@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chainLiming Gao2020-02-071-2/+2
| | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2502 This option is required to make GCC49 tool chain work with the high version GCC compiler. Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: append -DNO_MSABI_VA_FUNCS option in CLANGPDB tool chainLiu, Zhiguang2020-02-061-1/+1
| | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2415 Define NO_MSABI_VA_FUNCS to use GCC built-in macros for variable argument lists for CLANGPDB tool chain. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools:replaces the two offending quotes by ascii quotesFan, Zhiju2019-12-181-2/+2
| | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2423 That commit 13c5e34a1b introduces the first two UTF-8 characters (the quote ') in an otherwise all-ascii file. In Conf\tools_def.template There is tow lines of Notes: Since this tool chain is obsolete, it doesn't enable the compiler option for included header file list generation, we replaces the two offending quotes by proper ascii quotes The patch is going to fix this issue Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Add build option for dependency file generationBob Feng2019-12-101-83/+98
| | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2311 Add /showIncludes for msvc and -MMD -MF $@.deps for GCC and CLANG Remove /MP for msvc since /MP does not work with /showIncludes Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Rename tool chain CLANG9 to CLANGPDBLiming Gao2019-11-151-78/+78
| | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2341 Based on feedback from https://edk2.groups.io/g/devel/message/50466, CLANGPDB is the most acceptable tool chain name, because this tool chain generates PE/COFF image with PDB debug symbol. The following changes are made in this patch. 1. Update tool chain name from CLANG9 to CLANGPDB. 2. Update tool chain BUILDRULEFAMILY from CLANGPE to CLANGPDB. 3. Update CLANG9_BIN env name to CLANG_BIN without version info. Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Add RC_PATH define for VS2017/2019Sean Brogan2019-11-111-2/+16
| | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2315 Add use of RC_PATH define that provides the path to the resource compiler that is typically provided in a Windows SDK. The path changes with different Windows SDK releases. This define is set to the WINSDK_PATH_FOR_RC_EXE environment variable. This environment variable must be set to the path to the currently installed resource compiler (rc.exe). Update set_vsprefix_envs.bat to set WINSDK_PATH_FOR_RC_EXE if a Windows SDK is detected. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools tools_def: Add CLANG9 tool chain to directly generate PE imageLiming Gao2019-10-241-0/+102
| | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1603 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com>
* BaseTools tools_def.template: Remove unnecessary $(DEST_DIR_DEBUG) pathLiming Gao2019-10-241-11/+11
| | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1603 $(DEST_DIR_DEBUG) path is in Include directory. It is not required to be specified again. Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* Add VS2019 Toolchain defCheng, Ching JenX2019-09-231-19/+201
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2182 In order to support VS2019, the first thing need to do is add 2019 toolchain on tools_def.template v2: add ARM/AARCH64/EBC Definitions, Combine VS2017_HOST and VS2019_HOST to VS_HOST Cc: Amy Chan <amy.chan@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Ching JenX Cheng <ching.jenx.cheng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Pete Batard <pete@akeo.ie>
* BaseTools/tools_def.template: Add -gdwarf to XCODE5 X64Andrew Fish2019-08-191-2/+2
| | | | | | | | | | | | | Add -gdwarf to XCODE5 X64 builds to generate symbols for source level debug using lldb. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Andrew Fish <afish@apple.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Andrew Fish <afish@apple.com>
* BaseTools/tools_def.template: Remove tools chain with ASL toolShenglei Zhang2019-04-281-1260/+0
| | | | | | | | | | | | | | | | | Microsoft ASL is not verified now. So remove tool chain with ASL tool. They are: VS2008xASL, VS2008x86xASL, VS2010xASL, VS2010x86xASL, VS2012xASL, VS2012x86xASL, VS2013xASL, VS2013x86xASL, VS2015xASL, VS2015x86xASL and CYGGCCxASL. https://bugzilla.tianocore.org/show_bug.cgi?id=1667 v2:Remove definitions of WIN_ASL_BIN, MS_ASL_OUTFLAGS and MS_ASL_FLAGS. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Remove ICC tool chain in tools_def.templateShenglei Zhang2019-04-241-1092/+0
| | | | | | | | | | | | | | There is no Intel compiler test. Suggest to remove ICC tool chain from tools_def.template. https://bugzilla.tianocore.org/show_bug.cgi?id=1666 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit 323b5b06c593ba6e438847dec7d4acec7f9df970)
* BaseTools:Enable the /MP option of MSVC compilerFan, ZhijuX2019-04-161-63/+63
| | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1672 The /MP option of MSVC compiler can reduce the total time to compile the source files on the command line. This patch is going to enable this MSVC option in BaseTools. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-091-7/+1
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Enable compiler cache support in edk2 buildShi, Steven2019-03-121-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1499 Compiler cache can greatly improve the build performance and guarantee the build result safe. In our testing, the compiler cache can improve the overall clean build time usually by 30+% in linux and 10+% in windows. The compiler cache are very fit to improve the Continuous Integration (CI) build performance. For linux compiler cache (ccache) enabling, there is no need to update edk2 code. Below link has the ccache enabling referencd steps: https://github.com/shijunjing/edk2/wiki/ Edk2-compiler-cache-enabling-steps-on-Linux For windows compiler cache (clcache) enabling, we need update the .PDB debugging file producing option from /Zi to /Z7, which is to let the C object file contain its full symbolic debugging information rather than produces a separated PDB file for all obj files per folder. "PDB files are generated by a different process (mspdbsrv). They arrive or are updated on disk after cl completes a compilation or linking operation. One huge problem with caching them is that the pdb files are input files as well as outputs. mspdbsrv updates the file with new debug information if the file exists beforehand. If there are several compilations going on at once targetting the same pdb then the order the pdb gets updated is unpredictable. All this makes caching very hard." The /Zi issue more detail disccusion can be found: https://github.com/frerich/clcache/issues/30 Please be aware that this change has no any impact to edk2 module level PDB file generation, and we still can get the PDB debug file for a .efi module. The /Z7 only impact intermediate obj files level PDB file, which is current one PDB file (vc140.pdb) per obj folder. Below link has the clcache enabling referencd steps: https://github.com/shijunjing/edk2/wiki/ Edk2-compiler-cache-enabling-steps-on-Windows Have tested below tools which consume the .PDB file: *Edk2 source code debugger *Various hardware and software debuggers *Uefi code coverage tools Only update and test below most commonly used four msvc toolchains: VS2012x86 VS2013x86 VS2015x86 VS2017 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Steven Shi <steven.shi@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/tools_def.template: Remove DDK3790Shenglei Zhang2019-02-141-233/+0
| | | | | | | | | | | | | | DDK3790 is too old.There is no verification for it. https://bugzilla.tianocore.org/show_bug.cgi?id=1377 v3:Reserve WINDDK_BIN32 and WINDDK_BIN64. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>