From ca166a04d6afebb3760a0d15ef02d07497855ee2 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Mon, 6 Jan 2025 23:32:15 -0800 Subject: [PATCH 1/3] Fix detection of whether `long double` is the same as `double` One change in PR 305 was not quite right: it changed a check for whether `$(ARCH)` is `aarch64` to a check for whether it's `aarch64 riscv64`, which can never be true. It was a non-functional change on RISC-V (since it can't be true) but broke AArch64, at least for FreeBSD. Notably, changing the check to what I assume was intended, i.e. `aarch64` or `riscv64`, breaks RISC-V. So this commit instead reverts this one change in 305. --- Make.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Make.inc b/Make.inc index 498e1081..30381cdf 100644 --- a/Make.inc +++ b/Make.inc @@ -171,7 +171,7 @@ ifneq ($(filter $(ARCH),i387 amd64),) # linux x86_64, for instance, `long double` is 80 bits wide, whereas on macOS aarch64, # `long double` is the same as `double`. LONG_DOUBLE_NOT_DOUBLE := 1 -else ifeq ($(ARCH), aarch64 riscv64) +else ifeq ($(ARCH), aarch64) ifeq ($(filter $(OS),Darwin WINNT),) LONG_DOUBLE_NOT_DOUBLE := 1 endif From 42c26873ea9d5e26816190ed627a0c26110daee1 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Mon, 6 Jan 2025 23:40:11 -0800 Subject: [PATCH 2/3] Fix setting of `USECLANG`/`USEGCC` 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. --- Make.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Make.inc b/Make.inc index 30381cdf..33e41baa 100644 --- a/Make.inc +++ b/Make.inc @@ -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 @@ -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 From 4d2d83fdec642c21fd47cb6546dbec8b31761259 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Mon, 6 Jan 2025 23:50:26 -0800 Subject: [PATCH 3/3] Add a Vim filetype hint for Make.inc alongside that for Emacs --- Make.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/Make.inc b/Make.inc index 33e41baa..7914e821 100644 --- a/Make.inc +++ b/Make.inc @@ -1,4 +1,5 @@ # -*- mode: makefile-gmake -*- +# vi:ft=make # Default build rule for any Makefile in this project: all default: all