Skip to content

Initial support for risc-v#31309

Merged
alexey-milovidov merged 2 commits intoClickHouse:masterfrom
Civil:riscv
Nov 12, 2021
Merged

Initial support for risc-v#31309
alexey-milovidov merged 2 commits intoClickHouse:masterfrom
Civil:riscv

Conversation

@Civil
Copy link
Copy Markdown
Contributor

@Civil Civil commented Nov 11, 2021

Make ClickHouse compilable and runnable on risc-v 64

So far only basic functionality was tested (on real hw),
clickhouse server runs, exceptions works, client works,
simple tests works.

What doesn't work:

  1. traces - they are always empty
  2. system.stack_trace only have first frame

What might cause problems: jemalloc's header seems to have too many custom changes (not documented) so it is based on aarch64 version and not actually autogenerated.

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Initial support for risc-v. See development/build-cross-riscv for quirks and build command that was tested.

Detailed description / Documentation draft: N/A
...

Make ClickHouse compilable and runnable on risc-v 64

So far only basic functionality was tested (on real hw),
clickhouse server runs, exceptions works, client works,
simple tests works.

What doesn't work:
 1. traces - they are always empty
 2. system.stack_trace only have first frame
@robot-clickhouse robot-clickhouse added the pr-improvement Pull request with some product improvements label Nov 11, 2021
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Nov 11, 2021

CLA assistant check
All committers have signed the CLA.

@alexey-milovidov alexey-milovidov self-assigned this Nov 11, 2021
@robot-clickhouse robot-clickhouse added pr-build Pull request with build/testing/packaging improvement and removed pr-improvement Pull request with some product improvements labels Nov 11, 2021
@robot-ch-test-poll3 robot-ch-test-poll3 added the submodule changed At least one submodule changed in this PR. label Nov 11, 2021
@Civil
Copy link
Copy Markdown
Contributor Author

Civil commented Nov 11, 2021

$ ./clickhouse-server 
Processing configuration file 'config.xml'.
There is no file 'config.xml', will use embedded config.
Logging trace to console
2021.11.11 00:39:45.791961 [ 419 ] {} <Information> SentryWriter: Sending crash reports is disabled
2021.11.11 00:39:46.067561 [ 419 ] {} <Trace> Pipe: Pipe capacity is 1.00 MiB
2021.11.11 00:43:07.059250 [ 419 ] {} <Information> : Starting ClickHouse 21.11.1.1 with revision 54456, build id: 02343D91746A6CF99BB8FDC838B0C228D9F2038E, PID 419
2021.11.11 00:43:07.059566 [ 419 ] {} <Information> Application: starting up
2021.11.11 00:43:07.088947 [ 419 ] {} <Information> Application: OS name: Linux, version: 5.13.0-rc6-starlight-g0b0891d87792, architecture: riscv64
<...>
2021.11.11 00:43:50.211485 [ 419 ] {} <Information> Application: Available RAM: 7.05 GiB; physical cores: 2; logical cores: 2.
2021.11.11 00:43:50.211955 [ 622 ] {} <Debug> DNSResolver: Updating DNS cache
2021.11.11 00:43:50.212544 [ 622 ] {} <Debug> DNSResolver: Updated DNS cache
2021.11.11 00:43:50.214694 [ 419 ] {} <Information> Application: Ready for connections.

(that was based on version I was initially working on, however current one also builds and runs, it just take some time for my board to start clickhouse-server, mostly due to slow sdcard).

@Civil
Copy link
Copy Markdown
Contributor Author

Civil commented Nov 11, 2021

And for the context: lld doesn't work as of now, as it misses support for riscv relaxation for R_RISCV_ALIGN. For the context there is a great blog article.

There are several attempts to implement it:

But as far as I understand all of them are stall at this moment.

@Civil
Copy link
Copy Markdown
Contributor Author

Civil commented Nov 11, 2021

Performance of that build was not tested as the board I have is not very suitable for that (based on pre-production SoC and therefore not suitable for any performance testing)

@alexey-milovidov alexey-milovidov merged commit b1f177e into ClickHouse:master Nov 12, 2021
@Civil Civil deleted the riscv branch November 12, 2021 20:51
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.

5 participants