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

Guard GCC-specific macros with _COMPILER_GCC_ #44353

Merged
merged 1 commit into from
Feb 28, 2022

Conversation

giordano
Copy link
Contributor

@giordano giordano commented Feb 26, 2022

By default Clang on Linux defines the macro __GNUC__, so to guard GCC-specific
code paths it isn't sufficient to check #ifdef __GNUC__.

If @Keno confirms this was the intended check, this would fix #44352. In the meantime I can confirm I can successfully build this branch with Clang (CC=clang CXX=clang++) on Linux.

@giordano giordano added the building Build system, or building Julia or its dependencies label Feb 26, 2022
@giordano giordano requested a review from Keno February 26, 2022 02:32
src/julia_internal.h Outdated Show resolved Hide resolved
src/julia_internal.h Outdated Show resolved Hide resolved
@giordano giordano force-pushed the mg/clang-linux branch 2 times, most recently from 8f98c16 to bfb01f4 Compare February 26, 2022 02:46
@giordano giordano changed the title Guard GCC-specific macros with !defined(__clang__) Guard GCC-specific macros with _COMPILER_GCC_ Feb 26, 2022
By default Clang on Linux defines the macro `__GNUC__`, so to guard GCC-specific
code paths it isn't sufficient to check `#ifdef __GNUC__`.

Co-authored-by: Jameson Nash <vtjnash@users.noreply.github.com>
@vtjnash vtjnash merged commit bcc0f70 into JuliaLang:master Feb 28, 2022
@giordano giordano deleted the mg/clang-linux branch February 28, 2022 19:40
staticfloat pushed a commit to JuliaCI/julia-buildkite-testing that referenced this pull request Mar 2, 2022
By default Clang on Linux defines the macro `__GNUC__`, so to guard GCC-specific
code paths it isn't sufficient to check `#ifdef __GNUC__`.
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
By default Clang on Linux defines the macro `__GNUC__`, so to guard GCC-specific
code paths it isn't sufficient to check `#ifdef __GNUC__`.
@giordano giordano added the backport 1.8 Change should be backported to release-1.8 label May 19, 2022
KristofferC pushed a commit that referenced this pull request May 23, 2022
By default Clang on Linux defines the macro `__GNUC__`, so to guard GCC-specific
code paths it isn't sufficient to check `#ifdef __GNUC__`.

(cherry picked from commit bcc0f70)
@KristofferC KristofferC removed the backport 1.8 Change should be backported to release-1.8 label May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't build Julia with Clang on Linux
4 participants