diff --git a/Makefile b/Makefile index 1da6d412d2..06132c2f8b 100644 --- a/Makefile +++ b/Makefile @@ -1201,12 +1201,16 @@ LDFLAGS = \ $(ARCH_FLAGS) \ $(LTO_FLAGS) \ $(DEBUG_FLAGS) \ - -static \ - -static-libgcc \ -Wl,-gc-sections,-Map,$(TARGET_MAP) \ -Wl,-L$(LINKER_DIR) \ -Wl,--cref \ -T$(LD_SCRIPT) + +ifneq ($(filter SITL_STATIC,$(OPTIONS)),) +LDFLAGS += \ + -static \ + -static-libgcc +endif endif ###############################################################################