diff --git a/Make.defaults b/Make.defaults index 2f432201..aa974d98 100644 --- a/Make.defaults +++ b/Make.defaults @@ -12,7 +12,7 @@ CROSS_COMPILE ?= PKG_CONFIG = $(CROSS_COMPILE)pkg-config CC := $(if $(filter default,$(origin CC)),$(CROSS_COMPILE)gcc,$(CC)) CCLD := $(if $(filter undefined,$(origin CCLD)),$(CC),$(CCLD)) -OPTIMIZE ?= -O2 +OPTIMIZE ?= -O2 -flto CFLAGS ?= $(OPTIMIZE) -g3 CFLAGS := $(CFLAGS) LDFLAGS ?= diff --git a/gcc.specs b/gcc.specs index 9ebf56ba..45d43d11 100644 --- a/gcc.specs +++ b/gcc.specs @@ -8,7 +8,7 @@ + %(efivar_cpp_options) *cc1_options: -+ %(efivar_cpp_options) -Wmaybe-uninitialized -fno-merge-constants -flto -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}} ++ %(efivar_cpp_options) -Wmaybe-uninitialized -fno-merge-constants -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}} *self_spec: + %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now}