Skip to content

Conversation

buzzdeee
Copy link
Contributor

basically link against -lc++abi when using clang.
I don't know if checking the value of CLANG_CC variable is the most optimal route,
but it was the best/most natural I could find. Open for suggestions otherwise.

I had it in a ugly way hardcoded in the GNUstep ports tree for years, since that doesn't support building with gcc ;)

Tested on amd64, with gcc 11 from packages, and linking against gcc libobjc, as well as using base clang, and building against libobjc2 from packages.

@buzzdeee buzzdeee requested a review from rfm as a code owner November 11, 2024 21:24
…lc++abi

since when using clang, the GCC internals aren't around.

I had it in a ugly way hardcoded in the GNUstep ports tree for years.

Tested on amd64, with gcc 11 from packages, and linking against gcc libobjc,
as well as using base clang, and building against libobjc2 from packages.
@qmfrederik
Copy link
Contributor

@buzzdeee We've got a similar config embedded in the MSYS2 packages for GNUstep: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-gnustep-make/PKGBUILD#L34 .

I suspect the -lc++ dependency comes from using libobjc2, which uses C++ exception handling mechanisms? I just wonder whether the -lc++ dependency should depend on linking with libobjc2, rather than using clang as the compiler?

@buzzdeee
Copy link
Contributor Author

Yeah, the -lc++abi is because of CLANG internals, when using clang, and not linking against then got a unknown symbol, something exception handling related.
I don't know if gnustep-make has enough knowledge to distinguish between libobjc2 and libobjc, and how it's build.

It might indeed be related how the libobjc or libobjc2 was built before that we're going to link to. However, assuming that when using clang, it might be a supported clang archictecture also for libobjc2, and that libobjc2 was built with all its funky features.

Don't know if there's a variable in gnustep-make I could check otherwise, the CLANG one was the best I could find.

@rfm
Copy link
Contributor

rfm commented Mar 10, 2025

The way it's supposed to work is that clang and libobjc2 go together, and this is indicated by the use of 'ng' rather than 'gnu' in the library combo, so I guess that the addition of this flag opught to be made conditional on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants