-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan_ios_dynamic.dir/tsan_debugging.cpp.o is incorrectly compiled with x86-specific options #63270
Labels
Comments
MaskRay
added
cmake
Build system in general and CMake in particular
compiler-rt:tsan
Thread sanitizer
labels
Jun 12, 2023
MaskRay
added a commit
that referenced
this issue
Jun 12, 2023
so that they get an error on non-x86 targets. Follow-up to D151590. As a workaround for #63270, we don't report an error for -msse4.2.
MaskRay
added a commit
to MaskRay/llvm-project
that referenced
this issue
Aug 3, 2023
so that they lead to an error when compiled for non-x86 targets. Follow-up to D151590. ``` % aarch64-linux-gnu-gcc -c -mavx a.c aarch64-linux-gnu-gcc: error: unrecognized command-line option ‘-mavx’ % clang --target=aarch64-unknown-linux-gnu -c -mavx a.c # without this patch clang: warning: argument unused during compilation: '-mavx' [-Wunused-command-line-argument] % ``` As a workaround for llvm#63270, we don't report an error for -msse4.2.
MaskRay
added a commit
that referenced
this issue
Aug 4, 2023
so that they lead to an error when compiled for non-x86 targets. Follow-up to D151590. ``` % aarch64-linux-gnu-gcc -c -mavx a.c aarch64-linux-gnu-gcc: error: unrecognized command-line option ‘-mavx’ % clang --target=aarch64-unknown-linux-gnu -c -mavx a.c # without this patch clang: warning: argument unused during compilation: '-mavx' [-Wunused-command-line-argument] ... % clang --target=aarch64-unknown-linux-gnu -c -mavx a.c # with this patch clang: error: unsupported option '-mavx' for target 'aarch64-unknown-linux-gnu' ``` As a workaround for #63270, we don't report an error for -msse4.2. Reviewed By: pengfei, skan Differential Revision: https://reviews.llvm.org/D156962
razmser
pushed a commit
to razmser/llvm-project
that referenced
this issue
Sep 8, 2023
so that they lead to an error when compiled for non-x86 targets. Follow-up to D151590. ``` % aarch64-linux-gnu-gcc -c -mavx a.c aarch64-linux-gnu-gcc: error: unrecognized command-line option ‘-mavx’ % clang --target=aarch64-unknown-linux-gnu -c -mavx a.c # without this patch clang: warning: argument unused during compilation: '-mavx' [-Wunused-command-line-argument] ... % clang --target=aarch64-unknown-linux-gnu -c -mavx a.c # with this patch clang: error: unsupported option '-mavx' for target 'aarch64-unknown-linux-gnu' ``` As a workaround for llvm#63270, we don't report an error for -msse4.2. Reviewed By: pengfei, skan Differential Revision: https://reviews.llvm.org/D156962
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
On an x86_64-apple-* macOS machine,
COMPILER_RT_HAS_MSSE4_2_FLAG
is true (the availability is detected likeclang --target=x86_64-apple-darwinXXX -arch x86_64 -Werror -msse4.2 -c src.cxx
).Ensure that an iOS SDK is available. In the following build,
compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan_ios_dynamic.dir/tsan_debugging.cpp.o
(and otherclang_rt.tsan_ios_dynamic.dir
files due to-DCOMPILER_RT_ENABLE_IOS=on
) will have a warning like the followingThis command compiles
a.c
using the arm64-apple-darwin triple and-msse4.2
should lead to an error instead of a warning.The full command line will look like the following if Clang issues an error (https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8778547096422852257/+/u/package_clang/stdout)
It seems tsan's CMake should be fixed to recognize x86_64 options and not pass them to clang_rt.tsan_ios_dynamic.dir builds (
clang --target=x86_64-apple-darwinXXX -arch arm64
).For host files like
./compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan_osx_dynamic.dir/tsan_flags.cpp.o
, the Clang command line looks like-arch arm64 -arch x86_64 -arch x86_64h
.It is benign to pass
-msse4.2
but ideally-Xarch_x86_64 -msse4.2 -Xarch_x86_64h -msse4.2
should be used instead.The text was updated successfully, but these errors were encountered: