Get codebase completely working with LLVM
You can now build Cosmopolitan with Clang:
make -j8 MODE=llvm
o/llvm/examples/hello.com
The assembler and linker code is now friendly to LLVM too.
So it's not needed to configure Clang to use binutils under
the hood. If you love LLVM then you can now use pure LLVM.
This commit is contained in:
@ -26,6 +26,7 @@
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/log/check.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/macros.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
@ -282,7 +283,7 @@ static void printelfrelocations(void) {
|
||||
GetElfSectionHeaderAddress(elf, st->st_size, shdr->sh_info)
|
||||
->sh_name),
|
||||
rela->r_offset, symbolname, rela->r_addend >= 0 ? '+' : '-',
|
||||
abs(rela->r_addend));
|
||||
ABS(rela->r_addend));
|
||||
printf("%s_%zu_%zu:\n", ".Lrela", i, j);
|
||||
show(".quad", format(b1, "%#lx", rela->r_offset), "rela->r_offset");
|
||||
show(".long",
|
||||
|
||||
@ -47,8 +47,8 @@ kPollNamesRo:
|
||||
.endobj kPollNamesRo,globl,hidden
|
||||
.previous
|
||||
|
||||
/ Mapping of poll() flags to their string names.
|
||||
/ @see RecreateFlags()
|
||||
// Mapping of poll() flags to their string names.
|
||||
// @see RecreateFlags()
|
||||
.initbss 301,_init_kPollNames
|
||||
kPollNames:
|
||||
.rept .Lrows
|
||||
@ -62,10 +62,11 @@ kPollNames:
|
||||
.init.start 301,_init_kPollNames
|
||||
pushpop .Lrows,%rcx # relocate RO→BSS b/c -fPIE crap
|
||||
0: lodsl
|
||||
mov (%rbx,%rax),%rax # read what systemfive.S decoded
|
||||
.weak _base
|
||||
mov _base(%rax),%rax # read what systemfive.S decoded
|
||||
stosq
|
||||
lodsl
|
||||
add %rbx,%rax # %rbx is image base (cosmo abi)
|
||||
add $_base,%rax
|
||||
stosq
|
||||
.loop 0b
|
||||
add $16,%rdi
|
||||
|
||||
Reference in New Issue
Block a user