[PATCH,RFC] Re: [test-suite] / [LNT] debugging the handling of -maltivec in SingleSource/UnitTests/Vector/Altivec/Makefile

Will Schmidt will_schmidt at vnet.ibm.com
Thu Feb 7 13:45:34 PST 2013


On Thu, 2013-02-07 at 11:42 -0800, Daniel Dunbar wrote:


> Actually, this variable definition should probably just get lifted to
> Makefile.programs, and then removed from all the other places.

After looking at the Makefile include hierarchy, the X_TARGET_FLAGS
definition in Makefile.tests does get included by Makefile.programs,
which is in turn is included by both Makefile.{singlesrc,multisrc}.
So.. that part can be dropped entirely.  :-)

OK to commit?

Thanks, 
-Will

Update Makefile.{singlesrc,multisrc} to use X_TARGET_FLAGS

The LNT test harness handles TARGET_FLAGS specially, and prevents other
users of the variable from functioning as intended, i.e.   "TARGET_FLAGS
+= -maltivec" does not work as intended.
X_TARGET_FLAGS exists to work around this, but was not utilized in
Makefile.{singlesrc,multisrc}.   Update those makefiles to use
X_TARGET_FLAGS, and update Altivec/Makefile appropriately.


Index: MultiSource/Makefile.multisrc
===================================================================
--- MultiSource/Makefile.multisrc	(revision 174514)
+++ MultiSource/Makefile.multisrc	(working copy)
@@ -31,35 +31,35 @@
 .PRECIOUS: $(LObjects) $(NObjects) $(NLObjects)
 
 Output/%.o: %.c Output/.dir
-	-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 
 Output/%.o: %.C Output/.dir
-	-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 
 Output/%.o: %.cpp Output/.dir
-	-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 
 Output/%.o: %.cc Output/.dir
-	-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 
 Output/%.llvm.o: %.c Output/.dir
 	$(RUNSAFELYLOCAL) /dev/null $@.compile \
-	  $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	  $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 Output/%.llvm.o: %.m Output/.dir
 	$(RUNSAFELYLOCAL) /dev/null $@.compile \
-	  $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	  $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 Output/%.llvm.o: %.C Output/.dir
 	$(RUNSAFELYLOCAL) /dev/null $@.compile \
-	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 Output/%.llvm.o: %.cpp Output/.dir
 	$(RUNSAFELYLOCAL) /dev/null $@.compile \
-	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 Output/%.llvm.o: %.cc Output/.dir
 	$(RUNSAFELYLOCAL) /dev/null $@.compile \
-	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 Output/%.llvm.o: %.mm Output/.dir
 	$(RUNSAFELYLOCAL) /dev/null $@.compile \
-	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 
 bugpoint-opt: Output/$(PROG).bugpoint-opt
 bugpoint-gccas: Output/$(PROG).bugpoint-opt
@@ -89,10 +89,10 @@
 /^user/ { user += $$2; }\
 /^sys/ { sys += $$2; }\
 END { printf("real %f\nuser %f\nsys %f\n", real, user, sys); }' > $@.compile.time
-	-$(LD_ENV_OVERRIDES) $(LCXX) -o $@ $(NLObjects) $(LDFLAGS) $(CFLAGS) $(TARGET_FLAGS)
+	-$(LD_ENV_OVERRIDES) $(LCXX) -o $@ $(NLObjects) $(LDFLAGS) $(CFLAGS) $(X_TARGET_FLAGS)
 
 Output/%.native: $(NObjects) $(GeneratedTestInputs)
-	-$(CXX) -o $@ $(NObjects) $(LDFLAGS) $(CFLAGS) $(TARGET_FLAGS)
+	-$(CXX) -o $@ $(NObjects) $(LDFLAGS) $(CFLAGS) $(X_TARGET_FLAGS)
 
 # A simple target to run findmisopt when bugpoint isn't helping
 findmisopt:
Index: SingleSource/UnitTests/Vector/Altivec/Makefile
===================================================================
--- SingleSource/UnitTests/Vector/Altivec/Makefile	(revision 174514)
+++ SingleSource/UnitTests/Vector/Altivec/Makefile	(working copy)
@@ -9,6 +9,8 @@
 FP_TOLERANCE := 0.002
 
 TARGET_FLAGS += -maltivec
