-
Notifications
You must be signed in to change notification settings - Fork 20
Rebuild musl with --enable-debug #26
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
Conversation
|
@Algunenano could you please review this? |
| The ubuntu version 14.04 is selected for better compatibility. | ||
|
|
||
| - for `x86_64-musl` they are from https://musl.cc/. Last updated from build 23-Nov-2021 04:50 (7e2fa1cbc6b6c23d15e7b65015777e89 x86_64-linux-musl-native.tgz). | ||
| - for `x86_64-musl` they are from https://musl.cc/. Last updated from build 23-Nov-2021 04:50 (7e2fa1cbc6b6c23d15e7b65015777e89 x86_64-linux-musl-native.tgz). Binaries `crt1.o`, `crti.o`, `libc.a` are rebuilt from https://git.musl-libc.org/ (commit dd1e63c3) configured with `--enable-debug`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several issues:
- Unless it's really necessary I'd avoid using top of the HEAD as a reference, specially taking into account that the commit is about a revert. It's better to stick to a stable release.
- Please update headers and binaries together, otherwise they don't match.
- I'm guessing that you haven't setup build flags, so you are likely building an unoptimized version of musl. Please include build flags. For example the ones used in the official binaries: https://conf.musl.cc/plain_20211122_11-2-1.txt
|
I tried it, and it's not enough, clickhouse failed to unwind out of signal handler. (Specifically, I built There are multiple problems, I didn't get to the bottom of it yet, will keep looking.
Oof. |
|
If it's that incompatible with unwind I'm not sure we need it at all. |
|
Let's try to patch Musl to support stack unwinding. But if it's too hard, let's drop it. PS. It is also makes sense to look at Cosmopolitan Libc, but last time I tried, it was very immature, and cannot even build a C++ application. Even the support for pthread came out just recently. PS. There is also LLVM Libc, which is developed in Google at a dog-slow pace, and most likely not ready at all. |
|
Turns out GDB recognizes the exact machine code of this __restore_rt function ( So our options are: Claude guesses 30% probability that musl upstream would accept such patch, and 60% probability for llvm-libunwind. Sounds about right. I'll make the libunwind change. |
|
We will maintain our fork of Musl; there is no need to care about upstream; the same goes for libunwind. Actually, we want to fork Musl (to remove most of the unused functions, add instrumentation, etc). Patching libunwind is also ok. |
|
ClickHouse/libunwind#32 and ClickHouse/libunwind#33 Musl needs to be built with:
|
|
Did that in #28 |
Required rebuild with
./configure --enable-debugto produce complete backtrace.closes ClickHouse/ClickHouse#67921