Hello, As discussed in an previous thread on cfe-dev, darwin lacks ubsan support, and so compilation with -fcatch-undefined-behavior will result in a linker error.
Here are two patches for compiler-rt to start to fix this issue. The first one update the stub darwin SDK in compiler-rt to make it c++ safe. This is required to be able to compile ubsan using it, as ubsan is C++. It simply adds __cplusplus guard to the headers, and rename restrict to __restrict. This patch also add some missing declarations needed by ubsan (fputc in stdio.h and unistd.h) The second one is an attempt to add USBAN to the Makefile build system. It also relaxes the restriction in ubsan header to allow compilation on Apple platform. With these patches, "make clang_darwin" in compiler-rt will build an universal version of ubsan for OS X. -- Jean-Daniel
sdk.patch
Description: Binary data
darwin-ubsan.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
