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

Build: Disable -static-libgcc on MacOS building #1555

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

mapleFU
Copy link
Member

@mapleFU mapleFU commented Jul 6, 2023

On MacOS clang-13, it doesn't support -static-libgcc. So the code below might get:

clang: error: unsupported option '-static-libgcc'

This patch tries to fix that. This will make LLVM Clang failed, but AppleClang will not meet the problem.

@git-hulk
Copy link
Member

git-hulk commented Jul 6, 2023

LGTM, but I'm wondering why this error didn't happen on my side.

@mapleFU
Copy link
Member Author

mapleFU commented Jul 6, 2023

@git-hulk did you get a warning like:

clang: warning: argument unused during compilation: '-static-libstdc++'

I'm not sure would it warns that

@git-hulk
Copy link
Member

git-hulk commented Jul 6, 2023

@git-hulk did you get a warning like:

clang: warning: argument unused during compilation: '-static-libstdc++'

I'm not sure would it warns that

I cannot see this warning even building from scratch.

@mapleFU
Copy link
Member Author

mapleFU commented Jul 6, 2023

✗ clang++ --static-libgcc sample.cpp -a sample.a
clang-13: error: unsupported option '--static-libgcc'; did you mean '-static-libgcc'?
clang-13: error: no such file or directory: 'sample.a'
✗ clang++ -static-libgcc sample.cpp -a sample.a 
clang-13: error: no such file or directory: 'sample.a'
clang-13: error: unsupported option '-static-libgcc'

✗ clang++ --version
Homebrew clang version 13.0.1
Target: arm64-apple-darwin21.3.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm/bin

I guess there is something wrong with clang-13 on MacOS 12.2.1 . But I didn't research about it

@git-hulk
Copy link
Member

git-hulk commented Jul 6, 2023

@mapleFU I know the reason now. Coz I'm using AppleClang Not Clang :D.

@mapleFU
Copy link
Member Author

mapleFU commented Jul 6, 2023

Oh, so that :

if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))

will not step into. So no flags would be added here. Sounds reasonable

@git-hulk
Copy link
Member

git-hulk commented Jul 6, 2023

Yes, that's right.

@mapleFU
Copy link
Member Author

mapleFU commented Jul 6, 2023

I've update the description.

@git-hulk
Copy link
Member

git-hulk commented Jul 6, 2023

Thanks all, merging...

@git-hulk git-hulk merged commit be8b904 into apache:unstable Jul 6, 2023
23 checks passed
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.

3 participants