RESOLVED FIXED 173889
[Win] Build JSCOnly on Windows with clang-cl
https://bugs.webkit.org/show_bug.cgi?id=173889
Summary [Win] Build JSCOnly on Windows with clang-cl
Stephan Szabo
Reported 2017-06-27 14:26:28 PDT
Support using the clang-cl toolset for JSC only builds on Windows
Attachments
Patch to build jsc-only with clang-cl toolset (5.12 KB, patch)
2017-06-27 14:32 PDT, Stephan Szabo
no flags
Patch to build jsc-only with clang-cl toolset (5.57 KB, patch)
2017-06-27 15:20 PDT, Stephan Szabo
no flags
Patch to build jsc-only with clang-cl toolset - combined clang-cl/gcc/clang4 option (5.37 KB, patch)
2017-06-27 15:41 PDT, Stephan Szabo
no flags
Patch to build jsc-only with clang-cl toolset - restructured gcc_or_clang block (5.47 KB, patch)
2017-06-28 14:54 PDT, Stephan Szabo
no flags
Patch to build jsc-only with clang-cl toolset - restructured gcc_or_clang block (5.42 KB, patch)
2017-06-28 14:57 PDT, Stephan Szabo
no flags
Stephan Szabo
Comment 1 2017-06-27 14:32:58 PDT
Created attachment 313946 [details] Patch to build jsc-only with clang-cl toolset
Stephan Szabo
Comment 2 2017-06-27 15:20:12 PDT
Created attachment 313952 [details] Patch to build jsc-only with clang-cl toolset
Stephan Szabo
Comment 3 2017-06-27 15:41:24 PDT
Created attachment 313956 [details] Patch to build jsc-only with clang-cl toolset - combined clang-cl/gcc/clang4 option
Konstantin Tokarev
Comment 4 2017-06-28 13:15:12 PDT
Comment on attachment 313956 [details] Patch to build jsc-only with clang-cl toolset - combined clang-cl/gcc/clang4 option View in context: https://bugs.webkit.org/attachment.cgi?id=313956&action=review > Source/cmake/OptionsCommon.cmake:57 > + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-strict-aliasing -fno-rtti") Don't duplicate these lines > Source/cmake/OptionsCommon.cmake:58 > + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y") Can clang-cl accept -std=c++1y? If yes, it should just add a few flags to those set in the common COMPILER_IS_GCC_OR_CLANG block
Don Olmstead
Comment 5 2017-06-28 13:48:13 PDT
Comment on attachment 313956 [details] Patch to build jsc-only with clang-cl toolset - combined clang-cl/gcc/clang4 option View in context: https://bugs.webkit.org/attachment.cgi?id=313956&action=review >> Source/cmake/OptionsCommon.cmake:57 >> + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-strict-aliasing -fno-rtti") > > Don't duplicate these lines These were duplicated from above. I'm guessing because those options are never going to change. >> Source/cmake/OptionsCommon.cmake:58 >> + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y") > > Can clang-cl accept -std=c++1y? If yes, it should just add a few flags to those set in the common COMPILER_IS_GCC_OR_CLANG block With clang-cl it attempts to use the cl options where applicable such as https://blogs.msdn.microsoft.com/vcblog/2016/06/07/standards-version-switches-in-the-compiler/
Stephan Szabo
Comment 6 2017-06-28 14:05:57 PDT
(In reply to Konstantin Tokarev from comment #4) > Comment on attachment 313956 [details] > Patch to build jsc-only with clang-cl toolset - combined clang-cl/gcc/clang4 > option > > View in context: > https://bugs.webkit.org/attachment.cgi?id=313956&action=review > > > Source/cmake/OptionsCommon.cmake:57 > > + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-strict-aliasing -fno-rtti") > > Don't duplicate these lines > > Source/cmake/OptionsCommon.cmake:58 > > + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y") > > Can clang-cl accept -std=c++1y? If yes, it should just add a few flags to > those set in the common COMPILER_IS_GCC_OR_CLANG block Unfortunately, no, -std is considered an unknown argument. (In reply to Konstantin Tokarev from comment #4) > Comment on attachment 313956 [details] > Patch to build jsc-only with clang-cl toolset - combined clang-cl/gcc/clang4 > option > > View in context: > https://bugs.webkit.org/attachment.cgi?id=313956&action=review > > > Source/cmake/OptionsCommon.cmake:57 > > + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-strict-aliasing -fno-rtti") > > Don't duplicate these lines I'm sorry, I'm not sure what you mean here. Is it because we're doing -fno-strict-aliasing in both branches? We aren't passing -fno-exceptions or -fno-rtti in the clang-cl case, but it'd be easy to separate the common one out if that seems better. > > Source/cmake/OptionsCommon.cmake:58 > > + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y") > > Can clang-cl accept -std=c++1y? If yes, it should just add a few flags to > those set in the common COMPILER_IS_GCC_OR_CLANG block Unfortunately, no, -std is an unknown argument for clang-cl.
Stephan Szabo
Comment 7 2017-06-28 14:06:43 PDT
Sorry, I accidentally ended up with two copies of the last post in the post.
Konstantin Tokarev
Comment 8 2017-06-28 14:37:02 PDT
Comment on attachment 313956 [details] Patch to build jsc-only with clang-cl toolset - combined clang-cl/gcc/clang4 option View in context: https://bugs.webkit.org/attachment.cgi?id=313956&action=review >>>>> Source/cmake/OptionsCommon.cmake:57 >>>>> + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-strict-aliasing -fno-rtti") >>>> >>>> Don't duplicate these lines >>> >>> These were duplicated from above. I'm guessing because those options are never going to change. >> >> > > I'm sorry, I'm not sure what you mean here. Is it because we're doing -fno-strict-aliasing in both branches? We aren't passing -fno-exceptions or -fno-rtti in the clang-cl case, but it'd be easy to separate the common one out if that seems better. Yes, it would be better
Stephan Szabo
Comment 9 2017-06-28 14:54:40 PDT
Created attachment 314059 [details] Patch to build jsc-only with clang-cl toolset - restructured gcc_or_clang block
Stephan Szabo
Comment 10 2017-06-28 14:57:21 PDT
Created attachment 314060 [details] Patch to build jsc-only with clang-cl toolset - restructured gcc_or_clang block
WebKit Commit Bot
Comment 11 2017-06-28 16:04:41 PDT
Comment on attachment 314060 [details] Patch to build jsc-only with clang-cl toolset - restructured gcc_or_clang block Clearing flags on attachment: 314060 Committed r218900: <http://trac.webkit.org/changeset/218900>
WebKit Commit Bot
Comment 12 2017-06-28 16:04:43 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.