Pull Kbuild fixes from Masahiro Yamada: - ignore compiler stubs for PPC to fix builds - fix the usage of --target mentioned in the LLVM document * tag 'kbuild-fixes-v5.9-4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: Documentation/llvm: Fix clang target examples scripts/kallsyms: skip ppc compiler stub *.long_branch.* / *.plt_branch.*
Unified · Split
| @@ -39,10 +39,10 @@ which can help simplify cross compiling. :: · 38 unmodified lines | |||
| 39 | ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make CC=clang | 39 | ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make CC=clang |
| 40 | 40 | ||
| 41 | ``CROSS_COMPILE`` is not used to prefix the Clang compiler binary, instead | 41 | ``CROSS_COMPILE`` is not used to prefix the Clang compiler binary, instead |
| 42 | ``CROSS_COMPILE`` is used to set a command line flag: ``--target <triple>``. For | 42 | ``CROSS_COMPILE`` is used to set a command line flag: ``--target=<triple>``. For |
| 43 | example: :: | 43 | example: :: |
| 44 | 44 | ||
| 45 | clang --target aarch64-linux-gnu foo.c | 45 | clang --target=aarch64-linux-gnu foo.c |
| 46 | 46 | ||
| 47 | LLVM Utilities | 47 | LLVM Utilities |
| 48 | -------------- | 48 | -------------- |
| @@ -82,6 +82,7 @@ static char *sym_name(const struct sym_entry *s) · 81 unmodified lines | |||
| 82 | 82 | ||
| 83 | static bool is_ignored_symbol(const char *name, char type) | 83 | static bool is_ignored_symbol(const char *name, char type) |
| 84 | { | 84 | { |
| 85 | /* Symbol names that exactly match to the following are ignored.*/ | ||
| 85 | static const char * const ignored_symbols[] = { | 86 | static const char * const ignored_symbols[] = { |
| 86 | /* | 87 | /* |
| 87 | * Symbols which vary between passes. Passes 1 and 2 must have | 88 | * Symbols which vary between passes. Passes 1 and 2 must have |
| @@ -104,6 +105,7 @@ static bool is_ignored_symbol(const char *name, char type) · 16 unmodified lines | |||
| 104 | NULL | 105 | NULL |
| 105 | }; | 106 | }; |
| 106 | 107 | ||
| 108 | /* Symbol names that begin with the following are ignored.*/ | ||
| 107 | static const char * const ignored_prefixes[] = { | 109 | static const char * const ignored_prefixes[] = { |
| 108 | "$", /* local symbols for ARM, MIPS, etc. */ | 110 | "$", /* local symbols for ARM, MIPS, etc. */ |
| 109 | ".LASANPC", /* s390 kasan local symbols */ | 111 | ".LASANPC", /* s390 kasan local symbols */ |
| @@ -113,6 +115,7 @@ static bool is_ignored_symbol(const char *name, char type) · 3 unmodified lines | |||
| 113 | NULL | 115 | NULL |
| 114 | }; | 116 | }; |
| 115 | 117 | ||
| 118 | /* Symbol names that end with the following are ignored.*/ | ||
| 116 | static const char * const ignored_suffixes[] = { | 119 | static const char * const ignored_suffixes[] = { |
| 117 | "_from_arm", /* arm */ | 120 | "_from_arm", /* arm */ |
| 118 | "_from_thumb", /* arm */ | 121 | "_from_thumb", /* arm */ |
| @@ -120,9 +123,15 @@ static bool is_ignored_symbol(const char *name, char type) · 1 unmodified line | |||
| 120 | NULL | 123 | NULL |
| 121 | }; | 124 | }; |
| 122 | 125 | ||
| 126 | /* Symbol names that contain the following are ignored.*/ | ||
| 127 | static const char * const ignored_matches[] = { | ||
| 128 | ".long_branch.", /* ppc stub */ | ||
| 129 | ".plt_branch.", /* ppc stub */ | ||
| 130 | NULL | ||
| 131 | }; | ||
| 132 | |||
| 123 | const char * const *p; | 133 | const char * const *p; |
| 124 | 134 | ||
| 125 | /* Exclude symbols which vary between passes. */ | ||
| 126 | for (p = ignored_symbols; *p; p++) | 135 | for (p = ignored_symbols; *p; p++) |
| 127 | if (!strcmp(name, *p)) | 136 | if (!strcmp(name, *p)) |
| 128 | return true; | 137 | return true; |
| @@ -138,6 +147,11 @@ static bool is_ignored_symbol(const char *name, char type) · 9 unmodified lines | |||
| 138 | return true; | 147 | return true; |
| 139 | } | 148 | } |
| 140 | 149 | ||
| 150 | for (p = ignored_matches; *p; p++) { | ||
| 151 | if (strstr(name, *p)) | ||
| 152 | return true; | ||
| 153 | } | ||
| 154 | |||
| 141 | if (type == 'U' || type == 'u') | 155 | if (type == 'U' || type == 'u') |
| 142 | return true; | 156 | return true; |
| 143 | /* exclude debugging symbols */ | 157 | /* exclude debugging symbols */ |