From 82bf2c727ba1d3c461fa360aaae176608eb9349b Mon Sep 17 00:00:00 2001 From: Raymond Toy Date: Sat, 25 Aug 2018 16:51:35 -0700 Subject: [PATCH] Add support for compiling with clang on x86/linux Add `Config.x86_linux_clang` to use clang instead of gcc to build cmucl. update `create-target.sh` so that it sets the motif variant correctly when using `Config.x86_linux_clang` See issue #68. With this config, Fedora 28 successfully builds cmucl and passes all the tests. --- bin/create-target.sh | 2 +- src/lisp/Config.x86_linux_clang | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/lisp/Config.x86_linux_clang diff --git a/bin/create-target.sh b/bin/create-target.sh index 400a2e52b..c1b763056 100755 --- a/bin/create-target.sh +++ b/bin/create-target.sh @@ -83,7 +83,7 @@ case $uname_s in hp700*) motif_variant=hpux_cc ;; pmax_mach) motif_variant=pmax_mach ;; sgi*) motif_variant=irix ;; - x86_linux|linux*) motif_variant=x86 ;; + x86_linux*|linux*) motif_variant=x86 ;; esac } [ -f src/motif/server/Config.$motif_variant ] || quit "No such motif-variant could be found: Config.$motif_variant" diff --git a/src/lisp/Config.x86_linux_clang b/src/lisp/Config.x86_linux_clang new file mode 100644 index 000000000..cbfb4306a --- /dev/null +++ b/src/lisp/Config.x86_linux_clang @@ -0,0 +1,15 @@ +# -*- Mode: makefile -*- +include Config.x86_common + +CC = clang +CPPFLAGS += -m32 -D__NO_CTYPE -D_GNU_SOURCE +CFLAGS += -march=pentium4 -mfpmath=sse -mtune=generic + +UNDEFSYMPATTERN = -Xlinker -u -Xlinker & +ASSEM_SRC += linux-stubs.S +OS_SRC += Linux-os.c elf.c +OS_LIBS = -ldl +OS_LINK_FLAGS = -m32 -rdynamic -Xlinker --export-dynamic -Xlinker -Map -Xlinker foo +OS_LINK_FLAGS += -Wl,-z,noexecstack + +EXEC_FINAL_OBJ = exec-final.o -- 2.18.1