riscv: fix vdso build with lld
PATCH v2 1/1 riscv: fix vdso build with lld
When building with the LLVM linker this error occurrs:
LD arch/riscv/kernel/vdso/vdso-syms.o
ld.lld: error: no input files
This happens because the lld treats -R as an alias to -rpath, as opposed to ld where -R means --just-symbols.
Use the long option name for compatibility between the two.
---
Changed in v2:
* a comment line dropped, another one slightly reworded
* added Nick's Reviewed-by
--- arch/riscv/kernel/vdso/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/riscv/kernel/vdso/Makefile +3 -3
@@ -33,15 +33,15 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE $(call if_changed,vdsold) # We also create a special relocatable object that should mirror the symbol -# table and layout of the linked DSO. With ld -R we can then refer to -# these symbols in the kernel code rather than hand-coded addresses. +# table and layout of the linked DSO. With ld --just-symbols we can then +# refer to these symbols in the kernel code rather than hand-coded addresses. SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \ -Wl,--build-id -Wl,--hash-style=both $(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE $(call if_changed,vdsold) -LDFLAGS_vdso-syms.o := -r -R +LDFLAGS_vdso-syms.o := -r --just-symbols $(obj)/vdso-syms.o: $(obj)/vdso-dummy.o FORCE $(call if_changed,ld)
Signature · 1 line
2.17.1
Quoted 43 lines · Ilie Halip
When building with the LLVM linker this error occurrs:
LDarch/riscv/kernel/vdso/vdso-syms.o
ld.lld: error: no input filesThis happens because the lld treats -R as an alias to -rpath, as opposed to ld where -R means --just-symbols.
Use the long option name for compatibility between the two.
Reported-by Dmitry Golovin <[email protected]>Reviewed-by Nick Desaulniers <[email protected]>Signed-off-by Ilie Halip <[email protected]>---
Changed in v2:
* a comment line dropped, another one slightly reworded
* added Nick's Reviewed-by
---arch/riscv/kernel/vdso/Makefile| 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)arch/riscv/kernel/vdso/Makefile +2
-2@@ -33,15 +33,15 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE $(call if_changed,vdsold) # We also create a special relocatable object that should mirror the symbol -# table and layout of the linked DSO. With ld -R we can then refer to -# these symbols in the kernel code rather than hand-coded addresses. +# table and layout of the linked DSO. With ld --just-symbols we can then +# refer to these symbols in the kernel code rather than hand-coded addresses. SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \ -Wl,--build-id -Wl,--hash-style=both$(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE
$(call if_changed,vdsold)arch/riscv/kernel/vdso/Makefile +1
-1-LDFLAGS_vdso-syms.o := -r -R +LDFLAGS_vdso-syms.o := -r --just-symbols$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o FORCE
Quoted 4 lines
$(call if_changed,ld)Signature · 1 line
2.17.1
https://lore.kernel.org/linux-riscv/[email protected]/
Palmer Dabbelt
maintainerQuoted 34 lines · On Wed, 15 Apr 2020 07:29:58 PDT (-0700), [email protected] wrote:
When building with the LLVM linker this error occurrs:
LDarch/riscv/kernel/vdso/vdso-syms.o
ld.lld: error: no input filesThis happens because the lld treats -R as an alias to -rpath, as opposed to ld where -R means --just-symbols.
Use the long option name for compatibility between the two.
Reported-by Dmitry Golovin <[email protected]>Reviewed-by Nick Desaulniers <[email protected]>Signed-off-by Ilie Halip <[email protected]>---
Changed in v2:
* a comment line dropped, another one slightly reworded
* added Nick's Reviewed-by--- arch/riscv/kernel/vdso/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/riscv/kernel/vdso/Makefile +2
-2@@ -33,15 +33,15 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE $(call if_changed,vdsold) # We also create a special relocatable object that should mirror the symbol -# table and layout of the linked DSO. With ld -R we can then refer to -# these symbols in the kernel code rather than hand-coded addresses. +# table and layout of the linked DSO. With ld --just-symbols we can then +# refer to these symbols in the kernel code rather than hand-coded addresses.
arch/riscv/kernel/vdso/Makefile $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE · line 46
Quoted 10 lines
arch/riscv/kernel/vdso/Makefile +1
-1SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \ -Wl,--build-id -Wl,--hash-style=both $(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE $(call if_changed,vdsold) -LDFLAGS_vdso-syms.o := -r -R +LDFLAGS_vdso-syms.o := -r --just-symbols $(obj)/vdso-syms.o: $(obj)/vdso-dummy.o FORCE $(call if_changed,ld)
Thanks, this is on fixes.