Skip to content
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

Sanitisers are disabled for macOS13+ (e.g. fsanitize=undefined can not be used) #5

Open
zhk1211 opened this issue Jun 3, 2023 · 1 comment

Comments

@zhk1211
Copy link

zhk1211 commented Jun 3, 2023

g++-13 M_tree.cpp -o /Users/zhaohaikun/Desktop/code/M_tree -fsanitize=undefined

ld: library not found for -lubsan
collect2: error: ld returned 1 exit status

Mac 13.4

g++-13 -v
Using built-in specs.
COLLECT_GCC=g++-13
COLLECT_LTO_WRAPPER=/opt/homebrew/Cellar/gcc/13.1.0/bin/../libexec/gcc/aarch64-apple-darwin22/13/lto-wrapper
Target: aarch64-apple-darwin22
Configured with: ../configure --prefix=/opt/homebrew/opt/gcc --libdir=/opt/homebrew/opt/gcc/lib/gcc/current --disable-nls --enable-checking=release --with-gcc-major-version-only --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-13 --with-gmp=/opt/homebrew/opt/gmp --with-mpfr=/opt/homebrew/opt/mpfr --with-mpc=/opt/homebrew/opt/libmpc --with-isl=/opt/homebrew/opt/isl --with-zstd=/opt/homebrew/opt/zstd --with-pkgversion='Homebrew GCC 13.1.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --with-system-zlib --build=aarch64-apple-darwin22 --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.1.0 (Homebrew GCC 13.1.0)

@iains
Copy link
Owner

iains commented Jun 3, 2023

Yes, this is an issue, but it is intentional:

From Ventura (macOS13) the APIs have changed for accessing some of the information that the sanitisers need. At present, we do not have support in GCC for accessing those APIs and have had to disable the sanitisers until a working solution can be found.

@iains iains changed the title fsanitize=undefined can not be in use Sanitisers are disabled for macOS13+ (e.g. fsanitize=undefined can not be used) Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants