Commit 618916a4 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov

kbuild: replace BASH-specific ${@:2} with shift and ${@}

${@:2} is BASH-specific extension, which makes link-vmlinux.sh rely on
BASH. Use shift and ${@} instead to fix this issue.
Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Fixes: 341dfcf8 ("btf: expose BTF info through sysfs")
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Reviewed-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 1e46c09e
...@@ -57,12 +57,16 @@ modpost_link() ...@@ -57,12 +57,16 @@ modpost_link()
# Link of vmlinux # Link of vmlinux
# ${1} - output file # ${1} - output file
# ${@:2} - optional extra .o files # ${2}, ${3}, ... - optional extra .o files
vmlinux_link() vmlinux_link()
{ {
local lds="${objtree}/${KBUILD_LDS}" local lds="${objtree}/${KBUILD_LDS}"
local output=${1}
local objects local objects
# skip output file argument
shift
if [ "${SRCARCH}" != "um" ]; then if [ "${SRCARCH}" != "um" ]; then
objects="--whole-archive \ objects="--whole-archive \
${KBUILD_VMLINUX_OBJS} \ ${KBUILD_VMLINUX_OBJS} \
...@@ -70,9 +74,10 @@ vmlinux_link() ...@@ -70,9 +74,10 @@ vmlinux_link()
--start-group \ --start-group \
${KBUILD_VMLINUX_LIBS} \ ${KBUILD_VMLINUX_LIBS} \
--end-group \ --end-group \
${@:2}" ${@}"
${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} -o ${1} \ ${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} \
-o ${output} \
-T ${lds} ${objects} -T ${lds} ${objects}
else else
objects="-Wl,--whole-archive \ objects="-Wl,--whole-archive \
...@@ -81,9 +86,10 @@ vmlinux_link() ...@@ -81,9 +86,10 @@ vmlinux_link()
-Wl,--start-group \ -Wl,--start-group \
${KBUILD_VMLINUX_LIBS} \ ${KBUILD_VMLINUX_LIBS} \
-Wl,--end-group \ -Wl,--end-group \
${@:2}" ${@}"
${CC} ${CFLAGS_vmlinux} -o ${1} \ ${CC} ${CFLAGS_vmlinux} \
-o ${output} \
-Wl,-T,${lds} \ -Wl,-T,${lds} \
${objects} \ ${objects} \
-lutil -lrt -lpthread -lutil -lrt -lpthread
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment