tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[no subject]



from Kamil Rytarowski:

> I have managed to get light cross-toolchain producing Linux binaries.

> The only dependency is musl (+gmake to build it).

Is it necessary to use musl, as opposed to uClibc-ng or glibc?

Did you cross-compile from NetBSD to get the cross-toolchain, or did you need some Linux stuff already compiled?

But I believe you would need Linux kernel headers in any case.

Where do you get musl-gcc, or is it built as part of the light cross-toolchain?
        
> It works almost out of the box (I had to manually build certain files).
        
> The only think that is required to be tuned is to add a dummy gnu_debuglink.
        
> https://nxr.netbsd.org/xref/src/sys/compat/linux/common/linux_exec_elf32.c#214
        
> The kernel shall have a fallback, and probably parse .intrp string and
> look for 'ld-musl' in it.

> $ cat m.c


> #include <stdio.h>

> int
> main(int argc, char **argv)
{       
>         printf("Hello world!\n");

>         return 0;
}
> $ musl-gcc m.c


> $ objcopy --add-gnu-debuglink=/dev/null ./a.out
> $ file a.out
> a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically
> linked, interpreter /lib/ld-musl-x86_64.so.1, not stripped
> $ ./a.out


> Hello world!

> Another step is to build LTP with musl-gcc and run the tests. 
  
> https://github.com/linux-test-project/ltp (LTP supports musl)

> There will be some patches involved.
  
> The question is how to setup the tests for it? anita + picking these
> packages from pkgsrc?

> Making a setup with a syzbot instance for linux32/linux64 target should
> be not that difficult.

> Unfortunately all that needs some work in various projects, integration,
> upstreaming code (to LTP?) etc and maybe TNF could spare someone to do it.

> > Also linux_compat is getting more and more irrelevant as time pass due
> > to shortage in our futex code (lack of robust futexes).

> This is slowly worked on.


Tom


Home | Main Index | Thread Index | Old Index