From e068d91824dbf2134f483640ad077b02eb8b8b05 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Mon, 1 Dec 2014 23:13:41 +0000 Subject: [PATCH] Link test executables with LLD on Windows. Clang generates DWARF debug info with section names longer than 8 characters. This is only supported by an extension to PE/COFF which the MSVC linker doesn't implement. So trying to link DWARF-enabled object files with MSVC will lead to corrupt debug information in the executable. llvm-svn: 223088 --- lldb/test/make/Makefile.rules | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lldb/test/make/Makefile.rules b/lldb/test/make/Makefile.rules index 19ed2cc..aff3160 100644 --- a/lldb/test/make/Makefile.rules +++ b/lldb/test/make/Makefile.rules @@ -34,8 +34,12 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)../../ # If OS is not defined, use 'uname -s' to determine the OS name. #---------------------------------------------------------------------- ifeq "$(ARCH)" "" +ifeq "$(OS)" "Windows_NT" + ARCH = x86 +else ARCH = x86_64 endif +endif ifeq "$(OS)" "" OS = $(shell uname -s) @@ -174,13 +178,17 @@ cxx_linker_notdir = $(if $(findstring clang,$(1)), \ cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1)))),$(call cxx_linker_notdir,$(1))) #---------------------------------------------------------------------- -# Clang for Windows doesn't yet support exceptions +# Windows specific options #---------------------------------------------------------------------- ifeq "$(OS)" "Windows_NT" ifneq (,$(findstring clang,$(CC))) + # Clang for Windows doesn't support C++ Exceptions CXXFLAGS += -fno-exceptions CXXFLAGS += -include $(THIS_FILE_DIR)uncaught_exception.h CXXFLAGS += -D_HAS_EXCEPTIONS=0 + # The MSVC linker doesn't understand long section names + # generated by the clang compiler. + LDFLAGS += -fuse-ld=lld endif endif -- 2.7.4