~mcf/cproc#62: 
Build musl libc

Current blockers:

  • long double (#3)
  • Inline asm (#5)
  • Weak references
  • Hidden visibility
Status
REPORTED
Submitter
~mcf
Assigned to
No-one
Submitted
2 years ago
Updated
2 months ago
Labels
No labels applied.

~tekk 2 months ago

The makefile now uses -fPIC by default as well.

~mcf 2 months ago

It only uses -fPIC when it detects that the compiler enables it by default. Since cproc is using gcc as a preprocessor, if gcc is built with --enable-default-pie it defines __PIC__ by default, which is not correct since qbe doesn't generate position-independent code.

I pushed a couple of commits to fix this. Now, you should be able to do CC=cproc ./configure --target=x86_64-linux-musl && make -k lib/libc.a to see all the errors.

There are only a handful of unique errors, but these are all major features that need support from QBE (apart from _Complex maybe):

$ make -k lib/libc.a 2>&1 | grep -e error: -e cproc-qbe: | sort -u
./arch/x86_64/atomic_arch.h:3:2: error: inline assembly is not yet supported
./arch/x86_64/syscall_arch.h:6:2: error: inline assembly is not yet supported
./include/complex.h:16:8: error: _Complex is not yet supported
cproc-qbe: long double is not yet supported
src/network/if_nameindex.c:95:52: error: VLAs are not yet supported
src/process/execl.c:12:20: error: VLAs are not yet supported
src/process/execle.c:12:20: error: VLAs are not yet supported
src/process/execlp.c:12:20: error: VLAs are not yet supported
src/process/execvp.c:29:15: error: VLAs are not yet supported
src/search/lsearch.c:6:17: error: VLAs are not yet supported
src/string/explicit_bzero.c:6:2: error: inline assembly is not yet supported
$
Register here or Log in to comment, or comment via email.