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

Fix build on clang & libc++ #169

Merged
merged 1 commit into from
Apr 18, 2022

Conversation

DavidKeller
Copy link
Contributor

Do not link with gcc & libstdc++ support libraries when going with clang & libc++.

Signed-off-by: David Keller david@woorton.com

@CLAassistant
Copy link

CLAassistant commented Apr 11, 2022

CLA assistant check
All committers have signed the CLA.

@filimonov
Copy link
Collaborator

Can you please sign the CLA?

BUILDING_WITH_LIB_STDCXX)

IF (BUILDING_WITH_LIB_STDCXX)
# there is a problem with __builtin_mul_overflow call at link time
Copy link
Collaborator

@Enmk Enmk Apr 13, 2022

Choose a reason for hiding this comment

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

Just a wild idea: maybe check if compilation fails when __builtin_mul_overflow is used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it crossed my mind, but what about the other workarounds within the same IF () block ?

# some workaround for linking issues on linux:
# /usr/bin/ld: CMakeFiles/simple-test.dir/main.cpp.o: undefined reference to symbol '_Unwind_Resume@@GCC_3.0'
# /usr/bin/ld: /lib/x86_64-linux-gnu/libgcc_s.so.1: error adding symbols: DSO missing from command line
# FIXME: that workaround breaks clang build on mingw
TARGET_LINK_LIBRARIES (clickhouse-cpp-lib gcc_s)
TARGET_LINK_LIBRARIES (clickhouse-cpp-lib-static gcc_s)

Should I move these into a dedicated IF () / ENDIF () block with a condition on simple-test.dir/main.cpp compilation ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, please

Do not link with gcc & libstdc++ support libraries when going
with clang & libc++.

Signed-off-by: David Keller <david@woorton.com>
@DavidKeller DavidKeller force-pushed the feature/clang-and-libc++ branch from 9b6aa3d to 1db88fb Compare April 13, 2022 10:36
@Enmk Enmk merged commit 87fc118 into ClickHouse:master Apr 18, 2022
@DavidKeller DavidKeller deleted the feature/clang-and-libc++ branch July 28, 2022 09:06
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.

5 participants