Fix viz linking errors take 2
closes
# permissions and limitations under the License.
#
-
.PHONY : all
all: build_viz
@@ -21,12 +20,17 @@ include ../../s2n.mk
LDFLAGS += -L../../lib ${LIBS} -ls2n -L$(LIBCRYPTO_ROOT)/lib ${CRYPTO_LIBS}
+UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S),Linux)
+ CFLAGS := -Wl,--no-as-needed $(CFLAGS)
+endif
+
# Run state machine graph generation
# with `make STATE_MACHINE_GRAPHS=1`.
# graphviz is required.
build_viz::
- ${CC} ${CFLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls -o s2n_state_machine_viz s2n_state_machine_viz.c ${LDFLAGS}
+ ${CC} ${CFLAGS} -o s2n_state_machine_viz s2n_state_machine_viz.c ${LDFLAGS}
@[ "${STATE_MACHINE_GRAPHS}" ] && \
DYLD_LIBRARY_PATH="../../lib:$(LIBCRYPTO_ROOT)/lib:$$DYLD_LIBRARY_PATH" \
LD_LIBRARY_PATH="../../lib:$(LIBCRYPTO_ROOT)/lib:$$LD_LIBRARY_PATH" \
