[gcc r17-5471] libphobos: Fix libtool support
Pietro Monteiro
pietro@gcc.gnu.org
Wed Oct 21 21:14:24 GMT 2026
https://gcc.gnu.org/g:77b872105c065a906093b71f39e7442316fa736a
commit r17-5471-g77b872105c065a906093b71f39e7442316fa736a
Author: Pietro Monteiro <pietro@sociotechnical.xyz>
Date: Mon Oct 19 18:25:03 2026 -0400
libphobos: Fix libtool support
_LT_LANG_D_CONFIG used AC_LANG_SAVE ... AC_LANG_RESTORE without using
AC_LANG to change the language to D. That made autoconf use C for the
tests. Instead of adding AC_LANG, use AC_LANG_PUSH and AC_LANG_POP
because AC_LANG_SAVE and AC_LANG_RESTORE are deprecated.
libphobos/ChangeLog:
* configure: Regenerate.
* m4/libtool.m4 (_LT_LANG_D_CONFIG): Use AC_LANG_PUSH,
AC_LANG_POP instead of AC_LANG_SAVE, AC_LANG_RESTORE.
Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
Diff:
---
libphobos/configure | 127 +++++++++++++++++++++++-------------------------
libphobos/m4/libtool.m4 | 4 +-
2 files changed, 64 insertions(+), 67 deletions(-)
diff --git a/libphobos/configure b/libphobos/configure
index 909e6debffdb..07da7231cff1 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -2010,6 +2010,52 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_func
+# ac_fn_d_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_d_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_d_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_d_try_link
+
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
# ----------------------------------------------------
# Tries to find if the field MEMBER exists in type AGGR, after including
@@ -2066,52 +2112,6 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_member
-
-# ac_fn_d_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_d_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_d_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_d_try_link
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -12599,6 +12599,10 @@ CC="$lt_save_CC"
gdc_save_DFLAGS=$GDCFLAGS
GDCFLAGS="-fno-druntime -nostdinc -I $phobos_cv_abs_srcdir/libdruntime $GDCFLAGS"
+ ac_ext=d
+ac_compile='$GDC -c $GDCFLAGS conftest.$ac_ext >&5'
+ac_link='$GDC -o conftest$ac_exeext $GDCFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=yes
# Source file extension for D test sources.
@@ -13750,18 +13754,15 @@ _LT_EOF
allow_undefined_flag_D='-berok'
# Determine the default libpath from the value encoded in an
# empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ cat > conftest.$ac_ext <<_ACEOF
+module object;
-int
-main ()
-{
- ;
- return 0;
+extern(C) int main() {
+
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_d_try_link "$LINENO"; then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
@@ -13790,18 +13791,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
else
# Determine the default libpath from the value encoded in an
# empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ cat > conftest.$ac_ext <<_ACEOF
+module object;
-int
-main ()
-{
- ;
- return 0;
+extern(C) int main() {
+
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_d_try_link "$LINENO"; then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
@@ -14081,11 +14079,10 @@ fi
# implicitly export all symbols.
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ cat > conftest.$ac_ext <<_ACEOF
int foo(void) {}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_d_try_link "$LINENO"; then :
archive_expsym_cmds_D='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
fi
diff --git a/libphobos/m4/libtool.m4 b/libphobos/m4/libtool.m4
index 0263a530cf01..34bbc30f9a58 100644
--- a/libphobos/m4/libtool.m4
+++ b/libphobos/m4/libtool.m4
@@ -10,7 +10,7 @@
# to write the compiler configuration to `libtool'.
m4_defun([_LT_LANG_D_CONFIG],
[AC_REQUIRE([AC_PROG_GDC])dnl
-AC_LANG_SAVE
+AC_LANG_PUSH([D])
# Source file extension for D test sources.
ac_ext=d
@@ -72,7 +72,7 @@ if test -n "$compiler"; then
_LT_CONFIG($1)
fi
-AC_LANG_RESTORE
+AC_LANG_POP([D])
GCC=$lt_save_GCC
CC=$lt_save_CC
More information about the Gcc-cvs
mailing list