fix(TPC/includes): 泛型特化 linkonce_odr + None 全局 common + includes 前缀
- TPC HandlesFunctions/HandlesClassDef: 泛型特化类方法(类名含 '[')设 linkonce_odr,消除 GSList[NameEntry].__before_init__ 等 duplicate symbol - TPC HandlesAssign: None 初值模块级全局用 common linkage,合并 _g_gen 等 跨模块同名全局重复定义 - includes: binascii/hashlib 裸调用加 stdlib./string. 前缀(malloc/free/memset/memcpy) - llvmlite: FunctionPrint 泛型特化方法输出 define linkonce_odr;__module 调整 - 删除 wiki/01-overview.md
This commit is contained in:
1 parent
b4567ffb9a
commit
8ccf5d2c18
10 files changed
+70
-384
No files matched your search
@@ -1551,9 +1551,16 @@ class FunctionHandle(BaseHandle):
|
||||
if MangledName == FuncName or FuncName not in Gen._export_extern_funcs:
|
||||
Gen.functions[FuncName] = func
|
||||
func.attributes.add('noredzone')
|
||||
# 泛型特化类方法(如 GSList[NameEntry].__before_init__):多个模块各自
|
||||
# 特化会生成同名定义(external linkage)→ ld.lld duplicate symbol warning。
|
||||
# 特化方法代码由相同模板+类型参数生成,定义相同,设 linkonce_odr 让
|
||||
# 链接器合并重复定义(linkonce_odr 的 alwaysinline 不适用,仅改 linkage)。
|
||||
is_spec_generic_method: bool = '[' in FuncName
|
||||
if IsInlineFunc:
|
||||
func.linkage = 'linkonce_odr'
|
||||
func.attributes.add('alwaysinline')
|
||||
if is_spec_generic_method:
|
||||
func.linkage = 'linkonce_odr'
|
||||
if hasattr(self, '_cdefine_funcs') and FuncName in self._cdefine_funcs:
|
||||
func.linkage = 'linkonce_odr'
|
||||
func.attributes.add('alwaysinline')
|
||||
|
||||
Reference in new issue
Block a user