You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of the infrastructure is there to support -modulewrap on Darwin. I went to enable the related test https://github.com/apple/swift/pull/34550/files and discovered that the linker doesn't add N_OSO symbols in the final binary for the modulewrap .o files. This seems to be because they don't have any symbols, so the linker ignores debug info from them.
I've made some progress (I think) towards making them usable by adding another symbol so the linker picks them up, but I'm worried that isn't actually the right path for this so I'm hoping I can get some advice here.
The text was updated successfully, but these errors were encountered:
If I recall correctly the linker will only generate N_OSO symbols for object files that contribute a function symbol to the executable. There are multiple ways to force the linker to pick up the file, such as adding a symbol to an export list or by ld -r-merging the modulewrap .o file with another object.
Can you remind me what the motivation for this is? Are you trying to improve the static archive (.a) workflow? I expect the best anser to depend on the exact use-case.
The use case for us isn't super strong, originally we were hoping to use this solution to avoid ARG_MAX issues related to thousands of modules being added with -add_ast_path, but now with big sur bumping that number, this is less of an issue. But I figured since most of the infra already existed to support this on Darwin as well, I would try to take it to the finish line just in case another use case came up in the future.
Additional Detail from JIRA
md5: e39928bf062d3b315f2c632b516b1dd6
Issue Description:
Most of the infrastructure is there to support -modulewrap on Darwin. I went to enable the related test https://github.com/apple/swift/pull/34550/files and discovered that the linker doesn't add N_OSO symbols in the final binary for the modulewrap .o files. This seems to be because they don't have any symbols, so the linker ignores debug info from them.
I've made some progress (I think) towards making them usable by adding another symbol so the linker picks them up, but I'm worried that isn't actually the right path for this so I'm hoping I can get some advice here.
The text was updated successfully, but these errors were encountered: