This patch updates gcc/ to use gcc_base_ver.

I had to drop the \$\$ from the sed expression to get it to work
within the configure script; I'm not entirely sure what their purpose
is.  Without them, it's still matching on the first group of numeric
characters in BASE-VER.

Tested with and without --with-gcc-major-version; in each case,
gcc-driver-name.h is correctly determined.

Fixes the linker issue reported downstream in
and fixes the driver not found issue with:
  gcc_jit_context_set_bool_use_external_driver (ctxt, 1);

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.

OK for trunk?

        PR jit/85384
        * acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression.

        PR jit/85384
        * (gcc-driver-name.h): Honor --with-gcc-major-version
        by using gcc_base_ver to generate a gcc_driver_version, and use
        it when generating GCC_DRIVER_NAME.
        * Regenerate.
 config/acx.m4    | 2 +-
 gcc/ | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/config/acx.m4 b/config/acx.m4
index aa1d34b..87c1b5e 100644
--- a/config/acx.m4
+++ b/config/acx.m4
@@ -246,7 +246,7 @@ AC_DEFUN([GCC_BASE_VER],
   [AS_HELP_STRING([--with-gcc-major-version-only], [use only GCC major number 
in filesystem paths])],
   [if test x$with_gcc_major_version_only = xyes ; then
-    get_gcc_base_ver="sed -e 's/^\([0-9]*\).*\$\$/\1/'"
+    get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'"
diff --git a/gcc/ b/gcc/
index 67e1682..b066cc6 100644
--- a/gcc/
+++ b/gcc/
 # Generate gcc-driver-name.h containing GCC_DRIVER_NAME for the benefit
 # of jit/jit-playback.c.
+gcc_driver_version=`eval "${get_gcc_base_ver} $srcdir/BASE-VER"`
+echo "gcc_driver_version: ${gcc_driver_version}"
 cat > gcc-driver-name.h <<EOF
-#define GCC_DRIVER_NAME "${target_noncanonical}-gcc-${gcc_BASEVER}${exeext}"
 # Check whether --enable-default-pie was given.

Reply via email to