Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kbuild: rename ld-option to cc-ldoption

ld-option is misnamed as it test options to gcc, not to ld.
Renamed it to reflect this.

Cc: Andi Kleen <andi@firstfloor.org>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

+14 -14
+3 -3
Documentation/kbuild/makefiles.txt
··· 435 435 The second argument is optional, and if supplied will be used 436 436 if first argument is not supported. 437 437 438 - ld-option 439 - ld-option is used to check if $(CC) when used to link object files 438 + cc-ldoption 439 + cc-ldoption is used to check if $(CC) when used to link object files 440 440 supports the given option. An optional second option may be 441 441 specified if first option are not supported. 442 442 443 443 Example: 444 444 #arch/i386/kernel/Makefile 445 - vsyscall-flags += $(call ld-option, -Wl$(comma)--hash-style=sysv) 445 + vsyscall-flags += $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) 446 446 447 447 In the above example, vsyscall-flags will be assigned the option 448 448 -Wl$(comma)--hash-style=sysv if it is supported by $(CC).
+1 -1
Makefile
··· 635 635 636 636 # Use --build-id when available. 637 637 LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ 638 - $(call ld-option, -Wl$(comma)--build-id,)) 638 + $(call cc-ldoption, -Wl$(comma)--build-id,)) 639 639 LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) 640 640 LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) 641 641
+1 -1
arch/ia64/kernel/Makefile.gate
··· 10 10 cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@ 11 11 12 12 GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 \ 13 - $(call ld-option, -Wl$(comma)--hash-style=sysv) 13 + $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) 14 14 $(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE 15 15 $(call if_changed,gate) 16 16
+1 -1
arch/powerpc/kernel/vdso32/Makefile
··· 16 16 17 17 EXTRA_CFLAGS := -shared -fno-common -fno-builtin 18 18 EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \ 19 - $(call ld-option, -Wl$(comma)--hash-style=sysv) 19 + $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) 20 20 EXTRA_AFLAGS := -D__VDSO32__ -s 21 21 22 22 obj-y += vdso32_wrapper.o
+1 -1
arch/powerpc/kernel/vdso64/Makefile
··· 11 11 12 12 EXTRA_CFLAGS := -shared -fno-common -fno-builtin 13 13 EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ 14 - $(call ld-option, -Wl$(comma)--hash-style=sysv) 14 + $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) 15 15 EXTRA_AFLAGS := -D__VDSO64__ -s 16 16 17 17 obj-y += vdso64_wrapper.o
+1 -1
arch/s390/kernel/vdso32/Makefile
··· 13 13 KBUILD_CFLAGS_31 := $(filter-out -m64,$(KBUILD_CFLAGS)) 14 14 KBUILD_CFLAGS_31 += -m31 -fPIC -shared -fno-common -fno-builtin 15 15 KBUILD_CFLAGS_31 += -nostdlib -Wl,-soname=linux-vdso32.so.1 \ 16 - $(call ld-option, -Wl$(comma)--hash-style=sysv) 16 + $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) 17 17 18 18 $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_31) 19 19 $(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_31)
+1 -1
arch/s390/kernel/vdso64/Makefile
··· 13 13 KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS)) 14 14 KBUILD_CFLAGS_64 += -m64 -fPIC -shared -fno-common -fno-builtin 15 15 KBUILD_CFLAGS_64 += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ 16 - $(call ld-option, -Wl$(comma)--hash-style=sysv) 16 + $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) 17 17 18 18 $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64) 19 19 $(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_64)
+1 -1
arch/sh/kernel/vsyscall/Makefile
··· 15 15 export CPPFLAGS_vsyscall.lds += -P -C -Ush 16 16 17 17 vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \ 18 - $(call ld-option, -Wl$(comma)--hash-style=sysv) 18 + $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) 19 19 20 20 SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags) 21 21
+1 -1
arch/x86/vdso/Makefile
··· 122 122 $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \ 123 123 -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) 124 124 125 - VDSO_LDFLAGS = -fPIC -shared $(call ld-option, -Wl$(comma)--hash-style=sysv) 125 + VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) 126 126 GCOV_PROFILE := n 127 127 128 128 #
+3 -3
scripts/Kbuild.include
··· 130 130 # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) 131 131 cc-ifversion = $(shell [ $(call cc-version, $(CC)) $(1) $(2) ] && echo $(3)) 132 132 133 - # ld-option 134 - # Usage: ldflags += $(call ld-option, -Wl$(comma)--hash-style=both) 135 - ld-option = $(call try-run,\ 133 + # cc-ldoption 134 + # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) 135 + cc-ldoption = $(call try-run,\ 136 136 $(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2)) 137 137 138 138 ######