Skip to content

Commit

Permalink
Fix setting of USECLANG/USEGCC
Browse files Browse the repository at this point in the history
Move the unconditional `?=` definitions below all conditional
definitions so that conditional `?=`s can take precedence. Also forcibly
set `USEGCC=0` when `USECLANG=1`, otherwise the things guarded behind
`USEGCC=1` will be visible. Without these changes, `gmake` on FreeBSD
AArch64 incorrectly uses gcc instead of clang.
  • Loading branch information
ararslan committed Jan 7, 2025
1 parent 2812013 commit 8542cfb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ endif
# Just Run: make clean && make coverage -j
CODE_COVERAGE ?= 0

USEGCC ?= 1
USECLANG ?= 0
TOOLPREFIX ?=

ifneq (,$(findstring $(OS),Darwin FreeBSD OpenBSD))
USEGCC ?= 0
USECLANG ?= 1
Expand All @@ -49,10 +45,14 @@ USEGCC = 0
TOOLPREFIX = llvm-
endif

USEGCC ?= 1
USECLANG ?= 0
TOOLPREFIX ?=

AR := $(TOOLPREFIX)ar

ifeq ($(USECLANG),1)
USEGCC ?= 0
USEGCC = 0
CC = clang
CFLAGS_add += -fno-builtin -fno-strict-aliasing
endif
Expand Down

0 comments on commit 8542cfb

Please sign in to comment.