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

Added Support for building on Mac OS with Clang #88

Closed
wants to merge 1 commit into from

Conversation

SZanko
Copy link

@SZanko SZanko commented Mar 16, 2022

fix: Can be compiled on Mac OS with the default system compiler(clang)

Why: Clang doesn't know the soname linker flag instead the install_name
flag is used

How: Added LINKER_SONAME_OPTION option to configure script that can be
set manually and will be set if the CC env is clang

Tags: Clang Support, Mac OS build support,

Signed-off-by: SZanko szanko@protonmail.com

fix: Can be compiled on Mac OS with the default system compiler

Why: Clang doesn't know the soname linker flag instead the install_name
flag is used

How: Added LINKER_SONAME_OPTION option to configure script that can be
set manually and will be set if the CC env is clang

Tags: Clang Support, Mac OS build support,

Signed-off-by: SZanko <szanko@protonmail.com>
@@ -113,10 +114,12 @@ command -v ${CC} 2>/dev/null 1>&2 || {
echo "${CC} not found: trying clang" 1>&2
echo "${CC} not found: trying clang" 1>&3
CC=clang
LINKER_SONAME_OPTION="-install_name"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be conditional on the type of the C compiler (and the executable name is not a reliable way to detect the type anyways), but instead the type of the linker.

Only macOS' cctools will use -install_name, but clang can also be used with GNU binutils or lld.

@judaew
Copy link

judaew commented May 29, 2022

I think we can use the shared-library OS X format instead of the UNIX-like format. This requires replacing the -shared with -dynamiclib option and file suffix .so with .dylib.

See Creating Dynamic Libraries.

judaew added a commit to macports/macports-ports that referenced this pull request May 29, 2022
@ddustin
Copy link

ddustin commented Dec 30, 2022

Looks like there's some overlap in our PRs -> #108

Any update on getting one of these through?

@kristapsdz
Copy link
Owner

kristapsdz commented Mar 26, 2023

This has been fixed in commit 0fb3e8f, which incorporates some modifications in oconfigure specific to this issue. Thank you again everybody, and I'm sorry for taking so long!

(I'll tag out a release in the next day or so that incorporates this and other pull requests.)

@kristapsdz kristapsdz closed this Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants