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
In the C/C++ world, it is very common to enable `-fvisiblity=hidden` so that symbols are not exported unless they are explicitly marked up with `attribute((visibility("default")))`. This reduces code size, and more importantly prevents accidental use of internal symbols. When statically linking multiple C/C++ libraries into a single image, it is also useful to be able to remove the hidden symbols using ld -r to pre-link a static library into a single .o with only exported symbols visible.
The Swift Package Manager should support these workflows for C/C++ targets.
The text was updated successfully, but these errors were encountered:
I think -fvisibility=hidden would be straightforward to add as a new target build setting that lowers to the appropriate compiler arguments, but it's unclear to me how to add a link step for ld -r.
Additional Detail from JIRA
md5: cffe6521be9d47ac2c5eda85d5d2434a
Issue Description:
In the C/C++ world, it is very common to enable `-fvisiblity=hidden` so that symbols are not exported unless they are explicitly marked up with `attribute((visibility("default")))`. This reduces code size, and more importantly prevents accidental use of internal symbols. When statically linking multiple C/C++ libraries into a single image, it is also useful to be able to remove the hidden symbols using
ld -r
to pre-link a static library into a single .o with only exported symbols visible.The Swift Package Manager should support these workflows for C/C++ targets.
The text was updated successfully, but these errors were encountered: