* [config PATCH] --enable-languages
@ 2017-05-19 17:05 Nathan Sidwell
2017-05-19 20:07 ` Mike Stump
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Nathan Sidwell @ 2017-05-19 17:05 UTC (permalink / raw)
To: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 481 bytes --]
--enable-languages=all confused me, because as RichardB said, 'it really
means default'. So this patch does 2 things
1) allow --enable-languages=default to mean what =all does now.
2) change =all to mean all available languages.
2.1) jit is included in =all if -enable-host-shared is given. If you
don't you get a warning that JIT's not included.
If you're used to saying =all, then you'll get more languages with this
patch than you used to.
ok?
nathan
--
Nathan Sidwell
[-- Attachment #2: langs.diff --]
[-- Type: text/x-patch, Size: 11107 bytes --]
2017-05-19 Nathan Sidwell <nathan@acm.org>
* configure.ac: Add --enable-languages=default to mean default and
make --enable-languages=all mean all supported languages.
* configure: Regenerated.
gcc/
* doc/invoke.texi (--enable-languages): Update documentation.
Index: configure.ac
===================================================================
--- configure.ac (revision 248286)
+++ configure.ac (working copy)
@@ -1766,6 +1766,13 @@ AC_ARG_ENABLE(linker-plugin-flags,
extra_linker_plugin_flags=)
AC_SUBST(extra_linker_plugin_flags)
+# Enable --enable-host-shared.
+# Checked early to determine whether jit is an 'all' language
+AC_ARG_ENABLE(host-shared,
+[AS_HELP_STRING([--enable-host-shared],
+ [build host code as shared libraries])],
+[host_shared=$enableval], [host_shared=no])
+AC_SUBST(host_shared)
# By default, C and C++ are the only stage 1 languages.
stage1_languages=,c,
@@ -1784,7 +1791,7 @@ if test -d ${srcdir}/gcc; then
enable_languages="${LANGUAGES}"
echo configure.ac: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
else
- enable_languages=all
+ enable_languages=default
fi
else
if test x"${enable_languages}" = x ||
@@ -1836,6 +1843,7 @@ if test -d ${srcdir}/gcc; then
for other in ${lang_requires} ${lang_requires_boot_languages}; do
case ,${enable_languages}, in
*,$other,*) ;;
+ *,default,*) ;;
*,all,*) ;;
*,$language,*)
echo " \`$other' language required by \`$language'; enabling" 1>&2
@@ -1847,6 +1855,7 @@ if test -d ${srcdir}/gcc; then
if test "$other" != "c"; then
case ,${enable_stage1_languages}, in
*,$other,*) ;;
+ *,default,*) ;;
*,all,*) ;;
*)
case ,${enable_languages}, in
@@ -1884,7 +1893,7 @@ if test -d ${srcdir}/gcc; then
esac
fi
- missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
+ missing_languages=`echo ",$enable_languages," | sed -e s/,default,/,/ -e s/,all,/,/ -e s/,c,/,/ `
potential_languages=,c,
enabled_target_libs=
@@ -1916,21 +1925,27 @@ if test -d ${srcdir}/gcc; then
fi
add_this_lang=no
- case ,${enable_languages}, in
- *,${language},*)
- # Language was explicitly selected; include it
- # unless it is C, which is enabled by default.
- if test "$language" != "c"; then
+ # C is always enabled, so no need to add it again
+ if test "$language" != "c"; then
+ case ,${enable_languages}, in
+ *,${language},*)
+ # Language was explicitly selected; include it
add_this_lang=yes
- fi
- ;;
- *,all,*)
- # 'all' was selected, select it if it is a default language
- if test "$language" != "c"; then
+ ;;
+ *,all,*)
+ # All languages are enabled
+ if test "$language:$host_shared" = "jit:no" ; then
+ AC_MSG_WARN([not enabling language "jit" as --enable-host-shared not specified])
+ else
+ add_this_lang=yes
+ fi
+ ;;
+ *,default,*)
+ # 'default' was selected, select it if it is a default language
add_this_lang=${build_by_default}
- fi
- ;;
- esac
+ ;;
+ esac
+ fi
# Disable languages that need other directories if these aren't available.
for i in $subdir_requires; do
@@ -1959,6 +1974,8 @@ if test -d ${srcdir}/gcc; then
;;
esac
+ # Disable jit if -enable-host-shared not specified
+
# Disable a language that is unsupported by the target.
case " $unsupported_languages " in
*" $language "*)
@@ -3478,13 +3495,6 @@ fi
AC_SUBST(stage2_werror_flag)
-# Enable --enable-host-shared.
-AC_ARG_ENABLE(host-shared,
-[AS_HELP_STRING([--enable-host-shared],
- [build host code as shared libraries])],
-[host_shared=$enableval], [host_shared=no])
-AC_SUBST(host_shared)
-
# PR jit/64780: Require the user to explicitly specify
# --enable-host-shared if the jit is enabled, hinting
# that they might want to do a separate configure/build of
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi (revision 248286)
+++ gcc/doc/install.texi (working copy)
@@ -1621,14 +1621,17 @@ their runtime libraries should be built.
grep ^language= */config-lang.in
@end smallexample
Currently, you can use any of the following:
-@code{all}, @code{ada}, @code{c}, @code{c++}, @code{fortran},
+@code{all}, @code{default}, @code{ada}, @code{c}, @code{c++}, @code{fortran},
@code{go}, @code{jit}, @code{lto}, @code{objc}, @code{obj-c++}.
Building the Ada compiler has special requirements, see below.
-If you do not pass this flag, or specify the option @code{all}, then all
+If you do not pass this flag, or specify the option @code{default}, then the
default languages available in the @file{gcc} sub-tree will be configured.
Ada, Go, Jit, and Objective-C++ are not default languages. LTO is not a
default language, but is built by default because @option{--enable-lto} is
-enabled by default. The other languages are default languages.
+enabled by default. The other languages are default languages. If
+@code{all} is specified, then all available languages are built. An
+exception is @code{jit} language, which requires
+@option{--enable-host-shared} to be included with @code{all}.
@item --enable-stage1-languages=@var{lang1},@var{lang2},@dots{}
Specify that a particular subset of compilers and their runtime
Index: configure
===================================================================
--- configure (revision 248286)
+++ configure (working copy)
@@ -556,7 +556,6 @@ enable_option_checking=no
ac_subst_vars='LTLIBOBJS
LIBOBJS
compare_exclusions
-host_shared
stage2_werror_flag
stage1_checking
stage1_cflags
@@ -645,6 +644,7 @@ get_gcc_base_ver
extra_host_zlib_configure_flags
extra_host_libiberty_configure_flags
stage1_languages
+host_shared
extra_linker_plugin_flags
extra_linker_plugin_configure_flags
islinc
@@ -781,6 +781,7 @@ enable_isl_version_check
enable_lto
enable_linker_plugin_configure_flags
enable_linker_plugin_flags
+enable_host_shared
enable_stage1_languages
enable_objc_gc
with_target_bdw_gc
@@ -796,7 +797,6 @@ with_build_time_tools
enable_maintainer_mode
enable_stage1_checking
enable_werror
-enable_host_shared
'
ac_precious_vars='build_alias
host_alias
@@ -1498,6 +1498,7 @@ Optional Features:
--enable-linker-plugin-flags=FLAGS
additional flags for configuring and building linker
plugins [none]
+ --enable-host-shared build host code as shared libraries
--enable-stage1-languages[=all]
choose additional languages to build during stage1.
Mostly useful for compiler development
@@ -1515,7 +1516,6 @@ Optional Features:
choose additional checking for stage1 of the
compiler
--enable-werror enable -Werror in bootstrap stage2 and later
- --enable-host-shared build host code as shared libraries
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -6090,6 +6090,16 @@ fi
+# Enable --enable-host-shared.
+# Checked early to determine whether jit is an 'all' language
+# Check whether --enable-host-shared was given.
+if test "${enable_host_shared+set}" = set; then :
+ enableval=$enable_host_shared; host_shared=$enableval
+else
+ host_shared=no
+fi
+
+
# By default, C and C++ are the only stage 1 languages.
stage1_languages=,c,
@@ -6108,7 +6118,7 @@ if test -d ${srcdir}/gcc; then
enable_languages="${LANGUAGES}"
echo configure.ac: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
else
- enable_languages=all
+ enable_languages=default
fi
else
if test x"${enable_languages}" = x ||
@@ -6160,6 +6170,7 @@ if test -d ${srcdir}/gcc; then
for other in ${lang_requires} ${lang_requires_boot_languages}; do
case ,${enable_languages}, in
*,$other,*) ;;
+ *,default,*) ;;
*,all,*) ;;
*,$language,*)
echo " \`$other' language required by \`$language'; enabling" 1>&2
@@ -6171,6 +6182,7 @@ if test -d ${srcdir}/gcc; then
if test "$other" != "c"; then
case ,${enable_stage1_languages}, in
*,$other,*) ;;
+ *,default,*) ;;
*,all,*) ;;
*)
case ,${enable_languages}, in
@@ -6208,7 +6220,7 @@ if test -d ${srcdir}/gcc; then
esac
fi
- missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
+ missing_languages=`echo ",$enable_languages," | sed -e s/,default,/,/ -e s/,all,/,/ -e s/,c,/,/ `
potential_languages=,c,
enabled_target_libs=
@@ -6240,21 +6252,28 @@ if test -d ${srcdir}/gcc; then
fi
add_this_lang=no
- case ,${enable_languages}, in
- *,${language},*)
- # Language was explicitly selected; include it
- # unless it is C, which is enabled by default.
- if test "$language" != "c"; then
+ # C is always enabled, so no need to add it again
+ if test "$language" != "c"; then
+ case ,${enable_languages}, in
+ *,${language},*)
+ # Language was explicitly selected; include it
add_this_lang=yes
- fi
- ;;
- *,all,*)
- # 'all' was selected, select it if it is a default language
- if test "$language" != "c"; then
+ ;;
+ *,all,*)
+ # All languages are enabled
+ if test "$language:$host_shared" = "jit:no" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: not enabling language \"jit\" as --enable-host-shared not specified" >&5
+$as_echo "$as_me: WARNING: not enabling language \"jit\" as --enable-host-shared not specified" >&2;}
+ else
+ add_this_lang=yes
+ fi
+ ;;
+ *,default,*)
+ # 'default' was selected, select it if it is a default language
add_this_lang=${build_by_default}
- fi
- ;;
- esac
+ ;;
+ esac
+ fi
# Disable languages that need other directories if these aren't available.
for i in $subdir_requires; do
@@ -6283,6 +6302,8 @@ if test -d ${srcdir}/gcc; then
;;
esac
+ # Disable jit if -enable-host-shared not specified
+
# Disable a language that is unsupported by the target.
case " $unsupported_languages " in
*" $language "*)
@@ -14604,16 +14625,6 @@ if test -d ${srcdir}/gcc && test x"`cat
fi
-
-# Enable --enable-host-shared.
-# Check whether --enable-host-shared was given.
-if test "${enable_host_shared+set}" = set; then :
- enableval=$enable_host_shared; host_shared=$enableval
-else
- host_shared=no
-fi
-
-
# PR jit/64780: Require the user to explicitly specify
# --enable-host-shared if the jit is enabled, hinting
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [config PATCH] --enable-languages
2017-05-19 17:05 [config PATCH] --enable-languages Nathan Sidwell
@ 2017-05-19 20:07 ` Mike Stump
2017-05-24 13:43 ` Richard Biener
2017-05-24 20:11 ` Martin Sebor
2 siblings, 0 replies; 6+ messages in thread
From: Mike Stump @ 2017-05-19 20:07 UTC (permalink / raw)
To: Nathan Sidwell; +Cc: GCC Patches
On May 19, 2017, at 9:59 AM, Nathan Sidwell <nathan@acm.org> wrote:
>
> --enable-languages=all confused me, because as RichardB said, 'it really means default'. So this patch does 2 things
> 1) allow --enable-languages=default to mean what =all does now.
> 2) change =all to mean all available languages.
> 2.1) jit is included in =all if -enable-host-shared is given. If you don't you get a warning that JIT's not included.
>
> If you're used to saying =all, then you'll get more languages with this patch than you used to.
>
> ok?
Can't approve the patch, but I'd endorse it. I think it is easier to explain.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [config PATCH] --enable-languages
2017-05-19 17:05 [config PATCH] --enable-languages Nathan Sidwell
2017-05-19 20:07 ` Mike Stump
@ 2017-05-24 13:43 ` Richard Biener
2017-05-24 16:33 ` Nathan Sidwell
2017-05-24 20:11 ` Martin Sebor
2 siblings, 1 reply; 6+ messages in thread
From: Richard Biener @ 2017-05-24 13:43 UTC (permalink / raw)
To: Nathan Sidwell; +Cc: GCC Patches
On Fri, May 19, 2017 at 6:59 PM, Nathan Sidwell <nathan@acm.org> wrote:
> --enable-languages=all confused me, because as RichardB said, 'it really
> means default'. So this patch does 2 things
> 1) allow --enable-languages=default to mean what =all does now.
> 2) change =all to mean all available languages.
> 2.1) jit is included in =all if -enable-host-shared is given. If you don't
> you get a warning that JIT's not included.
>
> If you're used to saying =all, then you'll get more languages with this
> patch than you used to.
>
> ok?
Ok. Did you check =all works with/without a host Ada compiler installed?
(warning but not including ada in the without case?)
Richard.
> nathan
> --
> Nathan Sidwell
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [config PATCH] --enable-languages
2017-05-24 13:43 ` Richard Biener
@ 2017-05-24 16:33 ` Nathan Sidwell
2017-06-10 21:10 ` Gerald Pfeifer
0 siblings, 1 reply; 6+ messages in thread
From: Nathan Sidwell @ 2017-05-24 16:33 UTC (permalink / raw)
To: Richard Biener; +Cc: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 825 bytes --]
On 05/24/2017 09:41 AM, Richard Biener wrote:
> Ok. Did you check =all works with/without a host Ada compiler installed?
> (warning but not including ada in the without case?)
I checked on a system lacking ada, but I do notice there is no warning,
which seems undesirable.
This patch tweaks things so that 'all' sets add_this_language to 'all'
and we can thus distinguish this mode of enabling it to explicitly
enabling it. in the 'all' case, if it's not permitted, you get a
warning. In the explicit case you'll get an error.
Thus:
configure: WARNING: GNAT is required to build ada
configure: WARNING: --enable-host-shared required to build jit
(you get the fuller JIT error when you explicitly try and enable it.)
I'll commit this version in a few days, if there are no objections.
nathan
--
Nathan Sidwell
[-- Attachment #2: cfg.diff --]
[-- Type: text/x-patch, Size: 18320 bytes --]
2017-05-24 Nathan Sidwell <nathan@acm.org>
* configure.ac: Add --enable-languages=default to mean default and
make --enable-languages=all mean all supported languages.
* configure: Regenerated.
gcc/
* doc/invoke.texi (--enable-languages): Update documentation.
Index: configure
===================================================================
--- configure (revision 248422)
+++ configure (working copy)
@@ -556,7 +556,6 @@ enable_option_checking=no
ac_subst_vars='LTLIBOBJS
LIBOBJS
compare_exclusions
-host_shared
stage2_werror_flag
stage1_checking
stage1_cflags
@@ -645,6 +644,7 @@ get_gcc_base_ver
extra_host_zlib_configure_flags
extra_host_libiberty_configure_flags
stage1_languages
+host_shared
extra_linker_plugin_flags
extra_linker_plugin_configure_flags
islinc
@@ -781,6 +781,7 @@ enable_isl_version_check
enable_lto
enable_linker_plugin_configure_flags
enable_linker_plugin_flags
+enable_host_shared
enable_stage1_languages
enable_objc_gc
with_target_bdw_gc
@@ -796,7 +797,6 @@ with_build_time_tools
enable_maintainer_mode
enable_stage1_checking
enable_werror
-enable_host_shared
'
ac_precious_vars='build_alias
host_alias
@@ -1498,6 +1498,7 @@ Optional Features:
--enable-linker-plugin-flags=FLAGS
additional flags for configuring and building linker
plugins [none]
+ --enable-host-shared build host code as shared libraries
--enable-stage1-languages[=all]
choose additional languages to build during stage1.
Mostly useful for compiler development
@@ -1515,7 +1516,6 @@ Optional Features:
choose additional checking for stage1 of the
compiler
--enable-werror enable -Werror in bootstrap stage2 and later
- --enable-host-shared build host code as shared libraries
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -6090,6 +6090,16 @@ fi
+# Enable --enable-host-shared.
+# Checked early to determine whether jit is an 'all' language
+# Check whether --enable-host-shared was given.
+if test "${enable_host_shared+set}" = set; then :
+ enableval=$enable_host_shared; host_shared=$enableval
+else
+ host_shared=no
+fi
+
+
# By default, C and C++ are the only stage 1 languages.
stage1_languages=,c,
@@ -6108,7 +6118,7 @@ if test -d ${srcdir}/gcc; then
enable_languages="${LANGUAGES}"
echo configure.ac: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
else
- enable_languages=all
+ enable_languages=default
fi
else
if test x"${enable_languages}" = x ||
@@ -6160,6 +6170,7 @@ if test -d ${srcdir}/gcc; then
for other in ${lang_requires} ${lang_requires_boot_languages}; do
case ,${enable_languages}, in
*,$other,*) ;;
+ *,default,*) ;;
*,all,*) ;;
*,$language,*)
echo " \`$other' language required by \`$language'; enabling" 1>&2
@@ -6171,6 +6182,7 @@ if test -d ${srcdir}/gcc; then
if test "$other" != "c"; then
case ,${enable_stage1_languages}, in
*,$other,*) ;;
+ *,default,*) ;;
*,all,*) ;;
*)
case ,${enable_languages}, in
@@ -6208,7 +6220,7 @@ if test -d ${srcdir}/gcc; then
esac
fi
- missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
+ missing_languages=`echo ",$enable_languages," | sed -e s/,default,/,/ -e s/,all,/,/ -e s/,c,/,/ `
potential_languages=,c,
enabled_target_libs=
@@ -6240,30 +6252,37 @@ if test -d ${srcdir}/gcc; then
fi
add_this_lang=no
- case ,${enable_languages}, in
- *,${language},*)
- # Language was explicitly selected; include it
- # unless it is C, which is enabled by default.
- if test "$language" != "c"; then
+ # C is always enabled, so no need to add it again
+ if test "$language" != "c"; then
+ case ,${enable_languages}, in
+ *,${language},*)
+ # Language was explicitly selected; include it
add_this_lang=yes
- fi
- ;;
- *,all,*)
- # 'all' was selected, select it if it is a default language
- if test "$language" != "c"; then
+ ;;
+ *,all,*)
+ # All languages are enabled
+ add_this_lang=all
+ ;;
+ *,default,*)
+ # 'default' was selected, select it if it is a default language
add_this_lang=${build_by_default}
- fi
- ;;
- esac
+ ;;
+ esac
+ fi
# Disable languages that need other directories if these aren't available.
for i in $subdir_requires; do
test -f "$srcdir/gcc/$i/config-lang.in" && continue
- case ,${enable_languages}, in
- *,${language},*)
+ case ${add_this_lang} in
+ yes)
# Specifically requested language; tell them.
as_fn_error "The gcc/$i directory contains parts of $language but is missing" "$LINENO" 5
;;
+ all)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The gcc/$i directory contains parts of $language but is missing" >&5
+$as_echo "$as_me: WARNING: The gcc/$i directory contains parts of $language but is missing" >&2;}
+ add_this_lang=unsupported
+ ;;
*)
# Silently disable.
add_this_lang=unsupported
@@ -6272,20 +6291,55 @@ if test -d ${srcdir}/gcc; then
done
# Disable Ada if no preexisting GNAT is available.
- case ,${enable_languages},:${language}:${have_gnat} in
- *,${language},*:ada:no)
+ case ${add_this_lang}:${language}:${have_gnat} in
+ yes:ada:no)
# Specifically requested language; tell them.
as_fn_error "GNAT is required to build $language" "$LINENO" 5
;;
+ all:ada:no)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GNAT is required to build $language" >&5
+$as_echo "$as_me: WARNING: GNAT is required to build $language" >&2;}
+ add_this_lang=unsupported
+ ;;
*:ada:no)
# Silently disable.
add_this_lang=unsupported
;;
esac
- # Disable a language that is unsupported by the target.
- case " $unsupported_languages " in
- *" $language "*)
+ # Disable jit if -enable-host-shared not specified
+ case ${add_this_lang}:${language}:${host_shared} in
+ yes:jit:no)
+ # PR jit/64780: explicitly specify --enable-host-shared
+ as_fn_error "
+Enabling language \"jit\" requires --enable-host-shared.
+
+--enable-host-shared typically slows the rest of the compiler down by
+a few %, so you must explicitly enable it.
+
+If you want to build both the jit and the regular compiler, it is often
+best to do this via two separate configure/builds, in separate
+directories, to avoid imposing the performance cost of
+--enable-host-shared on the regular compiler." "$LINENO" 5
+ ;;
+ all:jit:no)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-host-shared required to build $language" >&5
+$as_echo "$as_me: WARNING: --enable-host-shared required to build $language" >&2;}
+ add_this_lang=unsupported
+ ;;
+ *:jit:no)
+ # Silently disable.
+ add_this_lang=unsupported
+ ;;
+ esac
+
+ # Disable a language that is unsupported by the target.
+ case "${add_this_lang}: $unsupported_languages " in
+ no:*) ;;
+ unsupported:*) ;;
+ *:*" $language "*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${language} not supported for this target" >&5
+$as_echo "$as_me: WARNING: ${language} not supported for this target" >&2;}
add_this_lang=unsupported
;;
esac
@@ -6302,7 +6356,7 @@ if test -d ${srcdir}/gcc; then
noconfigdirs="$noconfigdirs $lang_dirs"
potential_languages="${potential_languages}${language},"
;;
- yes)
+ all|yes)
new_enable_languages="${new_enable_languages}${language},"
potential_languages="${potential_languages}${language},"
missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"`
@@ -14605,40 +14659,6 @@ fi
-# Enable --enable-host-shared.
-# Check whether --enable-host-shared was given.
-if test "${enable_host_shared+set}" = set; then :
- enableval=$enable_host_shared; host_shared=$enableval
-else
- host_shared=no
-fi
-
-
-
-# PR jit/64780: Require the user to explicitly specify
-# --enable-host-shared if the jit is enabled, hinting
-# that they might want to do a separate configure/build of
-# the jit, to avoid users from slowing down the rest of the
-# compiler by enabling the jit.
-if test ${host_shared} = "no" ; then
- case "${enable_languages}" in
- *jit*)
- as_fn_error "
-Enabling language \"jit\" requires --enable-host-shared.
-
---enable-host-shared typically slows the rest of the compiler down by
-a few %, so you must explicitly enable it.
-
-If you want to build both the jit and the regular compiler, it is often
-best to do this via two separate configure/builds, in separate
-directories, to avoid imposing the performance cost of
---enable-host-shared on the regular compiler." "$LINENO" 5
- ;;
- *)
- ;;
- esac
-fi
-
# Specify what files to not compare during bootstrap.
compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
Index: configure.ac
===================================================================
--- configure.ac (revision 248422)
+++ configure.ac (working copy)
@@ -1766,6 +1766,13 @@ AC_ARG_ENABLE(linker-plugin-flags,
extra_linker_plugin_flags=)
AC_SUBST(extra_linker_plugin_flags)
+# Enable --enable-host-shared.
+# Checked early to determine whether jit is an 'all' language
+AC_ARG_ENABLE(host-shared,
+[AS_HELP_STRING([--enable-host-shared],
+ [build host code as shared libraries])],
+[host_shared=$enableval], [host_shared=no])
+AC_SUBST(host_shared)
# By default, C and C++ are the only stage 1 languages.
stage1_languages=,c,
@@ -1784,7 +1791,7 @@ if test -d ${srcdir}/gcc; then
enable_languages="${LANGUAGES}"
echo configure.ac: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
else
- enable_languages=all
+ enable_languages=default
fi
else
if test x"${enable_languages}" = x ||
@@ -1836,6 +1843,7 @@ if test -d ${srcdir}/gcc; then
for other in ${lang_requires} ${lang_requires_boot_languages}; do
case ,${enable_languages}, in
*,$other,*) ;;
+ *,default,*) ;;
*,all,*) ;;
*,$language,*)
echo " \`$other' language required by \`$language'; enabling" 1>&2
@@ -1847,6 +1855,7 @@ if test -d ${srcdir}/gcc; then
if test "$other" != "c"; then
case ,${enable_stage1_languages}, in
*,$other,*) ;;
+ *,default,*) ;;
*,all,*) ;;
*)
case ,${enable_languages}, in
@@ -1884,7 +1893,7 @@ if test -d ${srcdir}/gcc; then
esac
fi
- missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
+ missing_languages=`echo ",$enable_languages," | sed -e s/,default,/,/ -e s/,all,/,/ -e s/,c,/,/ `
potential_languages=,c,
enabled_target_libs=
@@ -1916,30 +1925,36 @@ if test -d ${srcdir}/gcc; then
fi
add_this_lang=no
- case ,${enable_languages}, in
- *,${language},*)
- # Language was explicitly selected; include it
- # unless it is C, which is enabled by default.
- if test "$language" != "c"; then
+ # C is always enabled, so no need to add it again
+ if test "$language" != "c"; then
+ case ,${enable_languages}, in
+ *,${language},*)
+ # Language was explicitly selected; include it
add_this_lang=yes
- fi
- ;;
- *,all,*)
- # 'all' was selected, select it if it is a default language
- if test "$language" != "c"; then
+ ;;
+ *,all,*)
+ # All languages are enabled
+ add_this_lang=all
+ ;;
+ *,default,*)
+ # 'default' was selected, select it if it is a default language
add_this_lang=${build_by_default}
- fi
- ;;
- esac
+ ;;
+ esac
+ fi
# Disable languages that need other directories if these aren't available.
for i in $subdir_requires; do
test -f "$srcdir/gcc/$i/config-lang.in" && continue
- case ,${enable_languages}, in
- *,${language},*)
+ case ${add_this_lang} in
+ yes)
# Specifically requested language; tell them.
AC_MSG_ERROR([The gcc/$i directory contains parts of $language but is missing])
;;
+ all)
+ AC_MSG_WARN([The gcc/$i directory contains parts of $language but is missing])
+ add_this_lang=unsupported
+ ;;
*)
# Silently disable.
add_this_lang=unsupported
@@ -1948,20 +1963,52 @@ if test -d ${srcdir}/gcc; then
done
# Disable Ada if no preexisting GNAT is available.
- case ,${enable_languages},:${language}:${have_gnat} in
- *,${language},*:ada:no)
+ case ${add_this_lang}:${language}:${have_gnat} in
+ yes:ada:no)
# Specifically requested language; tell them.
AC_MSG_ERROR([GNAT is required to build $language])
;;
+ all:ada:no)
+ AC_MSG_WARN([GNAT is required to build $language])
+ add_this_lang=unsupported
+ ;;
*:ada:no)
# Silently disable.
add_this_lang=unsupported
;;
esac
- # Disable a language that is unsupported by the target.
- case " $unsupported_languages " in
- *" $language "*)
+ # Disable jit if -enable-host-shared not specified
+ case ${add_this_lang}:${language}:${host_shared} in
+ yes:jit:no)
+ # PR jit/64780: explicitly specify --enable-host-shared
+ AC_MSG_ERROR([
+Enabling language "jit" requires --enable-host-shared.
+
+--enable-host-shared typically slows the rest of the compiler down by
+a few %, so you must explicitly enable it.
+
+If you want to build both the jit and the regular compiler, it is often
+best to do this via two separate configure/builds, in separate
+directories, to avoid imposing the performance cost of
+--enable-host-shared on the regular compiler.])
+ ;;
+ all:jit:no)
+ AC_MSG_WARN([--enable-host-shared required to build $language])
+ add_this_lang=unsupported
+ ;;
+ *:jit:no)
+ # Silently disable.
+ add_this_lang=unsupported
+ ;;
+ esac
+
+ # Disable a language that is unsupported by the target.
+ case "${add_this_lang}: $unsupported_languages " in
+ no:*) ;;
+ unsupported:*) ;;
+ *:*" $language "*)
+ AC_MSG_WARN([${language} not supported for this target])
add_this_lang=unsupported
;;
esac
@@ -1978,7 +2025,7 @@ if test -d ${srcdir}/gcc; then
noconfigdirs="$noconfigdirs $lang_dirs"
potential_languages="${potential_languages}${language},"
;;
- yes)
+ all|yes)
new_enable_languages="${new_enable_languages}${language},"
potential_languages="${potential_languages}${language},"
missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"`
@@ -3478,37 +3525,6 @@ fi
AC_SUBST(stage2_werror_flag)
-# Enable --enable-host-shared.
-AC_ARG_ENABLE(host-shared,
-[AS_HELP_STRING([--enable-host-shared],
- [build host code as shared libraries])],
-[host_shared=$enableval], [host_shared=no])
-AC_SUBST(host_shared)
-
-# PR jit/64780: Require the user to explicitly specify
-# --enable-host-shared if the jit is enabled, hinting
-# that they might want to do a separate configure/build of
-# the jit, to avoid users from slowing down the rest of the
-# compiler by enabling the jit.
-if test ${host_shared} = "no" ; then
- case "${enable_languages}" in
- *jit*)
- AC_MSG_ERROR([
-Enabling language "jit" requires --enable-host-shared.
-
---enable-host-shared typically slows the rest of the compiler down by
-a few %, so you must explicitly enable it.
-
-If you want to build both the jit and the regular compiler, it is often
-best to do this via two separate configure/builds, in separate
-directories, to avoid imposing the performance cost of
---enable-host-shared on the regular compiler.])
- ;;
- *)
- ;;
- esac
-fi
-
# Specify what files to not compare during bootstrap.
compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi (revision 248422)
+++ gcc/doc/install.texi (working copy)
@@ -1621,14 +1621,17 @@ their runtime libraries should be built.
grep ^language= */config-lang.in
@end smallexample
Currently, you can use any of the following:
-@code{all}, @code{ada}, @code{c}, @code{c++}, @code{fortran},
+@code{all}, @code{default}, @code{ada}, @code{c}, @code{c++}, @code{fortran},
@code{go}, @code{jit}, @code{lto}, @code{objc}, @code{obj-c++}.
Building the Ada compiler has special requirements, see below.
-If you do not pass this flag, or specify the option @code{all}, then all
+If you do not pass this flag, or specify the option @code{default}, then the
default languages available in the @file{gcc} sub-tree will be configured.
Ada, Go, Jit, and Objective-C++ are not default languages. LTO is not a
default language, but is built by default because @option{--enable-lto} is
-enabled by default. The other languages are default languages.
+enabled by default. The other languages are default languages. If
+@code{all} is specified, then all available languages are built. An
+exception is @code{jit} language, which requires
+@option{--enable-host-shared} to be included with @code{all}.
@item --enable-stage1-languages=@var{lang1},@var{lang2},@dots{}
Specify that a particular subset of compilers and their runtime
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [config PATCH] --enable-languages
2017-05-19 17:05 [config PATCH] --enable-languages Nathan Sidwell
2017-05-19 20:07 ` Mike Stump
2017-05-24 13:43 ` Richard Biener
@ 2017-05-24 20:11 ` Martin Sebor
2 siblings, 0 replies; 6+ messages in thread
From: Martin Sebor @ 2017-05-24 20:11 UTC (permalink / raw)
To: Nathan Sidwell, GCC Patches
On 05/19/2017 10:59 AM, Nathan Sidwell wrote:
> --enable-languages=all confused me, because as RichardB said, 'it really
> means default'. So this patch does 2 things
> 1) allow --enable-languages=default to mean what =all does now.
> 2) change =all to mean all available languages.
> 2.1) jit is included in =all if -enable-host-shared is given. If you
> don't you get a warning that JIT's not included.
>
> If you're used to saying =all, then you'll get more languages with this
> patch than you used to.
>
> ok?
FWIW, it took me a few broken bootstraps before I remembered that
all didn't actually mean all but just some. I've since trained
myself to spell out all the languages explicitly (in addition to
typing all just to be safe) but I'm happy to see that I wasn't
the only one shaking his head at the confusing misnomer. Thanks
for fixing it!
Martin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [config PATCH] --enable-languages
2017-05-24 16:33 ` Nathan Sidwell
@ 2017-06-10 21:10 ` Gerald Pfeifer
0 siblings, 0 replies; 6+ messages in thread
From: Gerald Pfeifer @ 2017-06-10 21:10 UTC (permalink / raw)
To: Nathan Sidwell; +Cc: Richard Biener, gcc-patches
On Wed, 24 May 2017, Nathan Sidwell wrote:
> Thus:
> configure: WARNING: GNAT is required to build ada
> configure: WARNING: --enable-host-shared required to build jit
Nice.
> I'll commit this version in a few days, if there are no objections.
Thanks for doing this!
Gerald
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-06-10 21:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 17:05 [config PATCH] --enable-languages Nathan Sidwell
2017-05-19 20:07 ` Mike Stump
2017-05-24 13:43 ` Richard Biener
2017-05-24 16:33 ` Nathan Sidwell
2017-06-10 21:10 ` Gerald Pfeifer
2017-05-24 20:11 ` Martin Sebor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).