-
Notifications
You must be signed in to change notification settings - Fork 85
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
Build all packages with cproc #13
Comments
Hi! I'm not an oasis user, but I'm curious - does Linux compile under cproc, or is it still clang or gcc exclusive? |
No, Linux only builds with gcc or clang. Maybe someday in the far far future, cproc would be capable enough to build it, but for now the goal is just to build the userspace packages. |
Why an additional compiler? Also, how does it optimize for both size and performance compared to gcc and clang? |
I don't quite understand your question. gcc and clang can and will continue to be able to build all of oasis, no additional compiler is needed. However, if you are asking why I'd want to be able to build the oasis userspace with a compiler written in 7000 lines of C as opposed to one written in 5 million lines of C++, then I don't really know how to answer. Of course I'd like to be able to build Linux with cproc. It just doesn't seem like a realistic goal at this point.
I haven't done much testing of this, but QBE's goal is "70% of the performance of advanced compilers in 10% of the code". So far, I've just been trying to get things to build and work (regardless of size and performance). |
I see, thanks for clarifying. I agree that having a much lighter compiler is beneficial (compilation-time wise), but aren't binaries (and the degree of optimization) what matter here, and not the compiler itself? |
The main goal of oasis is not to build the most optimized Linux system possible. It is to provide a complete system built from components that have small and approachable codebases. The compiler is just one of those components. That said, good performance is still a goal, and most of the time this falls out of using smaller implementations of software. This allows you to use a simpler compiler without sacrificing too much. The compiler you use can be configured in config.lua. You'll still be able to build gcc with whatever fancy CFLAGS you want. This issue is just about making cproc an usable option as well. |
Correction: maybe someday Linux will be compliant enough to be built with a C compiler 😉 |
Do you have any comparisons with resulting size when using cproc (wondering where it stands wrt gcc)? |
Here's a size comparison of the core packages with
This was with a local patch to qbe to put zero data in .bss instead of .data. For the most part it is pretty comparable, but there are some binaries that are quite a bit bigger when built with cproc. It'd be pretty interesting to investigate why that is. |
The mean gcc size is 7.5% smaller, though the per-program variation is large enough that 27% smaller and 12% bigger are within one standard deviation in each direction. I'd call that "pretty comparable," too. |
I'm still very excited too see where this goes if your still working on it |
TODO:
Needs VLAs. Port things to tinyalsa instead?
Needs wide string literals.
Needs atomic types.
Needs TLS. Could be ported to
pthread_key
.Done:
N/A:
The text was updated successfully, but these errors were encountered: