[clang] [clang] [unittest] Add a test for Generic_GCC::GCCVersion::Parse (PR #69078)

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 18 05:39:16 PDT 2023


mstorsjo wrote:

> @tbaederr Just came to report the same thing!
> 
> @mstorsjo This broke builds that use `-DBUILD_SHARED_LIBS=True`.

Thanks! That was my guess as well, I was running a build with that enabled to try to reproduce @tbaederr 's issue.

> The problem seems to be that the `Generic_GCC` class has the `LLVM_LIBRARY_VISIBILITY` attribute meaning the `clang::driver::toolchains::Generic_GCC::GCCVersion::Parse(llvm::StringRef)` symbol is hidden. Removing that attribute fixes the build. It would be good for someone more familiar with this part of the codebase to confirm if that's an acceptable fix however.

Thanks for the analysis! I guess that sounds reasonable, although I wonder how these unit test, that test internals within libclang are meant to work in this configuration. The number of extra exported symbols by removing `LLVM_LIBRARY_VISIBILITY` probably isn't that bad, I wonder if it has other implications wrt ABI of the shared libs?

I guess it's safest to revert this for now, so we can figure out the best path forward here without a rush?

https://github.com/llvm/llvm-project/pull/69078


More information about the cfe-commits mailing list