Open brenhinkeller opened 1 year ago
The -pg
and -mnop-mcount
are for profiling, so they can be left out. I am using the following flags with my clang (variant). They are basically the same as the ones given for gcc separated, to build .o files and link them separately and DEPENDENCY_DIR
is were I installed cosmopolitan
into:
# nostdlib is not just a linker flag!
COSMOPOLITAN_CFLAGS="\
-static \
-nostdinc \
-nostdlib \
-D__STDC_NO_THREADS__ \
-isysroot '${DEPENDENCY_DIR}' \
-fno-omit-frame-pointer \
-fno-pie \
-gdwarf-4 \
-mno-red-zone \
-mno-tls-direct-seg-refs"
COSMOPOLITAN_LDFLAGS="\
-fuse-ld=bfd \
-gdwarf-4 \
-no-pie \
-nostdlib \
-Wl,-T,'${DEPENDENCY_DIR}/lib/ape.lds' \
-Wl,--gc-sections"
COSMOPOLITAN_OBJECTS="\
-Wl,'${DEPENDENCY_DIR}/lib/crt.o' \
-Wl,'${DEPENDENCY_DIR}/lib/ape-no-modify-self.o' \
-Wl,'${DEPENDENCY_DIR}/lib/cosmopolitan.a'"
Hi folks. Awesome project! I was wondering if it might be possible to document somewhere an example of the
clang
equivalent to the simplegcc
example given in the readme, i.e.:I understand that clang should in principle be an option here, but if I just try to substitute
clang
in forgcc
here, I get various errors about unsupported flags, includingWhat would I have to change to get this to work with
clang
instead?