Skip to content

Fix missing nproc on macOS #3577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/atmel-samd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions py/mkenv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down