Repository navigation
Add NetBSD support - #1972
Add NetBSD support#1972
Conversation
Mostly picking the same paths as FreeBSD. We need a little special handling for crt files, as netbsd uses its own (and not GCC's) for those, with slightly different names.
|
I haven't found out whether it's safe to do bc10382#diff-3ce0315ddf9ec17d0e8a5f5a4fcaf8b7R286 but it hasn't bitten me yet |
|
Thanks for sending the patch upstream! I enjoyed reading your blog article. I'll have time to go over this pull request tomorrow (Monday). Can you confirm that you double checked all the structs and function prototypes with your system header files (as opposed to copying them straight from FreeBSD)? It's OK if you didn't - we can either delete the not-double-checked ones if they're unused, or I don't mind doing it, I'll just have to rent a VPN for an hour. I just want to avoid something like 7a4ed10 which was not a straightforward debug process. |
|
I believe |
|
Yes, I reviewed all the structs and defines rather than copying. |
|
Great work! Thanks for your contribution. Looks like we need to go add a new column to the README support table, thanks to you. (done) |
| pub const EBADF = 9; // Bad file descriptor | ||
| pub const ECHILD = 10; // No child processes | ||
| pub const EDEADLK = 11; // Resource deadlock avoided | ||
| // 11 was EAGAIN |
There was a problem hiding this comment.
What do you mean "was"? It seems to be 35 now.
When did it change? Why did it change?
There was a problem hiding this comment.
It is a comment from the original file in /usr/include/sys/errno.h, same thing on OpenBSD.
| pub const ELOOP = 62; // Too many levels of symbolic links | ||
| pub const ENAMETOOLONG = 63; // File name too long | ||
|
|
||
| // should be rearranged |
There was a problem hiding this comment.
Meaning of this comment?
There was a problem hiding this comment.
Sorry, I pulled it straight out of the errno.h header in netbsd. I assumed the comments are going to be meaningful, but missed that this one isn't
Mostly picking the same paths as FreeBSD.
We need a little special handling for crt files, as netbsd uses its
own (and not GCC's) for those, with slightly different names.
While running the tests I think it's building the self-hosted zig, I had to explicitly link against /usr/lib/libstdc++.a:
env LD_LIBRARY_PATH=/usr/pkg/lib /home/fly/zig/build/bin/zig build-exe /home/fly/zig/src-self-hosted/main.zig --object /home/fly/zig/build/zig_cpp/libzig_cpp.a --object /home/fly/zig/build/zig_cpp/libembedded_lld_wasm.a --object /home/fly/zig/build/zig_cpp/libembedded_lld_elf.a --object /home/fly/zig/build/zig_cpp/libembedded_lld_coff.a --object /home/fly/zig/build/zig_cpp/libembedded_lld_lib.a --cache-dir /home/fly/zig/zig-cache --output /home/fly/zig/zig-cache/zig --name zig --library c --library LLVM-7 -isystem /home/fly/zig/src -isystem /home/fly/zig/build --object /usr/lib/libstdc++.a -isystem /usr/pkg/include --library-path /usr/pkg/lib
Otherwise it was emitting errors like:
(Also, the LD_LIBRARY_PATH is a substitute for an RPATH for libLLVM-7.so)