Gentoo Archives: gentoo-dev

From: Alfredo Tupone <tupone@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Building gcc-x[ada] with gcc-y[ada]
Date: Sat, 22 Oct 2022 21:42:27
Message-Id: 20221022234212.20d293bc@alfredo.tupone.it
1 I knew that building gcc+ada with an already bootstrapped gcc[ada] is
2 not supported if you build an older compiler:
3
4 like you cannot emerge gcc-10.4.0[ada] using gcc-12.2.0[ada]
5
6 I would like to warn the user (and possibly disable ada? ).
7
8 I tried this on my local PC
9
10 toolchain_pkg_pretend() {
11 if ! _tc_use_if_iuse cxx ; then
12 _tc_use_if_iuse go && \
13 ewarn 'Go requires a C++ compiler, disabled due to USE="-cxx"' _tc_use_if_iuse objc++ && \
14 ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="-cxx"' _tc_use_if_iuse gcj && \
15 ewarn 'GCJ requires a C++ compiler, disabled due to USE="-cxx"'
16 fi
17
18 + if _tc_use_if_iuse ada ; then
19 + local version=$($(tc-getCC) -dumpversion)
20 + if $(ver_test ${version} -gt ${GCC_CONFIG_VER}); then
21 + ewarn 'Ada require an older compiler'
22 + ewarn "You are building ${GCC_CONFIG_VER} with ${version}"
23 + fi
24 + fi
25
26 want_minispecs
27 }
28
29 I don't know if this code breaks other things, if it works everywhere
30 ...
31
32 Please comment
33
34 Alfredo