lhmouse/mcfgthread

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

logs_3532.zip

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?

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.

@nyfair Any suggestions?

@lhmouse 我本机编译过,一样的报错信息。你可以用gcc-mcf这个toolchain编译rav1e试试看看哈,看能不能定位问题所在。我在rust主仓库翻了一些isssue,大概率是rust端的问题,不过我还没能找到workaround的方法。

如果 -nostdlib 或者 -nodefaultlibs 的话需要你自己加上额外的依赖 -lmcfgthread -lkernel32 -lntdll

Is this still an issue for you?

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