Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OpenBSD to build with clang, #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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.

2 participants