Bug 6088 - CC=clang - unsupported compiler options (MinGW)
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: GIT MASTER
Hardware: PC Windows NT
: P3 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2014-02-10 07:58 EST by Stig M. Halvorsen
Modified: 2021-11-02 15:31:30 EDT
2 users (show)

See Also:



Description Stig M. Halvorsen 2014-02-10 07:58:00 EST
Windows 7/8, MinGW, CC=clang. Clang v.3.4 (198054):

----------
DED_CC code/server/sv_bot.c
clang.exe: error: unknown argument: '-falign-loops=2'
clang.exe: error: unknown argument: '-falign-jumps=2'
make[2]: *** [build/release-mingw32-x86/ded/sv_bot.o] Error 1
----------

And:

----------
LD build/release-mingw32-x86/openarena.x86.exe
clang.exe: error: unknown argument: '-mwindows'
make[2]: *** [build/release-mingw32-x86/openarena.x86.exe] Error 1
----------

The support for an optional compiler (CC) is a bit contra intuitive if the Makefile contains GCC specific flags, or am I wrong? This can anyways be fixed by changing the following in the Makefile under the mingw setup

--------------
Makefile l.556
--------------
  ifeq ($(ARCH),x86_64)
    OPTIMIZEVM = -O3 -fno-omit-frame-pointer \
      -funroll-loops -falign-functions=2 \
      -fstrength-reduce
    ifeq ($(CC),gcc)
      OPTIMIZEVM += -falign-loops=2 -falign-jumps=2
    endif
    OPTIMIZE = $(OPTIMIZEVM) --fast-math
    HAVE_VM_COMPILED = true
  endif
----------

---------------------------------------------
Makefile l. 588 (after fix above, else l.585)
---------------------------------------------
ifeq ($(CC),gcc)
    CLIENT_LDFLAGS += -mwindows
  endif
----------

It can optionally be set to use the flags unless it is Clang; ifneq($(CC), clang).
Comment 1 Stig M. Halvorsen 2014-02-10 07:59:03 EST
NB: I know my output states openarena, but it is the same in ioquake3's Makefile.
Comment 2 Zack Middleton 2014-07-26 02:10:21 EDT
Fixed in git master. See https://github.com/ioquake/ioq3/pull/43 for details.