<div dir="ltr">Hi Will,<div><br></div><div>The reason TARGET_FLAGS doesn't stick is because LNT sets it specifically on the make command line (and that overrides other uses).</div><div><br></div><div style>Interestingly, Makefile.tests (at the top-level) actually introduces an X_TARGET_FLAGS to work around this, but it doesn't look like the MultiSource or SingleSource makefiles do the same thing. The right fix is probably to do the same thing Makefile.tests is doing in each of those places.</div>
<div><br></div><div style> - Daniel<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 6, 2013 at 12:53 PM, Will Schmidt <span dir="ltr"><<a href="mailto:will_schmidt@vnet.ibm.com" target="_blank">will_schmidt@vnet.ibm.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
 I've been poking at the clang buildbots for powerpc64, specifically<br>
trying to work out why the -maltivec flag does not get passed to the<br>
compile steps in the Makefile within the LNT build environment.<br>
Specifically this line:<br>
  $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@<br>
in<br>
 SingleSource/Makefile.singlesrc<br>
<br>
Per some debug, it appears that the setting of TARGET_FLAGS in<br>
SingleSource/UnitTests/Vector/Altivec/Makefile does *not* stick. i.e.<br>
the Makefile currently contains:<br>
<br>
        FP_TOLERANCE := 0.002<br>
        TARGET_FLAGS += -maltivec<br>
        LCCFLAGS += -maltivec<br>
<br>
and added debug to Makefile like so:<br>
+       CFLAGS += -maltivec<br>
+       $(warning "TARGET_FLAGS is ${TARGET_FLAGS}")<br>
+       $(warning "LCCFLAGS is ${LCCFLAGS}")<br>
+       $(warning "FP_TOLERANCE is ${FP_TOLERANCE}")<br>
+       $(warning "CFLAGS is ${CFLAGS}")<br>
<br>
and to Makefile.singlesrc like so:<br>
+       $(warning TARGET_FLAGS=${TARGET_FLAGS} LCCFLAGS=${LCCFLAGS} LDFLAGS=${LDFLAGS} CFLAGS=${CFLAGS} ) \<br>
<br>
<br>
provides output like so:<br>
        Makefile:16: "TARGET_FLAGS is "<br>
        Makefile:17: "LCCFLAGS is -maltivec"<br>
        Makefile:18: "FP_TOLERANCE is 0.002"<br>
        Makefile:19: "CFLAGS is -maltivec"<br>
and:<br>
        ../../../../SingleSource/Makefile.singlesrc:59: TARGET_FLAGS= LCCFLAGS=-maltivec LDFLAGS= CFLAGS=-maltivec<br>
<br>
So TARGET_FLAGS is blank, and the intended value does not get to the<br>
build rule.   LCCFLAGS does contain the flag, but is not actually used<br>
as part of the build rule.<br>
<br>
I do see what looks like special handling of TARGET_FLAGS in<br>
lnt/tests/nt.py.  A few additional experiments in adding TARGET_FLAG and<br>
TARGET_FLAGS2 variables confirms that TARGET_FLAGS is indeed specially<br>
handled by the lnt.py code.  I don't fully grok the reasoning or intent<br>
behind that behavior, but suspect it's not working quite as intended.<br>
<br>
So two quick options are<br>
 - add "CFLAGS += -maltivec" line to S/U/V/A/Makefile<br>
or<br>
 - add $(LCCFLAGS) to the rules in SingleSource/Makefile.singlesrc .<br>
<br>
Thoughts?<br>
<br>
Thanks,<br>
-Will<br>
<br>
<br>
<br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>