Closed ghost closed 1 year ago
Your two issues are related.
The maketab
issue is because you configured it to build binaries for the host system (I suspect on a glibc system) with a musl cross-compiler. The not found error is referring to the interpreter of the executable not being found (i.e. /lib/ld-musl-x86_64.so.1
), not the executable itself. It's basically the same issue as if you were to try to run a script with a shebang line of #!/nonexistent/path
.
oasis supports cross-compilation, which means that if we need to build and run any tools during the build process (for example, to generate sources), they need to be built with a compiler that targets the running system, not the target system. This is the difference between the target
and host
sections in config.lua
. The build system expects that a compiler for the running system is available at cc
, which is usually the case. By symlinking it to x86_64-linux-musl-cc
, you are doing the same thing as setting host.cc
in config.lua
, which tells oasis to use x86_64-linux-musl-cc
as the compiler to build binaries for the running system.
The solution is to install a C compiler for the host system and delete the cc
symlink you created. How to do this depends on the host system. For Debian-based systems, installing the build-essential
package is sufficient.
Another option if you don't want to (or can't) install packages on the host system is to use the musl cross-compiler, but tell it to build host binaries statically. This works if the architecture of the host system matches the target system, since static binaries have no dependencies like an interpreter. You can do this by setting host.platform='x86_64-linux-musl'
in config.lua
(just like the target section), and adding -static
to host.cflags
.
Thank you so much for the detailed reply. I finally managed to get past the error. It was a tricky error to understand and debug, and I couldn't find any recent changes to the oasis repo that could have caused it. Installing build-essential ultimately did the trick. I had previously tried to install the musl and musl-tools packages, which did create cc
on the system but I was getting gcc lib errors, which confused me. I never bothered to try modifying the host.platform (host machine==target), which I now suspect was the step I was missing. So I think I was at least halfway there.
I greatly appreciate the help
I've been having some trouble building oasis from the instructions. I did a successful build a few weeks ago but now it is failing and I can't figure out why. I've been over the instructions a dozen times and it always fails in the same way
The only changes I've made to config.lua are the exact same changes suggested on the Wiki.
ninja -v commit
fails with the following error:Yet
out/pkg/awk/maketab
does indeed existAnother issue I've been running into is that
x86_64-linux-musl-{cross|native}/bin
does not contain acc
binary so I always have to symlinkbin/x86_64-linux-musl-cc
tobin/cc
. If I don't do this, I will get an error onninja commit
saying/bin/sh: 1: cc: not found
. Same result with both the cross and native packages.