[test-suite] / [LNT] debugging the handling of -maltivec in SingleSource/UnitTests/Vector/Altivec/Makefile

Daniel Dunbar daniel at zuster.org
Wed Feb 6 18:02:40 PST 2013


Hi Will,

The reason TARGET_FLAGS doesn't stick is because LNT sets it specifically
on the make command line (and that overrides other uses).

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.

 - Daniel


On Wed, Feb 6, 2013 at 12:53 PM, Will Schmidt <will_schmidt at vnet.ibm.com>wrote:

> Hi all,
>  I've been poking at the clang buildbots for powerpc64, specifically
> trying to work out why the -maltivec flag does not get passed to the
> compile steps in the Makefile within the LNT build environment.
> Specifically this line:
>   $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
> in
>  SingleSource/Makefile.singlesrc
>
> Per some debug, it appears that the setting of TARGET_FLAGS in
> SingleSource/UnitTests/Vector/Altivec/Makefile does *not* stick. i.e.
> the Makefile currently contains:
>
>         FP_TOLERANCE := 0.002
>         TARGET_FLAGS += -maltivec
>         LCCFLAGS += -maltivec
>
> and added debug to Makefile like so:
> +       CFLAGS += -maltivec
> +       $(warning "TARGET_FLAGS is ${TARGET_FLAGS}")
> +       $(warning "LCCFLAGS is ${LCCFLAGS}")
> +       $(warning "FP_TOLERANCE is ${FP_TOLERANCE}")
> +       $(warning "CFLAGS is ${CFLAGS}")
>
> and to Makefile.singlesrc like so:
> +       $(warning TARGET_FLAGS=${TARGET_FLAGS} LCCFLAGS=${LCCFLAGS}
> LDFLAGS=${LDFLAGS} CFLAGS=${CFLAGS} ) \
>
>
> provides output like so:
>         Makefile:16: "TARGET_FLAGS is "
>         Makefile:17: "LCCFLAGS is -maltivec"
>         Makefile:18: "FP_TOLERANCE is 0.002"
>         Makefile:19: "CFLAGS is -maltivec"
> and:
>         ../../../../SingleSource/Makefile.singlesrc:59: TARGET_FLAGS=
> LCCFLAGS=-maltivec LDFLAGS= CFLAGS=-maltivec
>
> So TARGET_FLAGS is blank, and the intended value does not get to the
> build rule.   LCCFLAGS does contain the flag, but is not actually used
> as part of the build rule.
>
> I do see what looks like special handling of TARGET_FLAGS in
> lnt/tests/nt.py.  A few additional experiments in adding TARGET_FLAG and
> TARGET_FLAGS2 variables confirms that TARGET_FLAGS is indeed specially
> handled by the lnt.py code.  I don't fully grok the reasoning or intent
> behind that behavior, but suspect it's not working quite as intended.
>
> So two quick options are
>  - add "CFLAGS += -maltivec" line to S/U/V/A/Makefile
> or
>  - add $(LCCFLAGS) to the rules in SingleSource/Makefile.singlesrc .
>
> Thoughts?
>
> Thanks,
> -Will
>
>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130206/d4be4f91/attachment.html>


More information about the llvm-commits mailing list