* PATCH RFA: Permit languages to share target_libs
@ 2010-11-20 1:44 Ian Lance Taylor
2010-11-20 14:17 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Ian Lance Taylor @ 2010-11-20 1:44 UTC (permalink / raw)
To: Ralf Wildenhues; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]
OK, here is a different approach for the issue that target-libgo
requires target-libffi. With this patch, we only add target_libs for
disabled languages to noconfigdirs if they are not in target_libs for
any enabled languages.
In order to make this work for Go, I had to prevent --disable-libgcj
from adding libffi to noconfigdirs. This does mean that libffi will be
built for the case of --enable-languages=java --disable-libgcj, unless
libffi is disabled for the target. I don't think that is a big deal. I
doubt this is a widely used case, and libffi is a small library.
Bootstrapped on x86_64-unknown-linux-gnu. I configured with the
following options and examined the generated Makefile to make sure that
it looked OK:
--enable-languages=c
--enable-languages=c,java
--enable-languages=c,go
--enable-languages=c,go,java
--enable-languages=c,go,java --enable-libgcj
--enable-languages=c,go,java --disable-libgcj
OK for mainline?
Ian
2010-11-19 Ian Lance Taylor <iant@google.com>
* configure.ac: Only disable a language library if no language needs
it. Don't let --disable-libgcj uncondtionally disable libffi.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: configure --]
[-- Type: text/x-diff, Size: 2526 bytes --]
Index: configure.ac
===================================================================
--- configure.ac (revision 166959)
+++ configure.ac (working copy)
@@ -451,7 +451,8 @@ yes)
;;
no)
# Make sure we get it printed in the list of not supported target libs.
- noconfigdirs="$noconfigdirs ${libgcj}"
+ # Don't disable libffi, though, other languages use it.
+ noconfigdirs="$noconfigdirs `echo ${libgcj} | sed -e 's/target-libffi//'`"
;;
esac
@@ -1765,6 +1766,9 @@ if test -d ${srcdir}/gcc; then
missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
potential_languages=,c,
+ enabled_target_libs=
+ disabled_target_libs=
+
for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
case ${lang_frag} in
..) ;;
@@ -1842,17 +1846,20 @@ if test -d ${srcdir}/gcc; then
case $add_this_lang in
unsupported)
# Remove language-dependent dirs.
- eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\"
+ disabled_target_libs="$disabled_target_libs $target_libs"
+ noconfigdirs="$noconfigdirs $lang_dirs"
;;
no)
# Remove language-dependent dirs; still show language as supported.
- eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\"
+ disabled_target_libs="$disabled_target_libs $target_libs"
+ noconfigdirs="$noconfigdirs $lang_dirs"
potential_languages="${potential_languages}${language},"
;;
yes)
new_enable_languages="${new_enable_languages}${language},"
potential_languages="${potential_languages}${language},"
missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"`
+ enabled_target_libs="$enabled_target_libs $target_libs"
case "${boot_language}:,$enable_stage1_languages," in
yes:* | *:*,$language,* | *:*,yes, | *:*,all,)
# Add to (comma-separated) list of stage 1 languages.
@@ -1870,6 +1877,17 @@ if test -d ${srcdir}/gcc; then
esac
done
+ # Add target libraries which are only needed for disabled languages
+ # to noconfigdirs.
+ if test -n "$disabled_target_libs"; then
+ for dir in $disabled_target_libs; do
+ case " $enabled_target_libs " in
+ *" ${dir} "*) ;;
+ *) noconfigdirs="$noconfigdirs $dir" ;;
+ esac
+ done
+ fi
+
AC_ARG_ENABLE(stage1-languages,
[ --enable-stage1-languages@<:@=all@:>@ choose additional languages to build during
stage1. Mostly useful for compiler development.],
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH RFA: Permit languages to share target_libs
2010-11-20 1:44 PATCH RFA: Permit languages to share target_libs Ian Lance Taylor
@ 2010-11-20 14:17 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2010-11-20 14:17 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: Ralf Wildenhues, gcc-patches
On 11/20/2010 12:01 AM, Ian Lance Taylor wrote:
> Bootstrapped on x86_64-unknown-linux-gnu. I configured with the
> following options and examined the generated Makefile to make sure that
> it looked OK:
>
> --enable-languages=c
> --enable-languages=c,java
> --enable-languages=c,go
> --enable-languages=c,go,java
> --enable-languages=c,go,java --enable-libgcj
> --enable-languages=c,go,java --disable-libgcj
>
> OK for mainline?
Yes, much nicer, thanks!
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-20 13:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-20 1:44 PATCH RFA: Permit languages to share target_libs Ian Lance Taylor
2010-11-20 14:17 ` Paolo Bonzini
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).