aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2018-11-20 00:07:47 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2018-11-20 00:07:47 +0000
commitf4c53af18b727109faac7203eeb192bbbac2903d (patch)
tree44ef6ef0fd997ec5a8a98c4e447f94a4e7823ae2 /gcc
parent502e897d1afa16df33326d255120d7cd15df9363 (diff)
downloadgcc-f4c53af18b727109faac7203eeb192bbbac2903d.zip
gcc-f4c53af18b727109faac7203eeb192bbbac2903d.tar.gz
gcc-f4c53af18b727109faac7203eeb192bbbac2903d.tar.bz2
PR81878: fix --disable-bootstrap --enable-languages=ada
gnattools build machinery uses just-build xgcc and xg++ as $(CC) and $(CXX) in native builds. However, if C and C++ languages are not enabled, it won't find them. So, enable C and C++ if Ada is enabled. Most of the time, this is probably no big deal: C is always enabled anyway, and C++ is already enabled for bootstraps. We need not enable those for cross builds, however. At first I just took the logic from gnattools/configure, but found it to be lacking: it would use the just-built tools even in cross-back settings, whose tools just built for the host would not run on the build machine. So I've narrowed down the test to rely on autoconf-detected cross-ness (build->host only), but also to ensure that host matches build, and that target matches host. I've considered sourcing ada/config-lang.in from within gnattools/configure, and testing lang_requires as set by it, so as to avoid a duplication of tests that ought to remain in sync, but decided it would be too fragile, as ada/config-lang.in does not expect srcdir to refer to gnattools. for gcc/ada/ChangeLog PR ada/81878 * gcc-interface/config-lang.in (lang_requires): Set to "c c++" when gnattools wants it. for gnattools/ChangeLog PR ada/81878 * configure.ac (default_gnattools_target): Do not mistake just-built host tools as native in cross-back toolchains. * configure: Rebuilt. From-SVN: r266290
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/config-lang.in9
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 082fe5a..733bfe0 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2018-11-19 Alexandre Oliva <oliva@adacore.com>
+
+ PR ada/81878
+ * gcc-interface/config-lang.in (lang_requires): Set to "c c++"
+ when gnattools wants it.
+
2018-11-19 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/cuintp.c (UI_From_gnu): Remove code for 32-bit hosts.
diff --git a/gcc/ada/gcc-interface/config-lang.in b/gcc/ada/gcc-interface/config-lang.in
index 5dc77df..8eacf7b 100644
--- a/gcc/ada/gcc-interface/config-lang.in
+++ b/gcc/ada/gcc-interface/config-lang.in
@@ -34,6 +34,15 @@ gtfiles="\$(srcdir)/ada/gcc-interface/ada-tree.h \$(srcdir)/ada/gcc-interface/gi
outputs="ada/gcc-interface/Makefile ada/Makefile"
+# gnattools native builds use both $(CC) and $(CXX), see PR81878.
+# This is not too onerous: C is always enabled anyway, and C++ is
+# always enabled for bootstrapping. Use here the same logic used in
+# gnattools/configure to decide whether to use -native or -cross tools
+# for the build.
+if test "x$cross_compiling/$build/$host" = "xno/$host/$target" ; then
+ lang_requires="c c++"
+fi
+
target_libs="target-libada"
lang_dirs="gnattools"