aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/StdGNU.mk12
1 files changed, 10 insertions, 2 deletions
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index d73e644bbf..786efd7e20 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -1,10 +1,11 @@
AS = $(CROSS_COMPILE)as
+LD = $(CROSS_COMPILE)ld
ifeq ($(clang),y)
-LD = $(CROSS_COMPILE)gold
CC = $(CROSS_COMPILE)clang
+LD_LTO = $(CROSS_COMPILE)llvm-ld
else
-LD = $(CROSS_COMPILE)ld
CC = $(CROSS_COMPILE)gcc
+LD_LTO = $(CROSS_COMPILE)ld
endif
CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar
@@ -79,3 +80,10 @@ ifneq ($(clang),y)
CFLAGS += -fno-optimize-sibling-calls
endif
endif
+
+ifeq ($(lto),y)
+CFLAGS += -flto
+ifeq ($(clang),y)
+LDFLAGS += -plugin LLVMgold.so
+endif
+endif