summaryrefslogtreecommitdiffstats
path: root/EmulatorPkg
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-07-23 10:19:46 +0200
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-08-02 08:40:43 +0200
commita1b8baccc30ba7c3911359e271b0e0a3ef56d501 (patch)
tree7a9f65043fb5684ee0357e4732cc18beee6b8286 /EmulatorPkg
parentbefb3ba5150200ce94044c8c27e6e812d8e89680 (diff)
downloadedk2-a1b8baccc30ba7c3911359e271b0e0a3ef56d501.tar.gz
edk2-a1b8baccc30ba7c3911359e271b0e0a3ef56d501.tar.bz2
edk2-a1b8baccc30ba7c3911359e271b0e0a3ef56d501.zip
BaseTools GCC: use 'gcc' as the linker command for GCC44 and later
To accommodate upcoming GCCx toolchain versions that require 'gcc' to be used as the linker in order to support LTO, switch GCC44 and later (including CLANG35) to a new DLINK build rule that invokes 'gcc' as the linker instead of 'ld'. Since gcc expects its command line arguments in a different format, and expects arguments that it needs to pass to the linker to be prefixed with '-Wl,', this involves changes to most of the DLINK_FLAGS definitions in tools_def.template, as well as some changes to module .INF files that set their own linker options. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'EmulatorPkg')
-rw-r--r--EmulatorPkg/Unix/Host/Host.inf6
1 files changed, 3 insertions, 3 deletions
diff --git a/EmulatorPkg/Unix/Host/Host.inf b/EmulatorPkg/Unix/Host/Host.inf
index d0b4927d16..d83857a1fd 100644
--- a/EmulatorPkg/Unix/Host/Host.inf
+++ b/EmulatorPkg/Unix/Host/Host.inf
@@ -116,12 +116,12 @@
[BuildOptions]
- GCC:*_*_IA32_DLINK_FLAGS == -o $(BIN_DIR)/Host -m elf_i386 -dynamic-linker $(HOST_DLINK_PATHS) -L/usr/lib/i386-linux-gnu -L/usr/X11R6/lib -lXext -lX11
+ GCC:*_*_IA32_DLINK_FLAGS == -o $(BIN_DIR)/Host -m32 -L/usr/X11R6/lib
GCC:*_*_IA32_CC_FLAGS == -m32 -g -fshort-wchar -fno-strict-aliasing -Wall -malign-double -idirafter/usr/include -c -include $(DEST_DIR_DEBUG)/AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
GCC:*_*_IA32_PP_FLAGS == -m32 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
GCC:*_*_IA32_ASM_FLAGS == -m32 -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
- GCC:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/Host -m elf_x86_64 -dynamic-linker $(HOST_DLINK_PATHS) -L/usr/lib/x86_64-linux-gnu -L/usr/X11R6/lib -lXext -lX11
+ GCC:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/Host -m64 -L/usr/X11R6/lib
GCC:*_*_X64_CC_FLAGS == -m64 -g -fshort-wchar -fno-strict-aliasing -Wall -malign-double -idirafter/usr/include -c -include $(DEST_DIR_DEBUG)/AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
GCC:*_GCC44_X64_CC_FLAGS = "-DEFIAPI=__attribute__((ms_abi))"
GCC:*_GCC45_X64_CC_FLAGS = "-DEFIAPI=__attribute__((ms_abi))"
@@ -132,7 +132,7 @@
GCC:*_*_X64_PP_FLAGS == -m64 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
GCC:*_*_X64_ASM_FLAGS == -m64 -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
- GCC:*_*_*_DLINK2_FLAGS == -lpthread -lc -ldl
+ GCC:*_*_*_DLINK2_FLAGS == -lpthread -ldl -lXext -lX11
#
# Need to do this link via gcc and not ld as the pathing to libraries changes from OS version to OS version