Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 83e913f

Browse files
pefoley2richardweinberger
authored andcommitted
um: Support LTO
Only a handful of changes are necessary to get it to work. Signed-off-by: Peter Foley <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent f09c3fc commit 83e913f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

arch/um/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ config UML
2525
select GENERIC_IRQ_SHOW
2626
select GENERIC_CPU_DEVICES
2727
select HAVE_GCC_PLUGINS
28+
select ARCH_SUPPORTS_LTO_CLANG
29+
select ARCH_SUPPORTS_LTO_CLANG_THIN
2830
select TRACE_IRQFLAGS_SUPPORT
2931
select TTY # Needed for line.c
3032
select HAVE_ARCH_VMAP_STACK

arch/um/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ endif
144144
LD_FLAGS_CMDLINE = $(foreach opt,$(KBUILD_LDFLAGS) $(LDFLAGS_EXECSTACK),-Wl,$(opt))
145145

146146
# Used by link-vmlinux.sh which has special support for um link
147-
export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
147+
export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) $(CC_FLAGS_LTO)
148148

149149
# When cleaning we don't include .config, so we don't include
150150
# TT or skas makefiles and don't clean skas_ptregs.h.

arch/x86/um/vdso/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ CFLAGS_REMOVE_um_vdso.o = -pg -fprofile-arcs -ftest-coverage
6161
#
6262
quiet_cmd_vdso = VDSO $@
6363
cmd_vdso = $(CC) -nostdlib -o $@ \
64-
$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
64+
$(CC_FLAGS_LTO) $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
6565
-Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
6666
sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
6767

0 commit comments

Comments
 (0)