[llvm] r220252 - Teach lit to filter the host LDFLAGS down from the build system and into
Chandler Carruth
chandlerc at gmail.com
Mon Oct 20 17:36:28 PDT 2014
Author: chandlerc
Date: Mon Oct 20 19:36:28 2014
New Revision: 220252
URL: http://llvm.org/viewvc/llvm-project?rev=220252&view=rev
Log:
Teach lit to filter the host LDFLAGS down from the build system and into
the CGO build environment. This lets things like -rpath propagate down
to the C++ code that is built along side the Go bindings when testing
them.
Patch by Peter Collingbourne, and verified that it works by me.
Modified:
llvm/trunk/cmake/modules/AddLLVM.cmake
llvm/trunk/test/Bindings/Go/go.test
llvm/trunk/test/Bindings/Go/lit.local.cfg
llvm/trunk/test/Makefile
llvm/trunk/test/lit.site.cfg.in
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=220252&r1=220251&r2=220252&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Mon Oct 20 19:36:28 2014
@@ -657,6 +657,7 @@ function(configure_lit_site_cfg input ou
set(HOST_CC "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}")
set(HOST_CXX "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}")
+ set(HOST_LDFLAGS "${CMAKE_EXE_LINKER_FLAGS}")
configure_file(${input} ${output} @ONLY)
endfunction()
Modified: llvm/trunk/test/Bindings/Go/go.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Go/go.test?rev=220252&r1=220251&r2=220252&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/Go/go.test (original)
+++ llvm/trunk/test/Bindings/Go/go.test Mon Oct 20 19:36:28 2014
@@ -2,7 +2,7 @@
; RUN: env CGO_CPPFLAGS="$(llvm-config --cppflags)" \
; RUN: CGO_CXXFLAGS=-std=c++11 \
; RUN: CGO_LDFLAGS="$(llvm-config --ldflags --libs --system-libs \
-; RUN: $(../build.sh --print-components))" \
+; RUN: $(../build.sh --print-components)) $CGO_LDFLAGS" \
; RUN: %go test -tags byollvm .
; REQUIRES: shell
Modified: llvm/trunk/test/Bindings/Go/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Go/lit.local.cfg?rev=220252&r1=220251&r2=220252&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/Go/lit.local.cfg (original)
+++ llvm/trunk/test/Bindings/Go/lit.local.cfg Mon Oct 20 19:36:28 2014
@@ -54,3 +54,4 @@ def fixup_compiler_path(compiler):
config.environment['CC'] = fixup_compiler_path(config.host_cc)
config.environment['CXX'] = fixup_compiler_path(config.host_cxx)
+config.environment['CGO_LDFLAGS'] = config.host_ldflags
Modified: llvm/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Makefile?rev=220252&r1=220251&r2=220252&view=diff
==============================================================================
--- llvm/trunk/test/Makefile (original)
+++ llvm/trunk/test/Makefile Mon Oct 20 19:36:28 2014
@@ -136,6 +136,7 @@ lit.site.cfg: FORCE
@$(ECHOPATH) s=@GO_EXECUTABLE@=$(GO)=g >> lit.tmp
@$(ECHOPATH) s!@HOST_CC@!$(CC)!g >> lit.tmp
@$(ECHOPATH) s!@HOST_CXX@!$(CXX)!g >> lit.tmp
+ @$(ECHOPATH) s!@HOST_LDFLAGS@!$(LDFLAGS)!g >> lit.tmp
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
@$(ECHOPATH) s=@ENABLE_ASSERTIONS@=$(ENABLE_ASSERTIONS)=g >> lit.tmp
@$(ECHOPATH) s=@TARGETS_TO_BUILD@=$(TARGETS_TO_BUILD)=g >> lit.tmp
Modified: llvm/trunk/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.site.cfg.in?rev=220252&r1=220251&r2=220252&view=diff
==============================================================================
--- llvm/trunk/test/lit.site.cfg.in (original)
+++ llvm/trunk/test/lit.site.cfg.in Mon Oct 20 19:36:28 2014
@@ -22,6 +22,7 @@ config.host_os = "@HOST_OS@"
config.host_arch = "@HOST_ARCH@"
config.host_cc = "@HOST_CC@"
config.host_cxx = "@HOST_CXX@"
+config.host_ldflags = "@HOST_LDFLAGS@"
config.llvm_use_intel_jitevents = "@LLVM_USE_INTEL_JITEVENTS@"
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
config.have_zlib = "@HAVE_LIBZ@"
More information about the llvm-commits
mailing list