<div dir="ltr">Oh, I had been looking at the cmake files. You're right, that should be guarded by something. Is `if clang` going to be enough?</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 20, 2015 at 2:26 PM, Eric Fiselier <span dir="ltr"><<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> The -target flag only gets appended if you've passed in `-DLIBCXX_TARGET_TRIPLE=foo`. If you don't it won't be used.<br>
<br>
</span>Perhaps this got messed up, but as it stands now '-target' is always<br>
added on lit.cfg:282 even when LIBCXX_TARGET_TRIPLE is not set in<br>
CMake.<br>
<span class="HOEnZb"><font color="#888888"><br>
/Eric<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Tue, Jan 20, 2015 at 1:44 PM, Dan Albert <<a href="mailto:danalbert@google.com">danalbert@google.com</a>> wrote:<br>
> The -target flag only gets appended if you've passed in<br>
> `-DLIBCXX_TARGET_TRIPLE=foo`. If you don't it won't be used.<br>
><br>
> If you're seeing issues, the problem is likely that LIBCXX_TARGET_TRIPLE is<br>
> still set from a previous cmake run. That used to be set automatically (and<br>
> incorrectly), and old values will still be cached. AFAIK there isn't a good<br>
> rule by which to clear an old cached value (some people will want it to stay<br>
> as the old manually configured value, whereas others want to clear the<br>
> default value), so it requires manual intervention.<br>
><br>
> On Tue, Jan 20, 2015 at 8:07 AM, Eric Fiselier <<a href="mailto:eric@efcs.ca">eric@efcs.ca</a>> wrote:<br>
>><br>
>> Hey Dan,<br>
>><br>
>> the -target flag isn't supported with GCC so we can't test against<br>
>> GCC. Also we do some weird transformations to the target_triple value.<br>
>> Could we be more selective as to when we use the -target flag?<br>
>><br>
>> /Eric<br>
>><br>
>> On Thu, Jan 15, 2015 at 10:21 PM, Pete Cooper <<a href="mailto:peter_cooper@apple.com">peter_cooper@apple.com</a>><br>
>> wrote:<br>
>> > Great! Thanks for the quick response and fix.<br>
>> ><br>
>> > I'll keep an eye on the bot.<br>
>> ><br>
>> > Thanks<br>
>> > Pete<br>
>> ><br>
>> > Sent from my iPhone<br>
>> ><br>
>> > On Jan 15, 2015, at 6:29 PM, Dan Albert <<a href="mailto:danalbert@google.com">danalbert@google.com</a>> wrote:<br>
>> ><br>
>> > I removed the dead code with r226243, which should solve the issue. I<br>
>> > don't<br>
>> > actually have a Darwin machine to test on, but this still behaves as<br>
>> > expected for Linux.<br>
>> ><br>
>> > On Thu, Jan 15, 2015 at 6:19 PM, Dan Albert <<a href="mailto:danalbert@google.com">danalbert@google.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> Was just asking about this on IRC. I think I can actually just remove<br>
>> >> the<br>
>> >> offending cmake code though, it doesn't appear to actually do anything.<br>
>> >><br>
>> >> On Thu, Jan 15, 2015 at 6:13 PM, Pete Cooper <<a href="mailto:peter_cooper@apple.com">peter_cooper@apple.com</a>><br>
>> >> wrote:<br>
>> >>><br>
>> >>> Hi Dan<br>
>> >>><br>
>> >>> I think this commit broke the buildbot.  I can’t see any others in the<br>
>> >>> blame list that look likely.<br>
>> >>><br>
>> >>> Can you please take a look?<br>
>> >>><br>
>> >>><br>
>> >>><br>
>> >>> <a href="http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA_build/807/console" target="_blank">http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA_build/807/console</a><br>
>> >>><br>
>> >>> Thanks,<br>
>> >>> Pete<br>
>> >>> > On Jan 15, 2015, at 4:55 PM, Dan Albert <<a href="mailto:danalbert@google.com">danalbert@google.com</a>><br>
>> >>> > wrote:<br>
>> >>> ><br>
>> >>> > Author: danalbert<br>
>> >>> > Date: Thu Jan 15 18:55:15 2015<br>
>> >>> > New Revision: 226237<br>
>> >>> ><br>
>> >>> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=226237&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=226237&view=rev</a><br>
>> >>> > Log:<br>
>> >>> > [libc++] Add support for cross compiling.<br>
>> >>> ><br>
>> >>> > Reviewers: EricWF, jroelofs<br>
>> >>> ><br>
>> >>> > Reviewed By: jroelofs<br>
>> >>> ><br>
>> >>> > Subscribers: cfe-commits<br>
>> >>> ><br>
>> >>> > Differential Revision: <a href="http://reviews.llvm.org/D6990" target="_blank">http://reviews.llvm.org/D6990</a><br>
>> >>> ><br>
>> >>> > Modified:<br>
>> >>> >    libcxx/trunk/CMakeLists.txt<br>
>> >>> >    libcxx/trunk/test/libcxx/test/config.py<br>
>> >>> >    libcxx/trunk/test/<a href="http://lit.site.cfg.in" target="_blank">lit.site.cfg.in</a><br>
>> >>> ><br>
>> >>> > Modified: libcxx/trunk/CMakeLists.txt<br>
>> >>> > URL:<br>
>> >>> ><br>
>> >>> > <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=226237&r1=226236&r2=226237&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=226237&r1=226236&r2=226237&view=diff</a><br>
>> >>> ><br>
>> >>> ><br>
>> >>> > ==============================================================================<br>
>> >>> > --- libcxx/trunk/CMakeLists.txt (original)<br>
>> >>> > +++ libcxx/trunk/CMakeLists.txt Thu Jan 15 18:55:15 2015<br>
>> >>> > @@ -57,6 +57,8 @@ option(LIBCXX_ENABLE_MONOTONIC_CLOCK<br>
>> >>> >    This option may only be used when LIBCXX_ENABLE_THREADS=OFF." ON)<br>
>> >>> > option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON)<br>
>> >>> > option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support<br>
>> >>> > headers."<br>
>> >>> > ON)<br>
>> >>> > +set(LIBCXX_SYSROOT "" CACHE STRING "Use alternate sysroot.")<br>
>> >>> > +set(LIBCXX_GCC_TOOLCHAIN "" CACHE STRING "Use alternate GCC<br>
>> >>> > toolchain.")<br>
>> >>> > if (LIBCXX_BUILT_STANDALONE)<br>
>> >>> >   set(LLVM_USE_SANITIZER "" CACHE STRING<br>
>> >>> >       "Define the sanitizer used to build the library and tests")<br>
>> >>> > @@ -277,6 +279,11 @@ if (LIBCXX_BUILT_STANDALONE)<br>
>> >>> >   endif()<br>
>> >>> > endif()<br>
>> >>> ><br>
>> >>> > +list(APPEND LIBCXX_CXX_FLAGS "-target ${LIBCXX_TARGET_TRIPLE}")<br>
>> >>> > +append_if(LIBCXX_CXX_FLAGS LIBCXX_SYSROOT "--sysroot<br>
>> >>> > ${LIBCXX_SYSROOT}")<br>
>> >>> > +append_if(LIBCXX_CXX_FLAGS LIBCXX_GCC_TOOLCHAIN<br>
>> >>> > +          "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}")<br>
>> >>> > +<br>
>> >>> > string(REPLACE ";" " " LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS}")<br>
>> >>> > set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBCXX_CXX_FLAGS}")<br>
>> >>> ><br>
>> >>> ><br>
>> >>> > Modified: libcxx/trunk/test/libcxx/test/config.py<br>
>> >>> > URL:<br>
>> >>> ><br>
>> >>> > <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/test/config.py?rev=226237&r1=226236&r2=226237&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/test/config.py?rev=226237&r1=226236&r2=226237&view=diff</a><br>
>> >>> ><br>
>> >>> ><br>
>> >>> > ==============================================================================<br>
>> >>> > --- libcxx/trunk/test/libcxx/test/config.py (original)<br>
>> >>> > +++ libcxx/trunk/test/libcxx/test/config.py Thu Jan 15 18:55:15 2015<br>
>> >>> > @@ -230,9 +230,9 @@ class Configuration(object):<br>
>> >>> >         locale.setlocale(locale.LC_ALL, default_locale)<br>
>> >>> ><br>
>> >>> >         # Write an "available feature" that combines the triple when<br>
>> >>> > -        # use_system_cxx_lib is enabled. This is so that we can<br>
>> >>> > easily<br>
>> >>> > write XFAIL<br>
>> >>> > -        # markers for tests that are known to fail with versions of<br>
>> >>> > libc++ as<br>
>> >>> > -        # were shipped with a particular triple.<br>
>> >>> > +        # use_system_cxx_lib is enabled. This is so that we can<br>
>> >>> > easily<br>
>> >>> > write<br>
>> >>> > +        # XFAIL markers for tests that are known to fail with<br>
>> >>> > versions<br>
>> >>> > of<br>
>> >>> > +        # libc++ as were shipped with a particular triple.<br>
>> >>> >         if self.use_system_cxx_lib:<br>
>> >>> >             self.config.available_features.add(<br>
>> >>> >                 'with_system_cxx_lib=%s' %<br>
>> >>> > self.config.target_triple)<br>
>> >>> > @@ -288,7 +288,7 @@ class Configuration(object):<br>
>> >>> >         if not enable_threads:<br>
>> >>> >             self.configure_compile_flags_no_threads()<br>
>> >>> >             if not enable_monotonic_clock:<br>
>> >>> > -                self.configure_compile_flags_no_monotonic_clock()<br>
>> >>> > +                self.configure_compile_flags_no_monotonic_clock()<br>
>> >>> >         elif not enable_monotonic_clock:<br>
>> >>> >             self.lit_config.fatal('enable_monotonic_clock cannot be<br>
>> >>> > false when'<br>
>> >>> >                                   ' enable_threads is true.')<br>
>> >>> > @@ -298,6 +298,15 @@ class Configuration(object):<br>
>> >>> >         compile_flags_str = self.get_lit_conf('compile_flags', '')<br>
>> >>> >         self.compile_flags += shlex.split(compile_flags_str)<br>
>> >>> ><br>
>> >>> > +        sysroot = self.get_lit_conf('sysroot')<br>
>> >>> > +        if sysroot:<br>
>> >>> > +            self.compile_flags += ['--sysroot', sysroot]<br>
>> >>> > +        gcc_toolchain = self.get_lit_conf('gcc_toolchain')<br>
>> >>> > +        if gcc_toolchain:<br>
>> >>> > +            self.compile_flags += ['-gcc-toolchain', gcc_toolchain]<br>
>> >>> > +<br>
>> >>> > +        self.compile_flags += ['-target',<br>
>> >>> > self.config.target_triple]<br>
>> >>> > +<br>
>> >>> >     def configure_compile_flags_header_includes(self):<br>
>> >>> >         self.compile_flags += ['-I' + self.libcxx_src_root +<br>
>> >>> > '/test/support']<br>
>> >>> >         libcxx_headers = self.get_lit_conf('libcxx_headers',<br>
>> >>> ><br>
>> >>> > Modified: libcxx/trunk/test/<a href="http://lit.site.cfg.in" target="_blank">lit.site.cfg.in</a><br>
>> >>> > URL:<br>
>> >>> ><br>
>> >>> > <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.site.cfg.in?rev=226237&r1=226236&r2=226237&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.site.cfg.in?rev=226237&r1=226236&r2=226237&view=diff</a><br>
>> >>> ><br>
>> >>> ><br>
>> >>> > ==============================================================================<br>
>> >>> > --- libcxx/trunk/test/<a href="http://lit.site.cfg.in" target="_blank">lit.site.cfg.in</a> (original)<br>
>> >>> > +++ libcxx/trunk/test/<a href="http://lit.site.cfg.in" target="_blank">lit.site.cfg.in</a> Thu Jan 15 18:55:15 2015<br>
>> >>> > @@ -14,6 +14,9 @@ config.cxx_abi                  = "@LIBC<br>
>> >>> > config.use_sanitizer            = "@LLVM_USE_SANITIZER@"<br>
>> >>> > config.abi_library_path         = "@LIBCXX_CXX_ABI_LIBRARY_PATH@"<br>
>> >>> > config.configuration_variant    = "@LIBCXX_LIT_VARIANT@"<br>
>> >>> > +config.target_triple            = "@LIBCXX_TARGET_TRIPLE@"<br>
>> >>> > +config.sysroot                  = "@LIBCXX_SYSROOT@"<br>
>> >>> > +config.gcc_toolchain            = "@LIBCXX_GCC_TOOLCHAIN@"<br>
>> >>> ><br>
>> >>> > # Let the main config do the real work.<br>
>> >>> > lit_config.load_config(config, "@LIBCXX_SOURCE_DIR@/test/lit.cfg")<br>
>> >>> ><br>
>> >>> ><br>
>> >>> > _______________________________________________<br>
>> >>> > cfe-commits mailing list<br>
>> >>> > <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
>> >>> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
>> >>><br>
>> >><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > cfe-commits mailing list<br>
>> > <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
>> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>