Support for musl library#483
Conversation
Allows to use different buffer sizes for getdents.
| @@ -1312,6 +1388,8 @@ int main(int argc, char **argv, char **envp) { | |||
| case UcLibc: | |||
| mainModule = linkWithUclibc(mainModule, LibraryDir); | |||
There was a problem hiding this comment.
Replace the code with: mainModule = linkWithMusllibc(mainModule, LibraryDir); to use musllibc instead of uclibc for testing.
|
Here is the repository for the musl libc: https://github.com/MartinNowack/klee-musl By the way, test suite should pass if musl is selected as default library (See code comment). |
|
Thanks, @MartinNowack ! @mdimjasevic, is this in line with what you were trying? |
| } | ||
| #endif | ||
|
|
||
|
|
There was a problem hiding this comment.
I guess you should guard it with "#ifndef SUPPORT_KLEE_UCLIBC"
|
@ccadar : I believe it's very close, much closer than I managed to get it on my own! However, I believe there are more changes to be done to KLEE to support Musl. You can see I make changes to more files than @MartinNowack in this pull request: mdimjasevic@367543b This includes changes to configuration files in KLEE. I believe it's better to have them and not pretend Musl is KLEE-uClibc with a different location on the file system. That being said, with a manual tweak or two after compiling this, I am able to run KLEE on the hostname utility. I wanted to confirm I can get rid of an earlier false bug due to a missing function implementation in KLEE-uClibc: $ ~/research/klee-mnowack-support-for-musl/Release+Asserts/bin/klee -libc=musllibc -posix-runtime hostname -A KLEE: done: total instructions = 316958 Therefore, I can get this running. I guess the particular error reported by KLEE is to say we'd need to do more massaging of KLEE-Musl by @MartinNowack. |
|
@mdimjasevic I know, the configuration are still missing. But it is trivial to add. This patch is just a WIP. |
|
@MartinNowack , yes, I used the |
|
Given the age of the PR, I will close it, but place it in the Extensions project at https://github.com/klee/klee/projects/4, so that others can build up on it if there is interest. |
Initial support for executing KLEE using musl library.
Similar to uclibc (
--libc=uclib), use--libc=musllibc.To be able to use it, put a link to the musllibc bc file into your
Release+Asserts/libdirectory.This will be automated soon.
@mdimjasevic This should get you going. Please try it out.
If you see any issues, let me know.