Merge pull request #3577 from cwalther/nproc

Fix missing `nproc` on macOS
This commit is contained in:
Scott Shawcroft 2020-10-20 10:13:19 -07:00 committed by GitHub
commit 1092890266
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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