<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Dec 12, 2017 at 2:04 PM, Justin Bogner <span dir="ltr"><<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">Alex Bradbury <<a href="mailto:asb@lowrisc.org">asb@lowrisc.org</a>> writes:<br>
> On 12 December 2017 at 13:32, Don Hinton via llvm-commits<br>
> <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
>> Yes, for this to work, we'd need to pass LLVM_EXPERIMENTAL_TARGETS_TO_<wbr>BUILD<br>
>> as well.<br>
>><br>
>> However, since Native is the only target actually used, I'd lean toward<br>
>> reverting this change and perhaps adding a comment.<br>
<br>
</span>This isn't true, Native is not used (in fact, most of my builds don't<br>
have it or the equivalent, which is part of why I made this change). It<br>
would make just as much sense to pass in an empty target list.<br></blockquote><div><br></div><div>"Native" is never used literally, it's just a wildcard placeholder.</div><div><br></div><div><div>string(REPLACE "Native" ${LLVM_NATIVE_ARCH}</div><div>  LLVM_TARGETS_TO_BUILD "${LLVM_TARGETS_TO_BUILD}")</div><div>list(REMOVE_DUPLICATES LLVM_TARGETS_TO_BUILD)</div></div><div><br></div><div>With LLVM_NATIVE_ARCH set in config-ix.cmake.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
>><br>
>> hth...<br>
>> don<br>
><br>
> Many thanks Don. I hadn't spotted that experimental targets are<br>
> tolerated in LLVM_TARGETS_TO_BUILD if they're listed in<br>
> LLVM_EXPERIMENTAL_TARGETS_TO_<wbr>BUILD.<br>
><br>
> Justin: which resolution would you prefer? Passing through an escaped<br>
> LLVM_EXPERIMENTAL_TARGETS_TO_<wbr>BUILD does fix the build for me. So does<br>
> reverting of course :)<br>
<br>
</span>The way EXPERIMENTAL_TARGETS_TO_BUILD works is kind of insane. It really<br>
doesn't make sense that saying TARGETS_TO_BUILD=RISCV doesn't just<br>
work. I think the correct medium/long term solution is to rework<br>
experimental targets so you can add them to the regular targets list,<br>
but they just aren't included as part of the default "All". Maybe also<br>
allow things like "All;RISCV", "Experimental", and "All;Experimental".<br>
<br>
Of course, I'm not sure if you or I have the bandwidth to take on fixing<br>
that right now, so the below seems fine as a short term solution. It<br>
certainly can't hurt anything. Feel free to commit that.</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
> diff --git a/cmake/modules/CrossCompile.<wbr>cmake b/cmake/modules/CrossCompile.<wbr>cmake<br>
> index 117eda7..0ec76ea 100644<br>
> --- a/cmake/modules/CrossCompile.<wbr>cmake<br>
> +++ b/cmake/modules/CrossCompile.<wbr>cmake<br>
> @@ -40,12 +40,15 @@ function(llvm_create_cross_<wbr>target_internal<br>
> target_name toolchain buildtype)<br>
>    # them to spaces.<br>
>    string(REPLACE ";" "$<SEMICOLON>" targets_to_build_arg<br>
>           "${LLVM_TARGETS_TO_BUILD}")<br>
> +  string(REPLACE ";" "$<SEMICOLON>" experimental_targets_to_build_<wbr>arg<br>
> +         "${LLVM_EXPERIMENTAL_TARGETS_<wbr>TO_BUILD}")<br>
><br>
>    add_custom_command(OUTPUT ${LLVM_${target_name}_BUILD}/<wbr>CMakeCache.txt<br>
>      COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"<br>
>          ${CROSS_TOOLCHAIN_FLAGS_${<wbr>target_name}} ${CMAKE_SOURCE_DIR}<br>
>          -DLLVM_TARGET_IS_CROSSCOMPILE_<wbr>HOST=TRUE<br>
>          -DLLVM_TARGETS_TO_BUILD="${<wbr>targets_to_build_arg}"<br>
> +        -DLLVM_EXPERIMENTAL_TARGETS_<wbr>TO_BUILD="${experimental_<wbr>targets_to_build_arg}"<br>
>          ${build_type_flags} ${linker_flag} ${external_clang_dir}<br>
>      WORKING_DIRECTORY ${LLVM_${target_name}_BUILD}<br>
>      DEPENDS CREATE_LLVM_${target_name}<br>
><br>
><br>
> Best,<br>
><br>
> Alex<br>
</div></div></blockquote></div><br></div></div>