Hi Andrew, Andrew Burgess <andrew.burg...@embecosm.com> wrote:
> * Iain Sandoe <idsan...@googlemail.com> [2020-01-28 10:34:52 +0000]: >> * Before the patch, libcpp and gcc configury finds this and they agree on >> the availability of ICONV (#define HAVE_ICONV 1). >> >> * After the patch libcpp no longer thinks iconv is available, but gcc >> continues to find it - and that, I think, leads to it attempting tests for >> which libcpp has not been configured. > > This must be a bug, right? With no changes to the configure scripts > both components should continue to find libiconv after this patch. > Even with the failure to update gcc/configure correctly (see below) > libcpp should continue to find the exact same libraries as before. not exactly sure which component you think has the bug in this case… >> Can you clarify why there’s no need to match the configury changes in libcpp >> / gcc / libstdc++ ? > > This is the same issue that Tobias pointed out, and was a result of me > incorrectly trying to regenerate the configure files. .. but it seems that the combination of the two things produced the configuration mismatch .. > Let me know if this resolves the problems you're seeing and if it does > I'll prepare it for submission. I did a smoke test on Darwin19 and the amended patch allowed bootstrap to complete. ICONV is seen in both libcpp and gcc (that’s not an exhaustive check and the testsuite is still running). I’ll add this to my overnight runs - “overnight” means results later tomorrow for the slower targets - but it looks encouraging. thanks, Iain > > > diff --git a/config/lib-link.m4 b/config/lib-link.m4 > index 662192e0a07..20e281fd323 100644 > --- a/config/lib-link.m4 > +++ b/config/lib-link.m4 > @@ -492,7 +492,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], > dnl known to the linker and runtime loader. (All the system > dnl directories known to the linker should also be known to the > dnl runtime loader, otherwise the system is severely > misconfigured.) > - if x$lib_type = xauto || x$lib_type = xshared; then > + if test "x$lib_type" = "xauto" || test "x$lib_type" = "xshared"; > then > LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" > LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" > else > diff --git a/gcc/configure b/gcc/configure > index e2c8fc71772..4c2c5991c0e 100755 > --- a/gcc/configure > +++ b/gcc/configure > @@ -974,6 +974,7 @@ with_zstd_include > with_zstd_lib > enable_rpath > with_libiconv_prefix > +with_libiconv_type > enable_sjlj_exceptions > with_gcc_major_version_only > enable_secureplt > @@ -1811,6 +1812,7 @@ Optional Packages: > --with-gnu-ld assume the C compiler uses GNU ld default=no > --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib > --without-libiconv-prefix don't search for libiconv in includedir and > libdir > + --with-libiconv-type=TYPE type of library to search for > (auto/static/shared) > --with-gcc-major-version-only > use only GCC major number in filesystem paths > --with-pic try to use only PIC/non-PIC objects [default=use > @@ -10730,6 +10732,16 @@ if test "${with_libiconv_prefix+set}" = set; then : > > fi > > + > +# Check whether --with-libiconv-type was given. > +if test "${with_libiconv_type+set}" = set; then : > + withval=$with_libiconv_type; with_libiconv_type=$withval > +else > + with_libiconv_type=auto > +fi > + > + lib_type=`eval echo \$with_libiconv_type` > + > LIBICONV= > LTLIBICONV= > INCICONV= > @@ -10767,13 +10779,13 @@ fi > found_so= > found_a= > if test $use_additional = yes; then > - if test -n "$shlibext" && test -f > "$additional_libdir/lib$name.$shlibext"; then > + if test -n "$shlibext" && test -f > "$additional_libdir/lib$name.$shlibext" && test x$lib_type != xstatic; then > found_dir="$additional_libdir" > found_so="$additional_libdir/lib$name.$shlibext" > if test -f "$additional_libdir/lib$name.la"; then > found_la="$additional_libdir/lib$name.la" > fi > - else > + elif test x$lib_type != xshared; then > if test -f "$additional_libdir/lib$name.$libext"; then > found_dir="$additional_libdir" > found_a="$additional_libdir/lib$name.$libext" > @@ -10797,13 +10809,13 @@ fi > case "$x" in > -L*) > dir=`echo "X$x" | sed -e 's/^X-L//'` > - if test -n "$shlibext" && test -f > "$dir/lib$name.$shlibext"; then > + if test -n "$shlibext" && test -f > "$dir/lib$name.$shlibext" && test x$lib_type != xstatic; then > found_dir="$dir" > found_so="$dir/lib$name.$shlibext" > if test -f "$dir/lib$name.la"; then > found_la="$dir/lib$name.la" > fi > - else > + elif test x$lib_type != xshared; then > if test -f "$dir/lib$name.$libext"; then > found_dir="$dir" > found_a="$dir/lib$name.$libext" > @@ -11031,8 +11043,13 @@ fi > done > fi > else > - > LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" > - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" > + if test > "x$lib_type" = "xauto" || test "x$lib_type" = "xshared"; then > + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" > + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" > + else > + LIBICONV="${LIBICONV}${LIBICONV:+ }-l:lib$name.$libext" > + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l:lib$name.$libext" > + fi > fi > fi > fi > diff --git a/intl/configure b/intl/configure > index 2f35993148e..870b29f7d3f 100755 > --- a/intl/configure > +++ b/intl/configure > @@ -719,8 +719,10 @@ enable_nls > with_gnu_ld > enable_rpath > with_libiconv_prefix > +with_libiconv_type > with_included_gettext > with_libintl_prefix > +with_libintl_type > enable_maintainer_mode > ' > ac_precious_vars='build_alias > @@ -1353,9 +1355,11 @@ Optional Packages: > --with-gnu-ld assume the C compiler uses GNU ld default=no > --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib > --without-libiconv-prefix don't search for libiconv in includedir and > libdir > + --with-libiconv-type=TYPE type of library to search for > (auto/static/shared) > --with-included-gettext use the GNU gettext library included here > --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib > --without-libintl-prefix don't search for libintl in includedir and > libdir > + --with-libintl-type=TYPE type of library to search for > (auto/static/shared) > > Some influential environment variables: > CC C compiler command > @@ -5195,6 +5199,16 @@ if test "${with_libiconv_prefix+set}" = set; then : > > fi > > + > +# Check whether --with-libiconv-type was given. > +if test "${with_libiconv_type+set}" = set; then : > + withval=$with_libiconv_type; with_libiconv_type=$withval > +else > + with_libiconv_type=auto > +fi > + > + lib_type=`eval echo \$with_libiconv_type` > + > LIBICONV= > LTLIBICONV= > INCICONV= > @@ -5232,13 +5246,13 @@ fi > found_so= > found_a= > if test $use_additional = yes; then > - if test -n "$shlibext" && test -f > "$additional_libdir/lib$name.$shlibext"; then > + if test -n "$shlibext" && test -f > "$additional_libdir/lib$name.$shlibext" && test x$lib_type != xstatic; then > found_dir="$additional_libdir" > found_so="$additional_libdir/lib$name.$shlibext" > if test -f "$additional_libdir/lib$name.la"; then > found_la="$additional_libdir/lib$name.la" > fi > - else > + elif test x$lib_type != xshared; then > if test -f "$additional_libdir/lib$name.$libext"; then > found_dir="$additional_libdir" > found_a="$additional_libdir/lib$name.$libext" > @@ -5262,13 +5276,13 @@ fi > case "$x" in > -L*) > dir=`echo "X$x" | sed -e 's/^X-L//'` > - if test -n "$shlibext" && test -f > "$dir/lib$name.$shlibext"; then > + if test -n "$shlibext" && test -f > "$dir/lib$name.$shlibext" && test x$lib_type != xstatic; then > found_dir="$dir" > found_so="$dir/lib$name.$shlibext" > if test -f "$dir/lib$name.la"; then > found_la="$dir/lib$name.la" > fi > - else > + elif test x$lib_type != xshared; then > if test -f "$dir/lib$name.$libext"; then > found_dir="$dir" > found_a="$dir/lib$name.$libext" > @@ -5496,8 +5510,13 @@ fi > done > fi > else > - > LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" > - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" > + if test > "x$lib_type" = "xauto" || test "x$lib_type" = "xshared"; then > + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" > + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" > + else > + LIBICONV="${LIBICONV}${LIBICONV:+ }-l:lib$name.$libext" > + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l:lib$name.$libext" > + fi > fi > fi > fi > @@ -6026,6 +6045,16 @@ if test "${with_libintl_prefix+set}" = set; then : > > fi > > + > +# Check whether --with-libintl-type was given. > +if test "${with_libintl_type+set}" = set; then : > + withval=$with_libintl_type; with_libintl_type=$withval > +else > + with_libintl_type=auto > +fi > + > + lib_type=`eval echo \$with_libintl_type` > + > LIBINTL= > LTLIBINTL= > INCINTL= > @@ -6063,13 +6092,13 @@ fi > found_so= > found_a= > if test $use_additional = yes; then > - if test -n "$shlibext" && test -f > "$additional_libdir/lib$name.$shlibext"; then > + if test -n "$shlibext" && test -f > "$additional_libdir/lib$name.$shlibext" && test x$lib_type != xstatic; then > found_dir="$additional_libdir" > found_so="$additional_libdir/lib$name.$shlibext" > if test -f "$additional_libdir/lib$name.la"; then > found_la="$additional_libdir/lib$name.la" > fi > - else > + elif test x$lib_type != xshared; then > if test -f "$additional_libdir/lib$name.$libext"; then > found_dir="$additional_libdir" > found_a="$additional_libdir/lib$name.$libext" > @@ -6093,13 +6122,13 @@ fi > case "$x" in > -L*) > dir=`echo "X$x" | sed -e 's/^X-L//'` > - if test -n "$shlibext" && test -f > "$dir/lib$name.$shlibext"; then > + if test -n "$shlibext" && test -f > "$dir/lib$name.$shlibext" && test x$lib_type != xstatic; then > found_dir="$dir" > found_so="$dir/lib$name.$shlibext" > if test -f "$dir/lib$name.la"; then > found_la="$dir/lib$name.la" > fi > - else > + elif test x$lib_type != xshared; then > if test -f "$dir/lib$name.$libext"; then > found_dir="$dir" > found_a="$dir/lib$name.$libext" > @@ -6327,8 +6356,13 @@ fi > done > fi > else > - > LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" > - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" > + if test > "x$lib_type" = "xauto" || test "x$lib_type" = "xshared"; then > + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" > + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" > + else > + LIBINTL="${LIBINTL}${LIBINTL:+ }-l:lib$name.$libext" > + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l:lib$name.$libext" > + fi > fi > fi > fi > diff --git a/libcpp/configure b/libcpp/configure > index 7e53cade210..11da199083b 100755 > --- a/libcpp/configure > +++ b/libcpp/configure > @@ -7066,7 +7066,7 @@ fi > done > fi > else > - if x$lib_type = > xauto || x$lib_type = xshared; then > + if test > "x$lib_type" = "xauto" || test "x$lib_type" = "xshared"; then > LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" > LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" > else > diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure > index 5e2892121f4..a39c33b055d 100755 > --- a/libstdc++-v3/configure > +++ b/libstdc++-v3/configure > @@ -29506,7 +29506,7 @@ fi > done > fi > else > - if x$lib_type = > xauto || x$lib_type = xshared; then > + if test > "x$lib_type" = "xauto" || test "x$lib_type" = "xshared"; then > LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" > LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" > else