试图构建与模块的20个c+++
我正在尝试在其他LIB的预编译模块中使用。我指定了使用 -fprebuilt-module-path = 和link *.so文件的LIB PCM文件的路径,但收到下一个错误:
致命错误:模块'_builtin_stddef_max_align_t'在'/home/user/.cache/clang/modulecache/1ZQ7RBKO4A6V0/_BUILTIN_BUILTIN_BUILTIN_STDDDDDDDEF_MAX_MAX_ALIGN_ALIGN_ALIGN_T-1KLR31KLR31KACHE//cl.pccace/clome&clanus/clane/cache/cache/ ACHE/1VEVSXT4LZMYX /_builtin_stddef_max_align_t-1klr31knj6263.pcm'
如果我尝试清除缓存,则需要重建LIB,因为PCM文件依赖于缓存。
如果我尝试指定的非默认路径来缓存,它也不会解决问题。
我认为我必须使用一些特定的编译选项来解决它,但我不明白
某人的面孔可能是什么?
ps对不起,我没有找到这个问题的简单复制品
I am trying use in app precompiled modules from other lib. I am specifies path to lib pcm-files with -fprebuilt-module-path= and link *.so file, but recieved the next error:
fatal error: module '_Builtin_stddef_max_align_t' is defined in both '/home/user/.cache/clang/ModuleCache/1ZQ7RBKO4A6V0/_Builtin_stddef_max_align_t-1KLR31KNJ6263.pcm' and '/home/user/.cache/clang/ModuleCache/1VEVSXT4LZMYX/_Builtin_stddef_max_align_t-1KLR31KNJ6263.pcm'
If I trying clear cache its require rebuild lib because pcm files depend by cache.
If I trying specified non default path to cache its not fixes problem too.
I think I must use some specific compile option to resolve it but I doesnt understand which
Maybe someone's face with it?
P. S. Sorry I didn't found a simple reproducer for this problem
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您(与我类似)可能正在击中这个叮当虫:
这也与叮当冲突中不同种类的内部模块机制有关。
我能够使用
-fmodules-ignore-macro =,告诉Clang忽略了哪些宏(至少在模块完整性/缓存方面)来解决哪些宏不同,并告诉Clang忽略它们(至少在模块完整性/缓存方面)。 Foobar
参数。编辑:我似乎有一个重大的误解,除了
-Std = C ++ 20
,Clang还需要-fmodules
to实际提供模块功能。实际上,它没有,并且-fmodules
启用一个添加剂,较旧的,特定的模块系统,该系统与标准的C ++模块系统相冲突,该系统已由> std = C ++ 20 < /代码>。因此,就我而言,只需删除
-fmodules
编译器参数也修复了错误。It's possible that you (similarly to me) are hitting this Clang bug: https://github.com/llvm/llvm-project/issues/53231
In my case this was caused by a mismatch in preprocessor macros (defines) supplied from the compiler command line at module build- an import times. Also it had something to do with the different kinds of internal module mechanisms within Clang clashing.
I was able to get around this by figuring out which macros were different in the different compiler invocations, and telling Clang to ignore them (at least with regard to module integrity/caching), using the
-fmodules-ignore-macro=FOOBAR
argument.EDIT: I appear to have had a significant misunderstanding, that in addition to
-std=c++20
, Clang also requires-fmodules
to actually provide module functionality. In fact it does not, and-fmodules
enables an additonal, older, Clang-specific module system, which clashes with the standard C++ module system already enabled by-std=c++20
. So in my case, simply removing the-fmodules
compiler argument also fixed the error.