0001-Use-compiler-to-find-libgcc.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 1f96faa30ec089d13045e1c3ba398f812ed4c055 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Tue, 3 Oct 2017 23:36:56 -0700
  4. Subject: [PATCH] Use compiler to find libgcc
  5. This helps in compiling with toolchains which are relocated
  6. and may not have same runtime sysroot as build time sysroot
  7. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  8. ---
  9. arch/riscv/kernel/vdso/Makefile | 3 ++-
  10. 1 file changed, 2 insertions(+), 1 deletion(-)
  11. diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
  12. index 523d0a8ac8db..d4fa82ccef5b 100644
  13. --- a/arch/riscv/kernel/vdso/Makefile
  14. +++ b/arch/riscv/kernel/vdso/Makefile
  15. @@ -1,5 +1,6 @@
  16. # Copied from arch/tile/kernel/vdso/Makefile
  17. +LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  18. # Symbols present in the vdso
  19. vdso-syms = rt_sigreturn
  20. @@ -48,7 +49,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
  21. # Make sure only to export the intended __vdso_xxx symbol offsets.
  22. quiet_cmd_vdsold = VDSOLD $@
  23. cmd_vdsold = $(CC) $(KCFLAGS) -nostdlib $(SYSCFLAGS_$(@F)) \
  24. - -Wl,-T,$(filter-out FORCE,$^) -o $@.tmp -lgcc && \
  25. + -Wl,-T,$(filter-out FORCE,$^) -o $@.tmp $(LIBGCC) && \
  26. $(CROSS_COMPILE)objcopy \
  27. $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@
  28. --
  29. 2.14.2