Skip to content

Commit

Permalink
Use 4 threads and LTO
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Dudek <[email protected]>
  • Loading branch information
mtdudek committed Nov 10, 2022
1 parent ad89654 commit 478357c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions litex/build/sim/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ifeq ($(UNAME_S),Darwin)
LDFLAGS += -lpthread -ljson-c -lz -lm -lstdc++ -ldl -levent
else
CC ?= gcc
CFLAGS += -ggdb
LDFLAGS += -lpthread -Wl,--no-as-needed -ljson-c -lz -lm -lstdc++ -Wl,--no-as-needed -ldl -levent
CFLAGS += -ggdb -flto
LDFLAGS += -lpthread -Wl,--no-as-needed -ljson-c -lz -lm -lstdc++ -Wl,--no-as-needed -ldl -levent -flto
endif

CFLAGS += -Wall -$(OPT_LEVEL) $(if $(COVERAGE), -DVM_COVERAGE) $(if $(TRACE_FST), -DTRACE_FST)
Expand Down Expand Up @@ -50,6 +50,7 @@ sim: $(OBJS_SIM) | mkdir
--output-split 5000 \
--output-split-cfuncs 500 \
--output-split-ctrace 500 \
--threads 4 \
$(INC_DIR) \
-Wno-BLKANDNBLK \
-Wno-WIDTH \
Expand Down
4 changes: 2 additions & 2 deletions litex/build/sim/core/modules/rules.mak
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ ifeq ($(UNAME_S),Darwin)
LDFLAGS += -L/usr/local/lib -ljson-c
CFLAGS += -Wall -O3 -ggdb -fPIC
else
CFLAGS += -Wall -O3 -ggdb -fPIC -Werror
CFLAGS += -Wall -O3 -ggdb -fPIC -Werror -flto
endif
LDFLAGS += -levent -shared -fPIC
LDFLAGS += -levent -shared -fPIC -flto

MOD_SRC_DIR=$(SRC_DIR)/modules/$(MOD)
EXTRA_MOD_SRC_DIR=$(EXTRA_MOD_BASE_DIR)/$(MOD)
Expand Down

0 comments on commit 478357c

Please sign in to comment.