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

Experiment with minimized toolchain (2) #29974

Merged
merged 15 commits into from
Oct 11, 2021
Merged

Conversation

alexey-milovidov
Copy link
Member

@alexey-milovidov alexey-milovidov commented Oct 11, 2021

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Leave only required files in cross-compile toolchains. Include them as submodules (earlier they were downloaded as tarballs).

Motivation:

@robot-clickhouse robot-clickhouse added the pr-build Pull request with build/testing/packaging improvement label Oct 11, 2021
@robot-ch-test-poll4 robot-ch-test-poll4 added the submodule changed At least one submodule changed in this PR. label Oct 11, 2021
@alexey-milovidov
Copy link
Member Author

We will be able to add protoc and llvm-tblgen there and enable more libraries.

@@ -0,0 +1,32 @@
set (CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
Copy link
Collaborator

Choose a reason for hiding this comment

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

But where have you set CMAKE_TOOLCHAIN_FILE to this toolchain file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently in command line.

I've just tested that it works. I plan to also set it by default either in CMakeLists.txt on top or in PreLoad.cmake if the former is not possible.

@alexey-milovidov
Copy link
Member Author

Special build check Ok.

Something strange with PVS-Studio...

@alexey-milovidov
Copy link
Member Author

Fixed PVS-Studio.

@alexey-milovidov
Copy link
Member Author

I've found how to build protoc for host system instead of target system during cross-compile.
It requires recursive invocation of cmake and it is done this way for llvm-tblgen.

@alexey-milovidov
Copy link
Member Author

I've successfully built AArch64 binary with all the enabled libraries (LLVM, MySQL, Protobuf, GRPC, Parquet/ORC/Avro).

Most likely it's due to the fact that I have QEMU with binfmt-misc and AArch64 glibc installed,
and protoc works even compiled for target arch.

@alexey-milovidov alexey-milovidov self-assigned this Oct 11, 2021
@alexey-milovidov alexey-milovidov merged commit f1b550c into master Oct 11, 2021
@alexey-milovidov alexey-milovidov deleted the minimized-toolchain branch October 11, 2021 19:04
@alexey-milovidov
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-build Pull request with build/testing/packaging improvement submodule changed At least one submodule changed in this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants