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

Bill Schmidt wschmidt at linux.vnet.ibm.com
Wed Feb 6 13:10:16 PST 2013


On Wed, 2013-02-06 at 14:53 -0600, Will Schmidt 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? 

Since either of these should be a temporary solution, I'd rather see the
first one since it's more localized.  We need to understand why nt.py is
messing around with TARGET_FLAGS and what's going wrong there.

My two cents,

Bill

> 
> Thanks, 
> -Will
> 
> 
> 
> 




More information about the llvm-commits mailing list