update CFLAGS etc a bit

This commit is contained in:
PoroCYon 2020-05-03 19:07:18 +02:00 committed by PoroCYon
parent 4389c2e0a1
commit 5c38b05c85
1 changed files with 7 additions and 1 deletions

View File

@ -14,7 +14,8 @@ BITS ?= $(shell getconf LONG_BIT)
COPTFLAGS=-Os -fno-plt -fno-stack-protector -fno-stack-check -fno-unwind-tables \ COPTFLAGS=-Os -fno-plt -fno-stack-protector -fno-stack-check -fno-unwind-tables \
-fno-asynchronous-unwind-tables -fomit-frame-pointer -ffast-math -no-pie \ -fno-asynchronous-unwind-tables -fomit-frame-pointer -ffast-math -no-pie \
-fno-pic -fno-PIE -m64 -march=core2 -ffunction-sections -fdata-sections -fno-plt -fno-pic -fno-PIE -ffunction-sections -fdata-sections -fno-plt \
-fmerge-all-constants -mno-fancy-math-387 -mno-ieee-fp
CXXOPTFLAGS=$(COPTFLAGS) -fno-exceptions \ CXXOPTFLAGS=$(COPTFLAGS) -fno-exceptions \
-fno-rtti -fno-enforce-eh-specs -fnothrow-opt -fno-use-cxa-get-exception-ptr \ -fno-rtti -fno-enforce-eh-specs -fnothrow-opt -fno-use-cxa-get-exception-ptr \
-fno-implicit-templates -fno-threadsafe-statics -fno-use-cxa-atexit -fno-implicit-templates -fno-threadsafe-statics -fno-use-cxa-atexit
@ -25,10 +26,15 @@ CXXFLAGS=-Wall -Wextra -Wpedantic -std=c++11 $(CXXOPTFLAGS) -nostartfiles -fno-P
ASFLAGS=-I $(SRCDIR)/ ASFLAGS=-I $(SRCDIR)/
LDFLAGS_ := LDFLAGS_ :=
ifeq ($(BITS),32) ifeq ($(BITS),32)
# I think prescott is basically nocona but 32-bit only, althought I'm not sure
# if this one is optimal
CFLAGS += -m32 -march=prescott
LDFLAGS += -m32 LDFLAGS += -m32
ASFLAGS += -f elf32 ASFLAGS += -f elf32
LDFLAGS_ := -m32 LDFLAGS_ := -m32
else else
# I've heard nocona gets slightly smaller binaries than core2
CFLAGS += -m64 -march=nocona
LDFLAGS += -m64 LDFLAGS += -m64
ASFLAGS += -f elf64 ASFLAGS += -f elf64
LDFLAGS_ := -m64 LDFLAGS_ := -m64