Fix missing nproc on macOS.

396979a breaks building on macOS: `nproc` is a Linux thing, use a cross-platform alternative.
This commit is contained in:
Christian Walther 2020-10-20 16:37:24 +02:00
parent c5d8c12e34
commit 1eab0692b5
2 changed files with 3 additions and 1 deletions

View File

@ -197,7 +197,7 @@ endif
LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs
LDFLAGS += -flto=$(shell nproc)
LDFLAGS += -flto=$(shell $(NPROC))
LIBS := -lgcc -lc
# Use toolchain libm if we're not using our own.

View File

@ -55,6 +55,8 @@ PYTHON3 ?= python3
RM = rm
RSYNC = rsync
SED = sed
# Linux has 'nproc', macOS has 'sysctl -n hw.logicalcpu', this is cross-platform
NPROC = $(PYTHON) -c 'import multiprocessing as mp; print(mp.cpu_count())'
AS = $(CROSS_COMPILE)as
CC = $(CROSS_COMPILE)gcc