undefined reference to `__MCF_cxa_atexit'
eko5624 opened this issue · 15 comments
When compiling rav1e, I get this error. Any help would be great.
https://github.com/eko5624/mpv-win64/actions/runs/4566452470/jobs/8058976233
Looks like your GCC did not add -lmcfgthread
.
Where did GitHub Actions get that toolchain btw? The CRT part seemed to be MCF but GCC wasn't?
I get toolchain from your website. (https://gcc-mcf.lhmouse.com/mingw-w64-gcc-mcf_20230307_13.0.1_x64-ucrt_601b7673e8f8e2f280b0edb92c4035a979fcd15a.7z)
I did some tests. Rollback to (https://gcc-mcf.lhmouse.com/archives/mingw-w64-gcc-mcf_20210504_10.3.1_x64-ucrt_4c6b5dbd75151a47b1201f22e539c0c718e373af.7z) No errors, don't know why.
That's an ancient version. You should try building locally, linking with gcc -v
to see whether -lmcfgthread
exists in the final linker command line.
@lhmouse 我本机编译过,一样的报错信息。你可以用gcc-mcf这个toolchain编译rav1e试试看看哈,看能不能定位问题所在。我在rust主仓库翻了一些isssue,大概率是rust端的问题,不过我还没能找到workaround的方法。
如果 -nostdlib
或者 -nodefaultlibs
的话需要你自己加上额外的依赖 -lmcfgthread -lkernel32 -lntdll
。
Is this still an issue for you?
Same errors with mingw-w64-gcc-mcf_20230426_13.1.0_x64-ucrt
log:
https://github.com/eko5624/mpv-win64/actions/runs/4862218891/jobs/8668288298
But his build no errors.(https://github.com/brechtsanders/winlibs_mingw/releases/download/13.0.1-snapshot20230402-11.0.0-ucrt-r1/winlibs-x86_64-mcf-seh-gcc-13.0.1-snapshot20230402-mingw-w64ucrt-11.0.0-r1.7z)
log:
https://github.com/eko5624/mpv-win64/actions/runs/4667218657/jobs/8262738994
My presumption is that their CRT is vanilla mingw-w64. My personal toolchains provide patched CRT so -lmcfgthread -lntdll
are required as default libraries, like -lmsvcrt -lkernel32
.
Is this still an issue for you?
20230522_13.1.1 still doesn't work.
You really have to take a look at the linker command line.
Note adding -lmcfgthread
is unlikely to fix the issue, because user-supplied libraries are still linked BEFORE the default CRT object files, so references from CRT startup code always fail.
经测试,用我自己编译的不打crt补丁的gcc with mcf可以成功编译了,所以这个issue可以关闭啦~
https://github.com/eko5624/mpv-win64/actions/runs/5629086074