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:
@@ -18,15 +18,15 @@
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
|
||||
/ Duplicates chrominance samples horizontally, e.g.
|
||||
/
|
||||
/ 12345678--------
|
||||
/ → 1122334455667788
|
||||
/
|
||||
/ @param %edi is size of %rsi array in bytes
|
||||
/ @param %rsi is char[edi/16][16] output and %rsi==%rdx is OK
|
||||
/ @param %rdx is char[edi/16][8] input
|
||||
/ @return %rax is %rsi
|
||||
// Duplicates chrominance samples horizontally, e.g.
|
||||
//
|
||||
// 12345678--------
|
||||
// → 1122334455667788
|
||||
//
|
||||
// @param %edi is size of %rsi array in bytes
|
||||
// @param %rsi is char[edi/16][16] output and %rsi==%rdx is OK
|
||||
// @param %rdx is char[edi/16][8] input
|
||||
// @return %rax is %rsi
|
||||
doublechrominance:
|
||||
.leafprologue
|
||||
.profilable
|
||||
|
||||
@@ -78,7 +78,7 @@ static const char *GetStorageSpecifier(const char *type, int *out_width,
|
||||
|
||||
static void EmitSection(long yn, long xn, int w, int arrayalign, int emit(),
|
||||
void *a) {
|
||||
char alignstr[20];
|
||||
char alignstr[21];
|
||||
uint64toarray_radix10(arrayalign, alignstr);
|
||||
if (arrayalign <= 8 && yn * xn * w == 8) {
|
||||
emit("\t.rodata.cst", a);
|
||||
@@ -105,7 +105,7 @@ void *FormatStringTableAsAssembly(long yn, long xn, const char *const T[yn][xn],
|
||||
const char *name, const char *scope) {
|
||||
int w, align;
|
||||
const char *storage;
|
||||
char ynstr[20], xnstr[20];
|
||||
char ynstr[21], xnstr[21];
|
||||
name = firstnonnull(name, "M");
|
||||
storage = GetStorageSpecifier(firstnonnull(type, "long"), &w, &align);
|
||||
uint64toarray_radix10(yn, ynstr);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
void *FormatStringTableAsCode(long yn, long xn, const char *const T[yn][xn],
|
||||
int emit(), void *arg, const char *type,
|
||||
const char *name, const char *ignored) {
|
||||
char ynstr[20], xnstr[20];
|
||||
char ynstr[21], xnstr[21];
|
||||
uint64toarray_radix10(yn, ynstr);
|
||||
uint64toarray_radix10(xn, xnstr);
|
||||
emit(type, arg);
|
||||
|
||||
Reference in New Issue
Block a user