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:
@@ -94,10 +94,11 @@ static char *DisError(struct Dis *d, char *p) {
|
||||
}
|
||||
|
||||
static char *DisAddr(struct Dis *d, char *p) {
|
||||
if (-0x80000000 <= d->addr && d->addr <= 0x7fffffff) {
|
||||
return p + uint64toarray_fixed16(d->addr, p, 32);
|
||||
int64_t x = d->addr;
|
||||
if (-2147483648 <= x && x <= 2147483647) {
|
||||
return p + uint64toarray_fixed16(x, p, 32);
|
||||
} else {
|
||||
return p + uint64toarray_fixed16(d->addr, p, 48);
|
||||
return p + uint64toarray_fixed16(x, p, 48);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
.long \linux
|
||||
.endm
|
||||
|
||||
/ Lookup table translating errnos between systems.
|
||||
/
|
||||
/ @see libc/sysv/systemfive.S
|
||||
// Lookup table translating errnos between systems.
|
||||
//
|
||||
// @see libc/sysv/systemfive.S
|
||||
.rodata
|
||||
.align 8
|
||||
kLinuxErrnos:
|
||||
|
||||
@@ -65,7 +65,11 @@ static unsigned GetSpacePrefixLen(const char *p, size_t n) {
|
||||
static unsigned GetSpaceStarPrefixLen(const char *p, size_t n) {
|
||||
int i;
|
||||
i = GetSpacePrefixLen(p, n);
|
||||
return i < n && (p[i] == '*' || p[i] == '/') ? i + 1 : 0;
|
||||
if (i < n && (p[i] == '*' || p[i] == '/')) {
|
||||
return p[i + 1] == '/' ? i + 2 : i + 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned GetTagLen(const char *p, size_t n) {
|
||||
|
||||
Reference in New Issue
Block a user