请问HN:寻求对LLVM的帮助

16作者: kvthweatt大约 1 个月前原帖
我正在开发一种新语言,到目前为止一切都很顺利。 我需要知道是否有办法完全阻止LLVM链接CRT符号。我的目标是创建一个新的运行时。 我用我的语言编写了一个存根库,当我尝试将库编译成.lib格式时,遇到了一个问题,LLVM强制引入了<i>_fltused</i>,导致我的定义被标记为错误,提示_fltused已经存在。 在.ll IR文件中,除了_fltused的定义之外没有其他内容,而我希望这个定义能够出现在最终的.lib中。 我已经在谷歌上搜索并询问AI好几天了,想知道我可以使用什么编译器/链接器标志来让LLVM完全绕过CRT,以便我可以开发自己的运行时,但无论我添加什么标志,Clang、MinGW和LLVM都在积极链接CRT。 我快要抓狂了。我无法直接将我的.ll文件转换为.as,因为LLVM编译器在阻碍我,否则我现在早就有我的库了。
查看原文
I&#x27;m developing a new language, and everything is pretty nice so far.<p>I need to know if there&#x27;s a way to prevent LLVM from linking in CRT symbols entirely. The goal is to make a new runtime.<p>I have a stub library written in my language, when I go to compile the library in .lib form, I keep running into a wall where LLVM forcefully brings in <i>_fltused</i>, causing my definition to get flagged with an error saying _fltused already exists.<p>There is nothing in the .ll IR file other than the _fltused definition, the one that I want to have end up in the final .lib.<p>I have Googled and asked AI for days now what compiler&#x2F;linker flags I can use to get LLVM to bypass the CRT entirely so I can develop my own runtime, and Clang, MinGW, and LLVM are all aggressively linking in the CRT no matter what flags I add.<p>I&#x27;m pulling my hair out over here. I can&#x27;t convert my .ll file directly to .as because the LLVM compiler is getting in the way, otherwise I&#x27;d have my library by now.