<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">This change is broken and wrong.<div class=""><br class=""></div><div class="">As a result of this change I see CMAKE_C_FLAGS getting included multiple times in the compiler command lines. When I configure with -DCMAKE_C_FLAGS="-target amd64-unknown-freebsd10.0” I see:</div><div class=""><br class=""></div><div class=""><div class="">build CMakeFiles/clang_rt.builtins-x86_64.dir/x86_64/floatdidf.c.o: C_COMPILER__clang_rt.2ebuiltins-x86_64 /Users/cbieneman/dev/open-source/compiler-rt/lib/builtins/x86_64/floatdidf.c</div><div class="">[…]</div><div class="">  FLAGS = -target amd64-unknown-freebsd10.0    -m64  -std=gnu99 -target amd64-unknown-freebsd10.0</div><div class="">[…]</div></div><div class=""><br class=""></div><div class="">You’ll not the double occurrence of the -target flag. This is because, as I said in my pre-commit review (<a href="https://reviews.llvm.org/D22415" class="">https://reviews.llvm.org/D22415</a>), CMAKE_C_FLAGS is *automatically* added to the compile line for C source files when CMake’s `add_library` function is called.</div><div class=""><br class=""></div><div class="">My guess as to what might be causing your problem is that CMAKE_C_FLAGS *isn’t* added to assembly files, because they are not C sources. So, you probably need to also set CMAKE_ASM_FLAGS to include whatever options you need there.</div><div class=""><br class=""></div><div class="">I’m going to revert this patch, please let me know if you need help diagnosing the actual problems you’re encountering.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">-Chris</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 21, 2016, at 2:05 PM, Francis Ricci via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Author: fjricci<br class="">Date: Thu Jul 21 16:05:14 2016<br class="">New Revision: 276333<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=276333&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=276333&view=rev</a><br class="">Log:<br class="">Enable cross-compilation across architectures on android<br class=""><br class="">Summary:<br class="">This patch fixes cross-architecture compilation,<br class="">by allowing flags like -target and --sysroot to be set for<br class="">architecture testing and compilation.<br class=""><br class="">Reviewers: tberghammer, srhines, danalbert, beanz, compnerd<br class=""><br class="">Subscribers: tberghammer, llvm-commits, danalbert<br class=""><br class="">Differential Revision: <a href="https://reviews.llvm.org/D22415" class="">https://reviews.llvm.org/D22415</a><br class=""><br class="">Modified:<br class="">    compiler-rt/trunk/lib/builtins/CMakeLists.txt<br class=""><br class="">Modified: compiler-rt/trunk/lib/builtins/CMakeLists.txt<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/CMakeLists.txt?rev=276333&r1=276332&r2=276333&view=diff" class="">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/CMakeLists.txt?rev=276333&r1=276332&r2=276333&view=diff</a><br class="">==============================================================================<br class="">--- compiler-rt/trunk/lib/builtins/CMakeLists.txt (original)<br class="">+++ compiler-rt/trunk/lib/builtins/CMakeLists.txt Thu Jul 21 16:05:14 2016<br class="">@@ -413,7 +413,7 @@ else ()<br class="">                               STATIC<br class="">                               ARCHS ${arch}<br class="">                               SOURCES ${${arch}_SOURCES}<br class="">-                              CFLAGS ${maybe_stdc99}<br class="">+                              CFLAGS ${maybe_stdc99} ${CMAKE_C_FLAGS}<br class="">                               PARENT_TARGET builtins)<br class="">     endif ()<br class="">   endforeach ()<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></div></div></blockquote></div><br class=""></div></body></html>