Skip to content

Commit

Permalink
This change introduces a new variable, ENABLE_STATIC, to the build pr…
Browse files Browse the repository at this point in the history
…ocess, allowing the simulators to be compiled statically. This provides the flexibility to generate standalone simulators that are not dependent on shared libraries at runtime, which can be particularly beneficial for deployment in environments where managing dynamic libraries is challenging or for distributing simulators more easily.
  • Loading branch information
rpsene authored Feb 19, 2024
1 parent 9602e3a commit 1392160
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ ZLIB_FLAGS = $(shell pkg-config --cflags zlib)
ZLIB_LIBS = $(shell pkg-config --libs zlib)

C_FLAGS = -I $(SAIL_LIB_DIR) -I c_emulator $(GMP_FLAGS) $(ZLIB_FLAGS) $(SOFTFLOAT_FLAGS)
# Conditional check for ENABLE_STATIC=1
ifneq (,$(ENABLE_STATIC))
# If ENABLE_STATIC is set, append specific static linking flags
C_FLAGS += -static -Wl,--as-needed -Wl,-O1
endif
C_LIBS = $(GMP_LIBS) $(ZLIB_LIBS) $(SOFTFLOAT_LIBS)

# The C simulator can be built to be linked against Spike for tandem-verification.
Expand Down

0 comments on commit 1392160

Please sign in to comment.