Page MenuHomePhabricator

Fix the target specific "-msse3" flag check in CMake. NFC
ClosedPublic

Authored by sgundapa on Dec 8 2015, 4:37 PM.

Details

Summary

msse3 is a target dependent flag and must be guarded as check_cxx_compiler_flag()
checks only for compiler error messages and ignores warnings. Earlier COMPILER_RT_HAS_MSSE3_FLAG
is set to "TRUE" for all targets as clang emits warnings and the compilation spits unnecessary
warnings for non-X86 targets. This issue is fixed by coupling the flag with "-Werror"

Diff Detail

Repository
rL LLVM

Event Timeline

sgundapa updated this revision to Diff 42245.Dec 8 2015, 4:37 PM
sgundapa retitled this revision from to Guard "-msse3" flag in CMake for specific targets. NFC.
sgundapa updated this object.
sgundapa added a reviewer: samsonov.
sgundapa added a subscriber: llvm-commits.
seurer added a subscriber: seurer.Dec 9 2015, 11:14 AM

The use of the flag is causing errors in the sanitizer buildbot runs (for power at least) so assuming this patch fixes that it would be great to get this in ASAP.

Building CXX object lib/asan/CMakeFiles/RTAsan_dynamic.powerpc64le.dir/asan_interceptors.cc.o
clang-3.8: error: argument unused during compilation: '-msse3'

samsonov edited edge metadata.Dec 9 2015, 11:19 AM

Would smth. along the lines of

check_cxx_compiler_flag("-Werror -msse3" COMPILER_RT_HAS_MSSE3_FLAG)

work?

sgundapa added a comment.EditedDec 9 2015, 11:27 AM

But classifying the flag under the specific target makes more sense to me. I am okay with "-Werror" fix too. Let me know. Feel free to ping me in IRC @ sgundapa

Let's use the -Werror approach. We already use it to detect presence of warnings, and I'd rather not hardcode targets. E.g. what if this flag is not supported (produces warning) by your host compiler on x86?

sgundapa updated this revision to Diff 42324.Dec 9 2015, 11:49 AM
sgundapa retitled this revision from Guard "-msse3" flag in CMake for specific targets. NFC to Fix the target specific "-msse3" flag check in CMake. NFC.
sgundapa updated this object.
sgundapa edited edge metadata.

Have no clue on what "msse3" flag does and when this flag is added. Agree with you and pushed a new patch set

samsonov accepted this revision.Dec 9 2015, 12:04 PM
samsonov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 9 2015, 12:04 PM
This revision was automatically updated to reflect the committed changes.