[llvm] r197382 - llvm-config: Fixup r197380, tweak for cross compilation. SYSTEM_LIBS should be --host's in BuildTools/llvm-config.
NAKAMURA Takumi
geek4civic at gmail.com
Mon Dec 16 05:09:07 PST 2013
Author: chapuni
Date: Mon Dec 16 07:09:06 2013
New Revision: 197382
URL: http://llvm.org/viewvc/llvm-project?rev=197382&view=rev
Log:
llvm-config: Fixup r197380, tweak for cross compilation. SYSTEM_LIBS should be --host's in BuildTools/llvm-config.
FIXME: Host's llvm-config is not generated. It's for target's.
Host tools, aka "BuildTools", in utils, do not require llvm-config to build.
For example with --host=i686-pc-mingw32 --build=linux,
$ BuildTools/Release+Asserts/bin/llvm-config --libs support
-lLLVMSupport
-lpthread -lshell32 -lpsapi -limagehlp -lm
Modified:
llvm/trunk/Makefile
llvm/trunk/tools/llvm-config/Makefile
Modified: llvm/trunk/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile?rev=197382&r1=197381&r2=197382&view=diff
==============================================================================
--- llvm/trunk/Makefile (original)
+++ llvm/trunk/Makefile Mon Dec 16 07:09:06 2013
@@ -126,6 +126,7 @@ cross-compile-build-tools:
SDKROOT= \
TARGET_NATIVE_ARCH="$(TARGET_NATIVE_ARCH)" \
TARGETS_TO_BUILD="$(TARGETS_TO_BUILD)" \
+ TARGET_LIBS="$(LIBS)" \
ENABLE_OPTIMIZED=$(ENABLE_OPTIMIZED) \
ENABLE_PROFILING=$(ENABLE_PROFILING) \
ENABLE_COVERAGE=$(ENABLE_COVERAGE) \
Modified: llvm/trunk/tools/llvm-config/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/Makefile?rev=197382&r1=197381&r2=197382&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-config/Makefile (original)
+++ llvm/trunk/tools/llvm-config/Makefile Mon Dec 16 07:09:06 2013
@@ -30,6 +30,14 @@ SUB_CPPFLAGS := ${CPP.BaseFlags}
SUB_CFLAGS := ${CPP.BaseFlags} ${C.Flags}
SUB_CXXFLAGS := ${CPP.BaseFlags} ${CXX.Flags}
+# Override LIBS with TARGET's LIBS for cross compilation.
+# FIXME: Host's llvm-config is not generated. It's for target's.
+ifneq ($(TARGET_LIBS), )
+ LLVM_SYSTEM_LIBS := $(TARGET_LIBS)
+else
+ LLVM_SYSTEM_LIBS := $(LIBS)
+endif
+
# This is blank for now. We need to be careful about adding stuff here:
# LDFLAGS tend not to be portable, and we don't currently require the
# user to use libtool when linking against LLVM.
@@ -51,7 +59,7 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVAR
>> temp.sed
$(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \
>> temp.sed
- $(Verb) $(ECHO) 's/@LLVM_SYSTEM_LIBS@/$(subst /,\/,$(LIBS))/' \
+ $(Verb) $(ECHO) 's/@LLVM_SYSTEM_LIBS@/$(subst /,\/,$(LLVM_SYSTEM_LIBS))/' \
>> temp.sed
$(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
>> temp.sed
More information about the llvm-commits
mailing list