diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-10 20:48:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-10 20:48:21 -0400 |
commit | ffd602eb4693bbb49b301fa059b109bbdebf9524 (patch) | |
tree | a7be15ffb7fe1a23dde4dc2831670f3abed6ce95 /scripts/gcc-version.sh | |
parent | 5af7f115886f7ec193171e2e49b8000ddd1e7147 (diff) | |
parent | 9250d20e9ecedab6aa331a127fbfc1272383ed72 (diff) |
Merge tag 'kbuild-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada:
- do not generate unneeded top-level built-in.a
- let git ignore O= directory entirely
- optimize scripts/kallsyms slightly
- exclude DWARF info from *.s regardless of config options
- fix GCC toolchain search path for Clang to prepare ld.lld support
- do not generate modules.order when CONFIG_MODULES is disabled
- simplify single target rules and remove VPATH for external module
build
- allow to add optional flags to dpkg-buildpackage when building
deb-pkg
- move some compiler option tests from Makefile to Kconfig
- various Makefile cleanups
* tag 'kbuild-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (40 commits)
kbuild: remove scripts/basic/% build target
kbuild: use -Werror=implicit-... instead of -Werror-implicit-...
kbuild: clean up scripts/gcc-version.sh
kbuild: remove cc-version macro
kbuild: update comment block of scripts/clang-version.sh
kbuild: remove commented-out INITRD_COMPRESS
kbuild: move -gsplit-dwarf, -gdwarf-4 option tests to Kconfig
kbuild: [bin]deb-pkg: add DPKG_FLAGS variable
kbuild: move ".config not found!" message from Kconfig to Makefile
kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing
kbuild: simplify single target rules
kbuild: remove empty rules for makefiles
kbuild: make -r/-R effective in top Makefile for old Make versions
kbuild: move tools_silent to a more relevant place
kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
kbuild: refactor cc-cross-prefix implementation
kbuild: hardcode genksyms path and remove GENKSYMS variable
scripts/gdb: refactor rules for symlink creation
kbuild: create symlink to vmlinux-gdb.py in scripts_gdb target
scripts/gdb: do not descend into scripts/gdb from scripts
...
Diffstat (limited to 'scripts/gcc-version.sh')
-rwxr-xr-x | scripts/gcc-version.sh | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh index 11bb909845e7..ae353432539b 100755 --- a/scripts/gcc-version.sh +++ b/scripts/gcc-version.sh | |||
@@ -1,33 +1,20 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # SPDX-License-Identifier: GPL-2.0 | 2 | # SPDX-License-Identifier: GPL-2.0 |
3 | # | 3 | # |
4 | # gcc-version [-p] gcc-command | 4 | # gcc-version gcc-command |
5 | # | ||
6 | # Prints the gcc version of `gcc-command' in a canonical 4-digit form | ||
7 | # such as `0295' for gcc-2.95, `0303' for gcc-3.3, etc. | ||
8 | # | ||
9 | # With the -p option, prints the patchlevel as well, for example `029503' for | ||
10 | # gcc-2.95.3, `030301' for gcc-3.3.1, etc. | ||
11 | # | 5 | # |
12 | 6 | # Print the gcc version of `gcc-command' in a 5 or 6-digit form | |
13 | if [ "$1" = "-p" ] ; then | 7 | # such as `29503' for gcc-2.95.3, `30301' for gcc-3.3.1, etc. |
14 | with_patchlevel=1; | ||
15 | shift; | ||
16 | fi | ||
17 | 8 | ||
18 | compiler="$*" | 9 | compiler="$*" |
19 | 10 | ||
20 | if [ ${#compiler} -eq 0 ]; then | 11 | if [ ${#compiler} -eq 0 ]; then |
21 | echo "Error: No compiler specified." | 12 | echo "Error: No compiler specified." >&2 |
22 | printf "Usage:\n\t$0 <gcc-command>\n" | 13 | printf "Usage:\n\t$0 <gcc-command>\n" >&2 |
23 | exit 1 | 14 | exit 1 |
24 | fi | 15 | fi |
25 | 16 | ||
26 | MAJOR=$(echo __GNUC__ | $compiler -E -x c - | tail -n 1) | 17 | MAJOR=$(echo __GNUC__ | $compiler -E -x c - | tail -n 1) |
27 | MINOR=$(echo __GNUC_MINOR__ | $compiler -E -x c - | tail -n 1) | 18 | MINOR=$(echo __GNUC_MINOR__ | $compiler -E -x c - | tail -n 1) |
28 | if [ "x$with_patchlevel" != "x" ] ; then | 19 | PATCHLEVEL=$(echo __GNUC_PATCHLEVEL__ | $compiler -E -x c - | tail -n 1) |
29 | PATCHLEVEL=$(echo __GNUC_PATCHLEVEL__ | $compiler -E -x c - | tail -n 1) | 20 | printf "%d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL |
30 | printf "%02d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL | ||
31 | else | ||
32 | printf "%02d%02d\\n" $MAJOR $MINOR | ||
33 | fi | ||