[llvm-commits] [test-suite] r40797 - /test-suite/trunk/Makefile.programs
Reid Spencer
rspencer at reidspencer.com
Fri Aug 3 16:49:38 PDT 2007
Author: reid
Date: Fri Aug 3 18:49:37 2007
New Revision: 40797
URL: http://llvm.org/viewvc/llvm-project?rev=40797&view=rev
Log:
For PR1583:
Restore some sanity to building test programs. The output of CBE *must* be
compiled and linked with gcc not g++, even if the source program contained
exception handling. The CBE uses separation of definition and declaration for
static variables which is not permitted by C++ but is by C. Additionally, it
is very important to get the libstdc++ from llvm-gcc not the one provided by the
C compiler. When compiling .cbe.c or even .s, the -L options must be given to
GCC such that it links the llvm-gcc version of libstdc++ or else there will be
an ABI mismatch. For example, llvm-gg++ 4.0.1 exception handling is not
compatible with g++ 4.2.1 exception handling.
Modified:
test-suite/trunk/Makefile.programs
Modified: test-suite/trunk/Makefile.programs
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=40797&r1=40796&r2=40797&view=diff
==============================================================================
--- test-suite/trunk/Makefile.programs (original)
+++ test-suite/trunk/Makefile.programs Fri Aug 3 18:49:37 2007
@@ -102,21 +102,6 @@
endif
endif
-# LLVMGCCLD - This sets up the command to use for linking test programs
-# that were generated with llvm-gcc. Usually $(CC) is sufficient but,
-# depending on libstdc++ and libgcc.a usage, it may be necessary to ensure
-# that the link is done against llvm-gcc's version of those libraries. If
-# the LINK_WITH_LLVMGCC_LIBS variable is set, then the link is done that
-# way. Unfortunately, this can't help JIT because it is always linked with
-# the libraries of lli.
-ifndef LLVMGCCLD
-LLVMGCCLD := $(CC)
-endif
-ifdef LINK_WITH_LLVMGCC_LIBS
-#LLVMGCCLD := $(CC) -L$(LLVMGCCDIR)/lib/gcc/$(LLVMGCCARCH) -L$(LLVMGCCDIR)/lib/debug -L$(LLVMGCCDIR)/lib
-LLVMGCCLD := $(CC) -L$(LLVMGCCDIR)/lib/gcc/$(LLVMGCCARCH) -L$(LLVMGCCDIR)/lib
-endif
-
ifndef STDIN_FILENAME
STDIN_FILENAME := /dev/null
endif
@@ -272,7 +257,7 @@
$(PROGRAMS_TO_TEST:%=Output/%.llvm.bc): \
Output/%.llvm.bc: Output/%.linked.bc $(LLVM_LDDPROG)
- -$(LLVMLD) $(STATS) $< $(EXTRA_LINKTIME_OPT_FLAGS) -lc $(LIBS) -o Output/$*.llvm
+ -$(LLVMLD) $(STATS) $< $(EXTRA_LINKTIME_OPT_FLAGS) $(LLVMLD_FLAGS) -lc $(LIBS) -o Output/$*.llvm
ifneq ($(OPTPASSES),)
-$(LOPT) -q $(OPTPASSES) $@ -o $@.tmp -f
$(MV) -f $@.tmp $@
@@ -280,7 +265,7 @@
$(PROGRAMS_TO_TEST:%=Output/%.llvm): \
Output/%.llvm: Output/%.linked.bc $(LLVMLDPROG)
- -$(LLVMLD) $(STATS) $< -lc $(LIBS) -o Output/$*.llvm
+ -$(LLVMLD) $(STATS) $< $(LLVMLD_FLAGS) -lc $(LIBS) -o Output/$*.llvm
ifneq ($(OPTPASSES),)
-$(LOPT) -q $(OPTPASSES) $@ -o $@.tmp -f
$(MV) -f $@.tmp $@
@@ -288,20 +273,20 @@
$(PROGRAMS_TO_TEST:%=Output/%.noopt-llvm.bc): \
Output/%.noopt-llvm.bc: Output/%.linked.rbc $(LLVMLDPROG)
- -$(LLVMLD) -disable-opt $(STATS) $< -lc $(LIBS) -o Output/$*.noopt-llvm
+ -$(LLVMLD) -disable-opt $(STATS) $(LLVMLD_FLAGS) $< -lc $(LIBS) -o Output/$*.noopt-llvm
$(PROGRAMS_TO_TEST:%=Output/%.noopt-llvm): \
Output/%.noopt-llvm: Output/%.linked.rbc $(LLVMLDPROG)
- -$(LLVMLD) -disable-opt $(STATS) $< -lc $(LIBS) -o Output/$*.noopt-llvm
+ -$(LLVMLD) -disable-opt $(STATS) $(LLVMLD_FLAGS) $< -lc $(LIBS) -o Output/$*.noopt-llvm
$(PROGRAMS_TO_TEST:%=Output/%.nollvm-ldopt-llvm.bc): \
Output/%.nollvm-ldopt-llvm.bc: Output/%.linked.bc $(LLVMLDPROG)
- -$(LLVMLD) -disable-opt $(STATS) $< -lc $(LIBS) -o Output/$*.nollvm-ldopt-llvm
+ -$(LLVMLD) -disable-opt $(STATS) $(LLVMLD_FLAGS) $< -lc $(LIBS) -o Output/$*.nollvm-ldopt-llvm
$(PROGRAMS_TO_TEST:%=Output/%.nollvm-ldopt-llvm): \
Output/%.nollvm-ldopt-llvm: Output/%.linked.rbc $(LLVMLDPROG)
- -$(LLVMLD) -disable-opt $(STATS) $< -lc $(LIBS) -o Output/$*.nollvm-ldopt-llvm
+ -$(LLVMLD) -disable-opt $(STATS) $(LLVMLD_FLAGS) $< -lc $(LIBS) -o Output/$*.nollvm-ldopt-llvm
endif # ifndef DISABLE_FOR_LLVM_PROGRAMS
@@ -319,8 +304,8 @@
# If the program requires exception handling support, enable (potentially
# expensive) support for it.
ifdef REQUIRES_EH_SUPPORT
-LLCFLAGS += -enable-correct-eh-support
-LLVMGCCLD := $(CXX)
+LLCFLAGS += -enable-eh
+LLVMLD_FLAGS += -disable-inlining
endif
# Pass target specific llc flags
@@ -335,9 +320,14 @@
Output/%.cbe.c: Output/%.llvm.bc $(LLC)
-$(LLC) $(LLCFLAGS) -march=c $< -o $@ -f
+ifdef REQUIRES_EH_SUPPORT
+MORE_LDFLAGS=-L$(LLVMGCCDIR)/lib/gcc/$(LLVMGCCARCH) -L$(LLVMGCCDIR)/lib -lstdc++
+endif
+
$(PROGRAMS_TO_TEST:%=Output/%.cbe): \
Output/%.cbe: Output/%.cbe.c
- -$(LLVMGCCLD) $< $(LDFLAGS) $(CFLAGS) -fno-strict-aliasing -O2 -fno-inline $(TARGET_FLAGS) -o $@
+ -$(CC) $< -o $@ $(LDFLAGS) $(MORE_LDFLAGS) $(CFLAGS) \
+ -fno-strict-aliasing -O2 -fno-inline $(TARGET_FLAGS)
#
# Compile a linked program to machine code with LLC.
@@ -363,13 +353,13 @@
#
$(PROGRAMS_TO_TEST:%=Output/%.llc): \
Output/%.llc: Output/%.llc.s
- -$(LLVMGCCLD) $(CFLAGS) $< $(LLCLIBS) $(LLCASSEMBLERFLAGS) \
- $(TARGET_FLAGS) $(LDFLAGS) -o $@
+ -$(CC) $(CFLAGS) $< -o $@ $(LLCLIBS) $(LLCASSEMBLERFLAGS) \
+ $(TARGET_FLAGS) $(LDFLAGS) $(MORE_LDFLAGS)
$(PROGRAMS_TO_TEST:%=Output/%.llc-beta): \
Output/%.llc-beta: Output/%.llc-beta.s
- -$(LLVMGCCLD) $(CFLAGS) $< $(LLCLIBS) $(LLCASSEMBLERFLAGS) \
- $(TARGET_FLAGS) $(LDFLAGS) -o $@
+ -$(CC) $(CFLAGS) $< -o $@ $(LLCLIBS) $(LLCASSEMBLERFLAGS) \
+ $(TARGET_FLAGS) $(LDFLAGS) $(MORE_LDFLAGS)
#
@@ -387,7 +377,7 @@
# If the program requires exception handling support, enable (potentially
# expensive) support for it.
ifdef REQUIRES_EH_SUPPORT
-JIT_OPTS += -enable-correct-eh-support
+JIT_OPTS += -enable-eh
endif
native: $(PROGRAMS_TO_TEST:%=Output/%.native)
More information about the llvm-commits
mailing list