+# setting TEST_TARGET_FLAGS is needed within the LNT environment.
+TEST_TARGET_FLAGS += -maltivec
 LCCFLAGS += -maltivec
 
 include $(LEVEL)/SingleSource/Makefile.singlesrc
Index: SingleSource/Makefile.singlesrc
===================================================================
--- SingleSource/Makefile.singlesrc	(revision 174514)
+++ SingleSource/Makefile.singlesrc	(working copy)
@@ -57,88 +57,88 @@
 
 Output/%.llvm.o: %.c Output/.dir
 	$(RUNSAFELYLOCAL) /dev/null $@.compile \
-	  $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	  $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 Output/%.llvm.o: %.m Output/.dir
 	$(RUNSAFELYLOCAL) /dev/null $@.compile \
-	  $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	  $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 Output/%.llvm.o: %.C Output/.dir
 	$(RUNSAFELYLOCAL) /dev/null $@.compile \
-	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 Output/%.llvm.o: %.cpp Output/.dir
 	$(RUNSAFELYLOCAL) /dev/null $@.compile \
-	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 Output/%.llvm.o: %.cc Output/.dir
 	$(RUNSAFELYLOCAL) /dev/null $@.compile \
-	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 Output/%.llvm.o: %.mm Output/.dir
 	$(RUNSAFELYLOCAL) /dev/null $@.compile \
-	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+	  $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
 .PRECIOUS: Output/%.llvm.o
 
 Output/%.simple: Output/%.llvm.o Output/.dir
 	-$(CP) $<.compile.time $@.compile.time
-	-$(LD_ENV_OVERRIDES) $(LCXX) -o $@ $< $(LDFLAGS) $(CFLAGS) $(TARGET_FLAGS)
+	-$(LD_ENV_OVERRIDES) $(LCXX) -o $@ $< $(LDFLAGS) $(CFLAGS) $(X_TARGET_FLAGS)
 
 # FIXME: LIBS should be specified, not hardcoded to -lm
 Output/%.native: $(SourceDir)/%.c Output/.dir
-	-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.native: $(SourceDir)/%.cpp Output/.dir
-	-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.native: $(SourceDir)/%.m Output/.dir
-	-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.native: $(SourceDir)/%.mm Output/.dir
-	-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.native.dbg: $(SourceDir)/%.c Output/.dir
-	-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.native.dbg: $(SourceDir)/%.cpp Output/.dir
-	-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.native.dbg: $(SourceDir)/%.m Output/.dir
-	-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.native.dbg: $(SourceDir)/%.mm Output/.dir
-	-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.native.dbg.opt: $(SourceDir)/%.c Output/.dir
-	-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.native.dbg.opt: $(SourceDir)/%.cpp Output/.dir
-	-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.native.dbg.opt: $(SourceDir)/%.m Output/.dir
-	-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.native.dbg.opt: $(SourceDir)/%.mm Output/.dir
-	-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.dbg: $(SourceDir)/%.c Output/.dir
-	-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.dbg: $(SourceDir)/%.cpp Output/.dir
-	-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.dbg: $(SourceDir)/%.m Output/.dir
-	-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.dbg: $(SourceDir)/%.mm Output/.dir
-	-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.dbg.opt: $(SourceDir)/%.c Output/.dir
-	-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.dbg.opt: $(SourceDir)/%.cpp Output/.dir
-	-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.dbg.opt: $(SourceDir)/%.m Output/.dir
-	-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 Output/%.dbg.opt: $(SourceDir)/%.mm Output/.dir
-	-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+	-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
 bugpoint-gccas bugpoint-opt bugpoint-jit bugpoint-llc bugpoint-llc-beta:
 	@echo "The $@ target doesn't work in SingleSource.  Try:"




-------------- next part --------------
A non-text attachment was scrubbed...
Name: use_x_target_flags_in_unittest_makefiles.feb7.2013.diff
Type: text/x-patch
Size: 10016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130207/1720a60f/attachment.bin>


More information about the llvm-commits mailing list