LLVM doesn't support int bar __attribute__ ((visibility ("protected"))) = 1; This is needed to compile the glibc.
Lauro, what's the semantics of protected visibility? How it should be codegen'ed? There were some bits reserved to "future visibility types", so the only non-trivial part should be codegen.
I don't know what is its semantics, but the codegen must emit ".protected bar".
Mine. Should be trivial.
documentation: http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Function-Attributes.html
Created attachment 811 [details] LLVM-side patch Lauro, please find LLVM-side patch attached. There is no linker part, you'll have to add it by yourself. llvm-gcc part should be easy, I think (check for VISIBILITY_PROTECTED in the same places as hidden is checked). LangRef should be updated with the correct semantics of protected visibility as well. Testcase: @X = protected global i32 1234
The patch looks fine, please apply it. The critical missing pieces are LangRef.html and linker support. -Chris
Implemented in: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070423/048685.html ... http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070423/048693.html LangRef.html was also updated, so the only missed part is Linker.
As for linker: ld doesn't allow multiple definitions of the same variable with different visibility styles. It just treats this as redefinition. Should we follow ld?
Yes, we should emulate ld
Linking was done in http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070423/048711.html
Created attachment 812 [details] LLVM-GCC-side patch
Created attachment 813 [details] LLVM-GCC-side patch I missed a TREE_PUBLIC check in the previous patch.
Patch applied, should this be closed?
Yes. Definitely.