There are several questions about compiler options. Now I use the following:
-target i386-windows-gnu -mno-sse -c -O3
-target x86_64-windows-gnu -mcx16 -c -O3
-target i386-linux-gnu -mno-sse -c -O3
-target x86_64-linux-gnu -mcx16 -c -O3
-target i386-darwin-gnu -mno-sse -fomit-frame-pointer -c -O3
-target x86_64-macos-gnu -fomit-frame-pointer -c -O3
-target armv7-none-linux-androideabi -mfpu=neon -mfloat-abi=hard -mthumb -fPIC -c -O3
-target aarch64-linux-android -c -O3
-target armv7m-none-ios-gnueabi -mfpu=neon -mfloat-abi=hard -mthumb -c -O3
-target arm64-darwin-gnu -fno-stack-protector -c -O3
There are no complaints only on Linux/Android. For other platforms it gives a warning (https://godbolt.org/z/YhZ5uc):
clang-9: warning: argument unused during compilation: '--gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0' [-Wunused-command-line-argument]
Compiler returned: 0
ARM32 platforms do not support the preserve_most attribute (https://godbolt.org/z/SQRJB2):
<source>:2:21: warning: 'preserve_most' calling convention is not supported for this target [-Wignored-attributes]
void __attribute__((preserve_most)) proc_most(int* x);
But the biggest problem is that Mac/iOS does not support TLS variables (https://godbolt.org/z/6bqjby)!
__thread int x;
int test()
{
return x;
}
<source>:2:1: error: thread-local storage is not supported for the current target