Pass system LDFLAGS by default

A lot of build system pass LDFLAGS they assume the compiler will use later on.
This could enable important features such as RELRO being enabled.
This commit is contained in:
Morten Linderud 2018-12-21 21:16:21 +01:00
parent 06a0c38805
commit e828a9510d
No known key found for this signature in database
GPG Key ID: E742683BA08CB2FF

@ -28,8 +28,8 @@ BUILTIN_LD_FLAGS += -s
BUILTIN_LD_FLAGS += -w
endif
# EXTRA_LD_FLAGS are given by the caller, and are passed to the Go linker after
# BUILTIN_LD_FLAGS are processed.
EXTRA_LD_FLAGS =
# BUILTIN_LD_FLAGS are processed. By default the system LDFLAGS are passed.
EXTRA_LD_FLAGS ?= -extldflags ${LDFLAGS}
# LD_FLAGS is the union of the above two BUILTIN_LD_FLAGS and EXTRA_LD_FLAGS.
LD_FLAGS = $(BUILTIN_LD_FLAGS) $(EXTRA_LD_FLAGS)