Doing minimal linux system setup with mkroot and trying to create a minimal 
environment
with a native toolchain to run autoconf in. This would mean getting the native 
static
toolchain for my architecture from 
https://landley.net/toybox/downloads/binaries/toolchains/latest/.
Mounting the image (Why are cross compilers tarballs while native compilers are 
fs images?
Wouldn't making them tarballs mean that you could extract their contents 
without running
losetup and dealing with mounting devices and needing root permissions ? I 
trust they were
made fs images for a good reason, but... _why_). And ideally running a mkroot 
overlay on
it because that's what the overlays seem to be made for, but...:

/sbin/cp: cannot overwrite non-directory '[Path to root/host/fs]/././lib' with 
directory '[Path to toolchain]//./lib'

It's whining that It's trying to copy a directory to a symlink of a directory.
A working but non-viable solution is to use rsync -Ka (You also need 
--exclude=usr
when copying the native toolchain, maybe a CPFLAGS for the overlay?).
But rsync is non-standard. Have you considered or ran into this problem before?

Then even after that, it whines that cc1 isn't there because it didn't copy the
usr/ symlink:

# echo 'int main() {printf("123\n");}' | gcc -xc -
gcc: fatal error: cannot execute 'cc1': execvp: No such file or directory
compilation terminated.

Because it's trying to exec /usr/x86_64-linux-musl/bin/cc1, which we _can't 
copy_
for multiple reasons. Okay, linking them manually on the host image. Now I'm 
able
to use the compiler. The configure script for the thing I'm working with fails
(something about the read builtin), but I can remedy with my host bash copying
package for now.

Is running a compiler under mkroot a goal, and if so why haven't you made a 
package
for it? (I'm assuming this is a MUCH larger and more complex issue than I was 
originally
expecting, but still something to just copy the native toolchain to the 
filesystem isn't
hard (It is if you are doing it with raw overlays, but not if you have bash 
scripting at
your disposal)) Is it a situation where it's a TODO item and just not ready yet?

-   Oliver Webb <aquahobby...@proton.me>
    
_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to