[Lldb-commits] [lldb] r223088 - Link test executables with LLD on Windows.
Zachary Turner
zturner at google.com
Mon Dec 1 15:13:41 PST 2014
Author: zturner
Date: Mon Dec 1 17:13:41 2014
New Revision: 223088
URL: http://llvm.org/viewvc/llvm-project?rev=223088&view=rev
Log:
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.
Modified:
lldb/trunk/test/make/Makefile.rules
Modified: lldb/trunk/test/make/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/make/Makefile.rules?rev=223088&r1=223087&r2=223088&view=diff
==============================================================================
--- lldb/trunk/test/make/Makefile.rules (original)
+++ lldb/trunk/test/make/Makefile.rules Mon Dec 1 17:13:41 2014
@@ -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 cl
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
More information about the lldb-commits
mailing list