From 6dddf61265e5d3ab192f52c2457fbeaac37b1366 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 27 Dec 2018 00:56:33 -0500 Subject: [PATCH 1/6] Target nocona for 64-bit builds --- src/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Makefile b/src/Makefile index fbf75f26..74c86d91 100644 --- a/src/Makefile +++ b/src/Makefile @@ -294,6 +294,9 @@ else M5=-mpentium M4=-m486 endif +else + M5=-march=nocona + M4=-mnocona endif ifndef NOASM From 4a05fd5f269bfd6f50a833e030dcb3928f86acff Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 27 Dec 2018 18:54:10 -0500 Subject: [PATCH 2/6] More explict check --- src/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 74c86d91..37f883e6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -104,6 +104,7 @@ endif ifdef LINUX64 LINUX=1 NONX86=1 +64BIT=1 endif ifdef HAIKU @@ -178,6 +179,7 @@ endif #ifdef MINGW ifdef MINGW64 MINGW=1 +64BIT=1 include win32/Makefile.cfg endif #ifdef MINGW64 @@ -289,14 +291,13 @@ OPTS += -DCOMPVERSION ifndef NONX86 ifndef GCC29 M5=-march=pentium - M4=-march=i486 else M5=-mpentium - M4=-m486 endif -else +endif + +ifdef 64BIT M5=-march=nocona - M4=-mnocona endif ifndef NOASM From 5ba086387682b49c7250185a7e5999e1b5cee4b8 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 27 Dec 2018 19:00:18 -0500 Subject: [PATCH 3/6] Stupid restrictions --- src/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 37f883e6..a6f38ed2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -104,7 +104,7 @@ endif ifdef LINUX64 LINUX=1 NONX86=1 -64BIT=1 +X86_64=1 endif ifdef HAIKU @@ -179,7 +179,7 @@ endif #ifdef MINGW ifdef MINGW64 MINGW=1 -64BIT=1 +X86_64=1 include win32/Makefile.cfg endif #ifdef MINGW64 @@ -296,7 +296,7 @@ else endif endif -ifdef 64BIT +ifdef X86_64 M5=-march=nocona endif From d048e7cbec2628aa54414372990e0828a26454c1 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 27 Dec 2018 21:17:02 -0500 Subject: [PATCH 4/6] Don't set if LINUX64 is defined --- src/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index a6f38ed2..7ca07862 100644 --- a/src/Makefile +++ b/src/Makefile @@ -104,7 +104,6 @@ endif ifdef LINUX64 LINUX=1 NONX86=1 -X86_64=1 endif ifdef HAIKU From 4cfacf5cdeb685f7005cd62b748dfda6b9f7fdb7 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sat, 29 Dec 2018 21:14:50 -0500 Subject: [PATCH 5/6] Check for NONX86 in addition to X86_64; move MINGW64 subflags from win32/Makefile.cfg to Makefile --- src/Makefile | 26 +++++++++++++++----------- src/win32/Makefile.cfg | 2 -- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/Makefile b/src/Makefile index 7ca07862..bfce9cda 100644 --- a/src/Makefile +++ b/src/Makefile @@ -104,8 +104,18 @@ endif ifdef LINUX64 LINUX=1 NONX86=1 +# LINUX64 does not imply X86_64=1; could mean ARM64 or Itanium endif +ifdef MINGW64 +MINGW=1 +NONX86=1 +NOASM=1 +# MINGW64 should not necessarily imply X86_64=1, but we make that assumption elsewhere +# Once that changes, remove this +X86_64=1 +endif #ifdef MINGW64 + ifdef HAIKU SDL=1 endif @@ -176,12 +186,6 @@ ifdef MINGW include win32/Makefile.cfg endif #ifdef MINGW -ifdef MINGW64 -MINGW=1 -X86_64=1 -include win32/Makefile.cfg -endif #ifdef MINGW64 - ifdef UNIX UNIXCOMMON=1 endif @@ -289,14 +293,14 @@ OPTS += -DCOMPVERSION ifndef NONX86 ifndef GCC29 - M5=-march=pentium + M5?=-march=pentium else - M5=-mpentium + M5?=-mpentium endif -endif - +else ifdef X86_64 - M5=-march=nocona + M5?=-march=nocona +endif endif ifndef NOASM diff --git a/src/win32/Makefile.cfg b/src/win32/Makefile.cfg index a73858bd..def2fe68 100644 --- a/src/win32/Makefile.cfg +++ b/src/win32/Makefile.cfg @@ -7,8 +7,6 @@ # ifdef MINGW64 - NOASM=1 - NONX86=1 HAVE_LIBGME=1 LIBGME_CFLAGS=-I../libs/gme/include LIBGME_LDFLAGS=-L../libs/gme/win64 -lgme From 3d2e58861d11b593256ea1c0c4fb7d4edfa48134 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sat, 29 Dec 2018 21:55:13 -0500 Subject: [PATCH 6/6] Rename M5 to ARCHOPTS; allow override by command line --- src/Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Makefile b/src/Makefile index bfce9cda..c894203a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -293,13 +293,13 @@ OPTS += -DCOMPVERSION ifndef NONX86 ifndef GCC29 - M5?=-march=pentium + ARCHOPTS?=-march=pentium else - M5?=-mpentium + ARCHOPTS?=-mpentium endif else ifdef X86_64 - M5?=-march=nocona + ARCHOPTS?=-march=nocona endif endif @@ -428,7 +428,7 @@ else WINDRESFLAGS = -DNDEBUG CFLAGS+=-O3 endif - CFLAGS+=-g $(OPTS) $(M5) $(WINDRESFLAGS) + CFLAGS+=-g $(OPTS) $(ARCHOPTS) $(WINDRESFLAGS) ifdef YASM ifdef STABS @@ -916,15 +916,15 @@ endif ifndef NOHS $(OBJDIR)/s_ds3d.o: hardware/s_ds3d/s_ds3d.c hardware/hw3dsdrv.h \ hardware/hw_dll.h - $(CC) $(M5) -Os -o $(OBJDIR)/s_ds3d.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_ds3d/s_ds3d.c + $(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_ds3d.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_ds3d/s_ds3d.c $(OBJDIR)/s_fmod.o: hardware/s_openal/s_openal.c hardware/hw3dsdrv.h \ hardware/hw_dll.h - $(CC) $(M5) -Os -o $(OBJDIR)/s_fmod.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_fmod/s_fmod.c + $(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_fmod.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_fmod/s_fmod.c $(OBJDIR)/s_openal.o: hardware/s_openal/s_openal.c hardware/hw3dsdrv.h \ hardware/hw_dll.h - $(CC) $(M5) -Os -o $(OBJDIR)/s_openal.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_openal/s_openal.c + $(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_openal.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_openal/s_openal.c endif endif endif @@ -954,11 +954,11 @@ else $(OBJDIR)/s_fmod.o: hardware/s_fmod/s_fmod.c hardware/hw3dsdrv.h \ hardware/hw_dll.h - $(CC) $(M5) -Os -o $(OBJDIR)/s_fmod.o -DHW3SOUND -DUNIXCOMMON -shared -nostartfiles -c hardware/s_fmod/s_fmod.c + $(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_fmod.o -DHW3SOUND -DUNIXCOMMON -shared -nostartfiles -c hardware/s_fmod/s_fmod.c $(OBJDIR)/s_openal.o: hardware/s_openal/s_openal.c hardware/hw3dsdrv.h \ hardware/hw_dll.h - $(CC) $(M5) -Os -o $(OBJDIR)/s_openal.o -DHW3SOUND -DUNIXCOMMON -shared -nostartfiles -c hardware/s_openal/s_openal.c + $(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_openal.o -DHW3SOUND -DUNIXCOMMON -shared -nostartfiles -c hardware/s_openal/s_openal.c endif ifdef FILTERS