Summary: | clang crashes when compiling cad/openvsp | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Fernando Apesteguía <fernape> | ||||||||
Component: | bin | Assignee: | freebsd-toolchain (Nobody) <toolchain> | ||||||||
Status: | Closed Overcome By Events | ||||||||||
Severity: | Affects Only Me | CC: | dim, emaste, fernape | ||||||||
Priority: | --- | ||||||||||
Version: | CURRENT | ||||||||||
Hardware: | Any | ||||||||||
OS: | Any | ||||||||||
Attachments: |
|
Created attachment 185524 [details]
clang crash debug file
So what this test case causes is: fatal error: error in backend: No open frame This happens with most versions of clang that I could test, and is due to the following inline assembly: https://sourceforge.net/p/angelscript/code/HEAD/tree/trunk/sdk/angelscript/source/as_callfunc_x86.cpp#l1454 #ifdef __OPTIMIZE__ // Epilogue "movl %%ebp, %%esp \n" ".cfi_def_cfa_register esp \n" "popl %%ebp \n" ".cfi_adjust_cfa_offset -4 \n" ".cfi_restore ebp \n" #endif Basically, it finds a 'naked' .cfi_restore directive, and it chokes on that. It is probably possible to work around this by disabling the epilogue part, but I am not familiar with this angelscript stuff at all... We do have a lang/angelscript port, maintained by vg@, maybe he knows how we can work around this problem? Created attachment 185701 [details]
Disable prologs/epilogs that crash clang
Here is a patch which disables the strange prologs/epilogs that mess with the CFI state, and cause clang to crash. I ran the resulting vsp executable, and it seemed to work OK for me, with light testing.
Closing the PR since I opened another one with an update of the port so it compiles in -CURRENT. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222001 I tested the unpatched port with clang 5.0.0 r312293 and clang still crashes. I didn't see a but report in llvm's bugzilla. Has this been reported? (In reply to fernando.apesteguia from comment #4) > Closing the PR since I opened another one with an update of the port so it > compiles in -CURRENT. See: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222001 > > I tested the unpatched port with clang 5.0.0 r312293 and clang still > crashes. I didn't see a but report in llvm's bugzilla. Has this been > reported? No, this code makes no sense, so it also makes no real sense to report it. Just apply the patch. |
Created attachment 185523 [details] clang crash debug file One of my ports (cad/openvsp) fails to compile in -CURRENT. The port only compiles with gcc on < 12. As part of the debugging I changed to compile with clang. The compiler crashed while compiling the port with the following error: fatal error: error in backend: No open frame c++: error: clang frontend command failed with exit code 70 Compiler version is: freebsd clang version 5.0.0 (brances/release_50 309439) FreeBSD CURRENT is running in virtualbox 5.1.22 with 8GB of memory assigned. I didn't see any symptoms of memory exhaustion. How to reproduce: Change compiler:gcc-c++11-lib to compiler:c++14-lang in port's Makefile Change src/external/glfont2/CMakeLists.txt and add /usr/local/include (for some reason clang doesn't find GL/gl.h while gcc does...)