| # Apple clang 14.0.0 (Xcode 14.0.1) M1 coredumps compiling abc .c files | |
| Tool: ABC | |
| Subcategory: Compiler crash | |
| ## Conversation | |
| ### stefanottili | |
| Hi Folks, | |
| just a heads up for anybody using an Apple M1 with the most recent Xcode 14.0.1 | |
| Apple clang 14.0.0 randomly coredumps compiling abc .c files. But not deterministically, restarting ./build_openroad.sh will eventually compile some of them til it finally always coredumps compiling extraUtilMisc.c. | |
| I was able to compile OpenROAD on this machine before, but not with the latest and greatest Xcode. | |
| I'm curious whether there are other M1/Xcode users out there with similar experience. | |
| Stefan | |
| gmake[2]: Entering directory '/Users/user/OpenROAD-flow-scripts/tools/OpenROAD/build' | |
| [ 0%] Building CXX object third-party/abc/CMakeFiles/libabc.dir/src/misc/extra/extraUtilMisc.c.o | |
| cd /Users/user/OpenROAD-flow-scripts/tools/OpenROAD/build/third-party/abc && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -I/Users/user/OpenROAD-flow-scripts/tools/OpenROAD/third-party/abc/src -O3 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -Wall -Wno-array-bounds -Wno-nonnull -Wno-unused-variable -Wno-unused-function -Wno-write-strings -Wno-sign-compare -Wno-deprecated -Wno-c++11-narrowing -Wno-register -Wno-format -Wno-reserved-user-defined-literal -DABC_USE_STDINT_H=1 -DABC_MEMALIGN=4 -DABC_NAMESPACE=abc -fpermissive -DABC_USE_CUDD=1 -DABC_USE_PTHREADS -Wno-unused-but-set-variable -std=c++17 -MD -MT third-party/abc/CMakeFiles/libabc.dir/src/misc/extra/extraUtilMisc.c.o -MF CMakeFiles/libabc.dir/src/misc/extra/extraUtilMisc.c.o.d -o CMakeFiles/libabc.dir/src/misc/extra/extraUtilMisc.c.o -c /Users/user/OpenROAD-flow-scripts/tools/OpenROAD/third-party/abc/src/misc/extra/extraUtilMisc.c | |
| clang: error: unable to execute command: Segmentation fault: 11 | |
| clang: error: clang frontend command failed due to signal (use -v to see invocation) | |
| Apple clang version 14.0.0 (clang-1400.0.29.102) | |
| Target: arm64-apple-darwin21.6.0 | |
| Thread model: posix | |
| InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin | |
| ### stefanottili | |
| downgrading the command line tools to 13.4 allows to build the project | |
| ### stefanottili | |
| Here's some feedback from https://developer.apple.com/forums/thread/717259 | |
| > It only happens with optimized code. An alternative workaround for building openroad is to patch the abc cmake file to include -g | |
| third-party/CMakeLists.txt @@ -46,6 +46,10 @@ if (NOT USE_SYSTEM_ABC) | |
| readline is not needed since we call abc from c++ | |
| set(READLINE_FOUND FALSE) | |
| +# apple clang 14.0.0 seg faults on abc without -g +add_compile_options( | |
| $<$<CXX_COMPILER_ID:AppleClang>:-g> | |
| +) add_subdirectory(abc) | |
| endif() | |
| ### stefanottili | |
| clang-1400.0.29.202 as part of Xcode 14.1.0 compiles OpenRoad without issues | |