Community
Participate
Working Groups
For any package, say hello, a "top-level" build that uses XDCTARGETS with trailing white space results in XDCTARGETS being defined with the definition of another environment variable appended to the end(!). For example: % xdc XDCTARGETS="native" .debug -P hello/ | grep XDCTARGETS XDCTARGETS = native But: % xdc XDCTARGETS="native " .debug -P hello/ | grep XDCTAR XDCTARGETS = native XDCPATH=^/../hijacks;^/../imports This appears to be a GNU make bug in it's handling of MAKEFLAGS. Using an environment variable instead of a make flag does not have the same problem: % setenv XDCTARGETS native % xdc .debug -P hello/ | grep XDCTAR XDCTARGETS = native % setenv XDCTARGETS "native " % xdc .debug -P hello/ | grep XDCTAR XDCTARGETS = native
The root cause of the problem is the redefinition of MAKEOVERRIDES in xdc_top.mak: MAKEOVERRIDES := $(patsubst XDCBUILDCFG=%,XDCBUILDCFG=$(subst $(space),\$(space ),$(XDCBUILDCFG)),$(MAKEOVERRIDES)) Prior to this statement MAKEOVERRIDES contains: XDCTARGETS=native\ XDCPATH=^/../hijacks;^/../imports Notice the _two_ spaces after the backslash. After the redefinition above, MAKEOVERRIDES contains: XDCTARGETS=native\ XDCPATH=^/../hijacks;^/../imports The $(patsubst) function removed one of the spaces after the \, effectively concatenating the next variable, XDCPATH, with the definition of XDCTARGETS.
fixed in r1276 (xdc-w23) destined for 3.21 The root cause can result in improper settings being passed to sub-makes whenever _any_ make flag (with trailing white space) is passed on the command line. After a review of the fix, this should also be "back ported" to 3.20.x
Verified the bug on one of many different variants of the problem. Depending on where on the command line an additional space is added, the build is affected differently. With 3.21.00.30 and the following command line, XDCBUILDCFG is not set correctly: > $XDCTOOLS/xdctools_3_21_00_30_eng/Linux/xdc XDCBUILDCFG=$ZS/config.bld XDCTARGETS="native " -PR . making all: Thu Feb 24 15:38:06 PST 2011 ... ======== .interfaces [.] ======== making package.mak (because of .xdcenv.mak) ... Warning: no config.bld file was found along the package path. The config.bld file specifies the location of the compiler tool-chains required to compile runtime content. Without this file, the XDC tools assume no targets are to be used. With 3.21.00.40, the right XDCBUILDCFG is found and the code is built for the target "native". There is still warning because the string "native " is split into "native" and "", and the second one is treated as an additional targets, but that's a different bug. > $XDCTOOLS/xdctools_3_21_00_40_eng/Linux/xdc XDCBUILDCFG=$ZS/config.bld XDCTARGETS="native " -PR . making all: Thu Feb 24 15:38:39 PST 2011 ... ======== .interfaces [.] ======== making package.mak (because of .xdcenv.mak) ... Warning: Target specification '' does not match any loaded target module. Valid Build Targets: gnu.targets.Linux86
Shipped in XDCtools 3.21.
Shipped in XDCtools 3.21