<div dir="ltr"><div><div>I have proposed a patch, thank you.<br><br>[CMake] Introduce LLVM_TARGET_TRIPLE_ENV as an option to override LLVM_DEFAULT_TARGET_TRIPLE at runtime. <br> <a href="https://reviews.llvm.org/D33662">https://reviews.llvm.org/D33662</a><br><br><div class="gmail_quote"><div dir="ltr">On Wed, May 3, 2017 at 9:26 AM NAKAMURA Takumi <<a href="mailto:geek4civic@gmail.com">geek4civic@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have been working for extending test coverage for years.<div>Nowadays, I have several cross-testing (target != host). See <a href="http://bb.pgr.jp/console" target="_blank">http://bb.pgr.jp/console</a></div><div>Each of them (test-*-linux) is doing;</div><div><br></div><div>  - Assume a preceding builder passes with warming ccache.</div><div>  - All compilation units will hit ccache whenever the tree is built before lit.</div><div>  - Almost all compilation units will hit ccache except for Host.cpp when the tree is built with different LLVM_DEFAULT_TARGET_TRIPLE.</div><div><br></div><div>FYI, I am doing a trick to let ccache recognize compilation units identical for build.ninja;</div><div><br></div><div>  $ <span style="color:blue;font-family:"courier new",courier,monotype,monospace;font-size:medium;white-space:pre-wrap">sed -i -r 's=(-I|_COMPILER\S* )/home/bb/\w[^/]*/llvm-project=\1../llvm-project=g' build.ninja</span></div><div><br></div><div><div>In other words, testing builders have almost same build except for Host.cpp.</div><div>I have to build the tree for each testing target.</div><div><br></div><div>I propose an option to override LLVM_DEFAULT_TARGET_TRIPLE in run-time.</div></div><div>The change will be small but I wonder which option I could take.</div><div>Please let me know your suggestions.</div><div><br></div><div>* Should it be configurable option?</div><div><br></div><div>I think it shouldn't be required for release binaries, and it wouldn't be required for most developers.</div><div>I think it may be off by default.</div><div><br></div><div>* What is the name of environment variable?</div><div><br></div><div>I suggest the name itself could be configurable.</div><div>If I would introduce the envvar name as "LLVM_TARGET", clang users would complain why clang didn't have like "CLANG_TARGET".</div><div><br></div><div>  $ cmake -DLLVM_DEFAULT_TARGET_ENVVAR_NAME=LLVM_TARGET</div><div>  $ LLVM_TARGET=i686-win32 bin/llvm-lit path/to/tests</div><div><br></div><div>This feature may be disabled if LLVM_DEFAULT_TARGET_ENVVAR_NAME is blank.</div><div>I wonder the name LLVM_DEFAULT_TARGET_ENVVAR_NAME<span class="m_-1257001033156061372m_-8779104378606884352inbox-inbox-Apple-converted-space"> might be weird.</span></div><div>Better suggestions are welcome.</div><div><br></div><div>As a future plan, I will implement, in Lit, run tests with the matrix of triples,</div><div>like {arm|mips|i686|x86_64}-{darwin|linux|win32}.</div><div>Some of tests should be skipped if it isn't affected to default target triple.</div><div>For example, FileCheck </div><div><br></div><div>Regards, Takumi</div></div></blockquote></div></div></div></div>