Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: toolchain@g.o, Sam James <sam@g.o>
Subject: [gentoo-dev] [PATCH 4/5] toolchain-funcs.eclass: style tweaks
Date: Mon, 30 Jan 2023 01:48:25
Message-Id: 20230130014708.2898311-4-sam@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/5] toolchain-funcs.eclass: add tc-enables-fortify-source for FORTIFY_SOURCE by Sam James
1 Signed-off-by: Sam James <sam@g.o>
2 ---
3 eclass/toolchain-funcs.eclass | 26 +++++++++++++-------------
4 1 file changed, 13 insertions(+), 13 deletions(-)
5
6 diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
7 index 840111f6cc30d..9bb660e4f71f3 100644
8 --- a/eclass/toolchain-funcs.eclass
9 +++ b/eclass/toolchain-funcs.eclass
10 @@ -422,19 +422,19 @@ tc-env_build() {
11 # src_configure() {
12 # ECONF_SOURCE=${S}
13 # if tc-is-cross-compiler ; then
14 -# mkdir "${WORKDIR}"/${CBUILD}
15 -# pushd "${WORKDIR}"/${CBUILD} >/dev/null
16 +# mkdir "${WORKDIR}"/${CBUILD} || die
17 +# pushd "${WORKDIR}"/${CBUILD} >/dev/null || die
18 # econf_build --disable-some-unused-stuff
19 -# popd >/dev/null
20 +# popd >/dev/null || die
21 # fi
22 # ... normal build paths ...
23 # }
24 # src_compile() {
25 # if tc-is-cross-compiler ; then
26 -# pushd "${WORKDIR}"/${CBUILD} >/dev/null
27 +# pushd "${WORKDIR}"/${CBUILD} >/dev/null || die
28 # emake one-or-two-build-tools
29 -# ln/mv build-tools to normal build paths in ${S}/
30 -# popd >/dev/null
31 +# ln/mv build-tools to normal build paths in ${S}/ || die
32 +# popd >/dev/null || die
33 # fi
34 # ... normal build paths ...
35 # }
36 @@ -676,7 +676,7 @@ tc-has-tls() {
37 # Parse information from CBUILD/CHOST/CTARGET rather than
38 # use external variables from the profile.
39 tc-ninja_magic_to_arch() {
40 -ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
41 + ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
42
43 local type=$1
44 local host=$2
45 @@ -815,8 +815,8 @@ tc-get-compiler-type() {
46 case ${res} in
47 *HAVE_PATHCC*) echo pathcc;;
48 *HAVE_CLANG*) echo clang;;
49 - *HAVE_GCC*) echo gcc;;
50 - *) echo unknown;;
51 + *HAVE_GCC*) echo gcc;;
52 + *) echo unknown;;
53 esac
54 }
55
56 @@ -834,11 +834,11 @@ tc-is-clang() {
57
58 # Internal func. The first argument is the version info to expand.
59 # Query the preprocessor to improve compatibility across different
60 -# compilers rather than maintaining a --version flag matrix. #335943
61 +# compilers rather than maintaining a --version flag matrix, bug #335943.
62 _gcc_fullversion() {
63 local ver="$1"; shift
64 set -- $($(tc-getCPP "$@") -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__")
65 - eval echo "$ver"
66 + eval echo "${ver}"
67 }
68
69 # @FUNCTION: gcc-fullversion
70 @@ -871,7 +871,7 @@ gcc-micro-version() {
71 _clang_fullversion() {
72 local ver="$1"; shift
73 set -- $($(tc-getCPP "$@") -E -P - <<<"__clang_major__ __clang_minor__ __clang_patchlevel__")
74 - eval echo "$ver"
75 + eval echo "${ver}"
76 }
77
78 # @FUNCTION: clang-fullversion
79 @@ -1098,7 +1098,7 @@ gen_usr_ldscript() {
80 # is referenced ... makes multilib saner
81 local flags=( ${CFLAGS} ${LDFLAGS} -Wl,--verbose )
82 if $(tc-getLD) --version | grep -q 'GNU gold' ; then
83 - # If they're using gold, manually invoke the old bfd. #487696
84 + # If they're using gold, manually invoke the old bfd, bug #487696
85 local d="${T}/bfd-linker"
86 mkdir -p "${d}"
87 ln -sf $(type -P ${CHOST}-ld.bfd) "${d}"/ld
88 --
89 2.39.1