kbuild: Fix 'no symbols' warning when CONFIG_TRIM_UNUSD_KSYMS=y
PATCH 1/1 kbuild: Fix 'no symbols' warning when CONFIG_TRIM_UNUSD_KSYMS=y
When CONFIG_TRIM_UNUSED_KSYMS is enabled, I see some warnings like this:
nm: arch/x86/entry/vdso/vdso32/note.o: no symbols
$NM (both GNU nm and llvm-nm) warns when no symbol is found in the object. Suppress the stderr.
---
scripts/gen_ksymdeps.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
scripts/gen_ksymdeps.sh +4 -1
@@ -4,7 +4,10 @@ set -e # List of exported symbols -ksyms=$($NM $1 | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z) +# +# If the object has no symbol, $NM warns 'no symbols'. +# Suppress the stdout. +ksyms=$($NM $1 2>/dev/null | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z) if [ -z "$ksyms" ]; then exit 0
Signature · 1 line
2.30.2
Quoted 9 lines · Masahiro Yamada
When
CONFIG_TRIM_UNUSED_KSYMSis enabled, I see some warnings like this:nm:
arch/x86/entry/vdso/vdso32/note.o: no symbols$NM (both GNU nm and llvm-nm) warns when no symbol is found in the object. Suppress the stderr.
Fixes bbda5ec671d3 ("kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS")Signed-off-by Masahiro Yamada <[email protected]>
Quoted 22 lines
---
scripts/gen_ksymdeps.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)scripts/gen_ksymdeps.sh +4
-1@@ -4,7 +4,10 @@ set -e # List of exported symbols -ksyms=$($NM $1 | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z) +# +# If the object has no symbol, $NM warns 'no symbols'. +# Suppress the stdout. +ksyms=$($NM $1 2>/dev/null | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z) if [ -z "$ksyms" ]; then exit 0
Quoted 11 lines · Nathan Chancellor
Quoted 9 lines · Masahiro Yamada
When
CONFIG_TRIM_UNUSED_KSYMSis enabled, I see some warnings like this:nm:
arch/x86/entry/vdso/vdso32/note.o: no symbols$NM (both GNU nm and llvm-nm) warns when no symbol is found in the object. Suppress the stderr.
Fixes bbda5ec671d3 ("kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS")Signed-off-by Masahiro Yamada <[email protected]>
LGTM.
FWIW binutils>=2.37 nm -q can be used to suppress "no symbols"
https://sourceware.org/bugzilla/show_bug.cgi?id=27408
llvm-nm>=13.0.0 supports -q as well.
Quoted 29 lines
Reviewed-by Nathan Chancellor <[email protected]>Quoted 12 lines
---
scripts/gen_ksymdeps.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)scripts/gen_ksymdeps.sh +0
-0@@ -4,7 +4,10 @@ set -escripts/gen_ksymdeps.sh line 13
Quoted 10 lines
scripts/gen_ksymdeps.sh +4
-1# List of exported symbols -ksyms=$($NM $1 | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z) +# +# If the object has no symbol, $NM warns 'no symbols'. +# Suppress the stdout. +ksyms=$($NM $1 2>/dev/null | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z) if [ -z "$ksyms" ]; then exit 0--
You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/3afe5054-8129-fe42-b5a4-00bd091b1a0c%40kernel.org.
Signature · 1 line
宋方睿
Quoted 14 lines · Fāng-ruì Sòng
Quoted 11 lines · Nathan Chancellor
Quoted 9 lines · Masahiro Yamada
When
CONFIG_TRIM_UNUSED_KSYMSis enabled, I see some warnings like this:nm:
arch/x86/entry/vdso/vdso32/note.o: no symbols$NM (both GNU nm and llvm-nm) warns when no symbol is found in the object. Suppress the stderr.
Fixes bbda5ec671d3 ("kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS")Signed-off-by Masahiro Yamada <[email protected]>
Quoted 6 lines
LGTM.
FWIW binutils>=2.37
nm -qcan be used to suppress "no symbols"
https://sourceware.org/bugzilla/show_bug.cgi?id=27408llvm-nm>=13.0.0 supports -q as well.
Thanks for the info.
Perhaps, I can note the future migration to -q
in a comment.
Signature · 2 lines
Best Regards Masahiro Yamada
Quoted 19 lines · Masahiro Yamada
When
CONFIG_TRIM_UNUSED_KSYMSis enabled, I see some warnings like this:nm:
arch/x86/entry/vdso/vdso32/note.o: no symbols$NM (both GNU nm and llvm-nm) warns when no symbol is found in the object. Suppress the stderr.
Fixes bbda5ec671d3 ("kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS")Signed-off-by Masahiro Yamada <[email protected]>---
scripts/gen_ksymdeps.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)scripts/gen_ksymdeps.sh +0
-0
scripts/gen_ksymdeps.sh line 10
Quoted 8 lines
scripts/gen_ksymdeps.sh +4
-1@@ -4,7 +4,10 @@ set -e # List of exported symbols -ksyms=$($NM $1 | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z) +# +# If the object has no symbol, $NM warns 'no symbols'. +# Suppress the stdout. +ksyms=$($NM $1 2>/dev/null | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z)
You mean stderr.
Nicolas
Quoted 24 lines · Nicolas Pitre
Quoted 21 lines · Masahiro Yamada
When
CONFIG_TRIM_UNUSED_KSYMSis enabled, I see some warnings like this:nm:
arch/x86/entry/vdso/vdso32/note.o: no symbols$NM (both GNU nm and llvm-nm) warns when no symbol is found in the object. Suppress the stderr.
Fixes bbda5ec671d3 ("kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS")Signed-off-by Masahiro Yamada <[email protected]>---
scripts/gen_ksymdeps.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)scripts/gen_ksymdeps.sh +0
-0@@ -4,7 +4,10 @@ set -e
Quoted 8 lines
scripts/gen_ksymdeps.sh line 10
Quoted 6 lines
scripts/gen_ksymdeps.sh +4
-1# List of exported symbols -ksyms=$($NM $1 | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z) +# +# If the object has no symbol, $NM warns 'no symbols'. +# Suppress the stdout. +ksyms=$($NM $1 2>/dev/null | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z)You mean stderr.
My bad - I will fix it in v2.
Thanks.
Signature · 2 lines
Best Regards Masahiro Yamada