<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 11, 2010, at 3:50 PM, Jakob Stoklund Olesen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Weird issue beyond my make-fu:<br><br>When running the test-suite, this works fine:<br><br>make TARGET_LLCFLAGS='-mcpu=cortex-a8 -mattr=+thumb2' TEST=nightly report<br><br>But this fails:<br><br>export TARGET_LLCFLAGS='-mcpu=cortex-a8 -mattr=+thumb2'<br>make TEST=nightly report<br></div></blockquote></div><div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font>It looks like the following line from Makefile.rules is executed multiple times:<br><br>TARGET_LLCFLAGS += -relocation-model=pic -disable-fp-elim<br><br>This causes llc to complain about the -relocation-model and -disable-fp-elim options being given multiple times. (Sometime they are repeated three or four times).<br><br>Clearly there is some make magic I don't understand here. Does anyone know what is going on?</div></blockquote><br></div><div>The variables set on the command-line to make are passed along to recursive makes via $(MAKEFLAGS).  If you set TARGET_LLCFLAGS on the command-line, every recursive invocation is going to get that same value and will add "-relocation-model=pic -disable-fp-elim" only once.  But, if you don't set it on the command-line, make will pick up the value from the environment and add those extra options to whatever it finds.  I bet it is then updating the environment value, so that a child make process will see the value that already has the extra options.  If that child make also includes Makefile.rules, it will then add another copy of the extra options.  Each level of recursive make will keep adding another copy.  (The way that make interacts with the environment is confusing, so I'm not 100% sure this is what's happening but it matches the symptoms you are seeing.)</div></body></html>