Skip to content
Snippets Groups Projects
Commit 29cac208 authored by Raymond Toy's avatar Raymond Toy
Browse files

Fix #85: Let each x86 configs set optimization level

Add `COPT` variable in `Config.x86_common` to set the optimization
level (defaulting to `-O2`).  Then each `Config.x86` file can set
`COPT` as desired if the default doesn't work.

Thus, `Config.x86_linux` sets `COPT` to `-O1`, but others can use the
default value.  See issue #68.
parent d1c5289e
No related branches found
No related tags found
No related merge requests found
...@@ -45,10 +45,11 @@ endif ...@@ -45,10 +45,11 @@ endif
CPPFLAGS := $(CPP_DEFINE_OPTIONS) $(CPP_INCLUDE_OPTIONS) CPPFLAGS := $(CPP_DEFINE_OPTIONS) $(CPP_INCLUDE_OPTIONS)
CFLAGS += -Wstrict-prototypes -Wall -g -fno-omit-frame-pointer CFLAGS += -Wstrict-prototypes -Wall -g -fno-omit-frame-pointer
# gcc 8.1.1 and 8.3.1 (and probably anything after 8.1.1?) won't # Default optimization level. This can be changed in the individual
# produce a working lisp with -O2. Just use -O1. # configs.
CFLAGS += -O1 COPT = -O2
ASFLAGS = -g
ASFLAGS = -g
ASSEM_SRC = x86-assem.S ASSEM_SRC = x86-assem.S
ARCH_SRC = x86-arch.c ARCH_SRC = x86-arch.c
......
...@@ -6,6 +6,7 @@ include Config.x86_common ...@@ -6,6 +6,7 @@ include Config.x86_common
# you have the SDK available. # you have the SDK available.
MIN_VER = -mmacosx-version-min=10.6 MIN_VER = -mmacosx-version-min=10.6
CFLAGS += $(COPT)
CPPFLAGS += -DDARWIN $(MIN_VER) -m32 CPPFLAGS += -DDARWIN $(MIN_VER) -m32
CFLAGS += -g3 -mtune=generic CFLAGS += -g3 -mtune=generic
ASFLAGS += -g3 $(MIN_VER) ASFLAGS += -g3 $(MIN_VER)
......
# -*- Mode: makefile -*- # -*- Mode: makefile -*-
include Config.x86_common include Config.x86_common
# gcc 8.1.1 and 8.3.1 (and probably anything after 8.1.1?) won't
# produce a working lisp with -O2. Just use -O1.
COPT = -O1
CFLAGS += $(COPT)
CPPFLAGS += -m32 -D__NO_CTYPE -D_GNU_SOURCE CPPFLAGS += -m32 -D__NO_CTYPE -D_GNU_SOURCE
CFLAGS += -rdynamic -march=pentium4 -mfpmath=sse -mtune=generic CFLAGS += -rdynamic -march=pentium4 -mfpmath=sse -mtune=generic
......
...@@ -3,6 +3,7 @@ include Config.x86_common ...@@ -3,6 +3,7 @@ include Config.x86_common
CC = clang CC = clang
CPPFLAGS += -m32 -D__NO_CTYPE -D_GNU_SOURCE CPPFLAGS += -m32 -D__NO_CTYPE -D_GNU_SOURCE
CFLAGS += $(COPT)
CFLAGS += -march=pentium4 -mfpmath=sse -mtune=generic CFLAGS += -march=pentium4 -mfpmath=sse -mtune=generic
UNDEFSYMPATTERN = -Xlinker -u -Xlinker & UNDEFSYMPATTERN = -Xlinker -u -Xlinker &
......
# -*- Mode: makefile -*- # -*- Mode: makefile -*-
include Config.x86_common include Config.x86_common
CFLAGS += $(COPT)
CPPFLAGS += -march=pentium4 -mfpmath=sse CPPFLAGS += -march=pentium4 -mfpmath=sse
UNDEFSYMPATTERN = -Xlinker -u -Xlinker & UNDEFSYMPATTERN = -Xlinker -u -Xlinker &
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
include Config.sparc_common include Config.sparc_common
CC = cc -xlibmieee -g CC = cc -xlibmieee -g
CFLAGS += $(COPT)
CFLAGS += -Di386 CFLAGS += -Di386
CPP = cc -E CPP = cc -E
DEPEND_FLAGS = -xM1 DEPEND_FLAGS = -xM1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment