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:
@ -20,8 +20,6 @@ CONFIG_CCFLAGS += \
|
||||
TARGET_ARCH ?= \
|
||||
-msse3
|
||||
|
||||
RAGELFLAGS ?= -G2
|
||||
|
||||
endif
|
||||
|
||||
# Optimized Mode
|
||||
@ -48,8 +46,6 @@ CONFIG_CCFLAGS += \
|
||||
TARGET_ARCH ?= \
|
||||
-march=native
|
||||
|
||||
RAGELFLAGS ?= -G2
|
||||
|
||||
endif
|
||||
|
||||
# Release Mode
|
||||
@ -73,8 +69,6 @@ CONFIG_CCFLAGS += \
|
||||
$(BACKTRACES) \
|
||||
-O2
|
||||
|
||||
RAGELFLAGS = -G2
|
||||
|
||||
endif
|
||||
|
||||
# Debug Mode
|
||||
@ -247,6 +241,23 @@ TARGET_ARCH ?= \
|
||||
-msse3
|
||||
endif
|
||||
|
||||
# LLVM Mode
|
||||
ifeq ($(MODE), llvm)
|
||||
TARGET_ARCH ?= -msse3
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) $(FTRACE) -O2
|
||||
AS = clang
|
||||
CC = clang
|
||||
CXX = clang++
|
||||
CXXFILT = llvm-c++filt
|
||||
LD = ld.lld
|
||||
NM = llvm-nm
|
||||
GCC = clang
|
||||
STRIP = llvm-strip
|
||||
OBJCOPY = llvm-objcopy
|
||||
OBJDUMP = llvm-objdump
|
||||
ADDR2LINE = llvm-addr2line
|
||||
endif
|
||||
|
||||
# ANSI Mode
|
||||
#
|
||||
# These flags cause GCC to predefine __STRICT_ANSI__. Please be warned
|
||||
|
||||
Reference in New Issue
Block a user