public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PATCH] configure.ac: honor --with-gcc-major-version in gcc-driver-name.h (PR jit/85384)
  2018-01-01  0:00 [PATCH] configure.ac: honor --with-gcc-major-version in gcc-driver-name.h (PR jit/85384) David Malcolm
@ 2018-01-01  0:00 ` Jakub Jelinek
  2018-01-01  0:00 ` [PATCH] configure.ac: honor --with-gcc-major-version in gcc-driver-name.h (PR jit/85384, variant) Jakub Jelinek
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2018-01-01  0:00 UTC (permalink / raw)
  To: David Malcolm; +Cc: gcc-patches, jit

On Thu, Apr 12, 2018 at 04:51:21PM -0400, David Malcolm wrote:
> Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
> 
> OK for trunk?
> 
> config/ChangeLog:
> 	PR jit/85384
> 	* acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression.
> 
> gcc/ChangeLog:
> 	PR jit/85384
> 	* configure.ac (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.
> 	* configure.ac: Regenerate.

I'd prefer not touching acx.m4 and instead just:
gcc_driver_version=$gcc_BASEVER
if test x$with_gcc_major_version_only = xyes ; then
  gcc_driver_version=`echo $gcc_BASEVER | sed -e 's/^\([0-9]*\).*$/\1/'`
fi
in configure.ac; after all, it is something what is done elsewhere in
configure.ac:
#define GCCPLUGIN_VERSION_MAJOR   `echo $gcc_BASEVER | sed -e 's/^\([0-9]*\).*$/\1/'`
#define GCCPLUGIN_VERSION_MINOR   `echo $gcc_BASEVER | sed -e 's/^[0-9]*\.\([0-9]*\).*$/\1/'`
#define GCCPLUGIN_VERSION_PATCHLEVEL   `echo $gcc_BASEVER | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$/\1/'`
and the $ is used in all similar sed patterns.

> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -6499,8 +6499,10 @@ AC_DEFINE_UNQUOTED(DIAGNOSTICS_COLOR_DEFAULT, $DIAGNOSTICS_COLOR_DEFAULT,
>  
>  # 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}"
> +#define GCC_DRIVER_NAME "${target_noncanonical}-gcc-${gcc_driver_version}${exeext}"
>  EOF
>  
>  # Check whether --enable-default-pie was given.

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] configure.ac: honor --with-gcc-major-version in gcc-driver-name.h (PR jit/85384)
@ 2018-01-01  0:00 David Malcolm
  2018-01-01  0:00 ` Jakub Jelinek
  2018-01-01  0:00 ` [PATCH] configure.ac: honor --with-gcc-major-version in gcc-driver-name.h (PR jit/85384, variant) Jakub Jelinek
  0 siblings, 2 replies; 3+ messages in thread
From: David Malcolm @ 2018-01-01  0:00 UTC (permalink / raw)
  To: jakub; +Cc: gcc-patches, jit, David Malcolm

This patch updates gcc/configure.ac 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
  https://bugzilla.redhat.com/show_bug.cgi?id=1566178
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?

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

gcc/ChangeLog:
	PR jit/85384
	* configure.ac (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.
	* configure.ac: Regenerate.
---
 config/acx.m4    | 2 +-
 gcc/configure.ac | 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
     changequote(,)dnl
-    get_gcc_base_ver="sed -e 's/^\([0-9]*\).*\$\$/\1/'"
+    get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'"
     changequote([,])dnl
   fi
   ])
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 67e1682..b066cc6 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6499,8 +6499,10 @@ AC_DEFINE_UNQUOTED(DIAGNOSTICS_COLOR_DEFAULT, $DIAGNOSTICS_COLOR_DEFAULT,
 
 # 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}"
+#define GCC_DRIVER_NAME "${target_noncanonical}-gcc-${gcc_driver_version}${exeext}"
 EOF
 
 # Check whether --enable-default-pie was given.
-- 
1.8.5.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] configure.ac: honor --with-gcc-major-version in gcc-driver-name.h (PR jit/85384, variant)
  2018-01-01  0:00 [PATCH] configure.ac: honor --with-gcc-major-version in gcc-driver-name.h (PR jit/85384) David Malcolm
  2018-01-01  0:00 ` Jakub Jelinek
@ 2018-01-01  0:00 ` Jakub Jelinek
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2018-01-01  0:00 UTC (permalink / raw)
  To: David Malcolm, Jeff Law, DJ Delorie, Alexandre Oliva; +Cc: gcc-patches, jit

On Thu, Apr 12, 2018 at 04:51:21PM -0400, David Malcolm wrote:
> This patch updates gcc/configure.ac 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
>   https://bugzilla.redhat.com/show_bug.cgi?id=1566178
> 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?
> 
> config/ChangeLog:
> 	PR jit/85384
> 	* acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression.
> 
> gcc/ChangeLog:
> 	PR jit/85384
> 	* configure.ac (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.
> 	* configure.ac: Regenerate.

Here is the variant I've talked about in patch form.  Bootstrapped/regtested
on x86_64-linux and i686-linux and tested with
--enable-languages=jit --enable-host-shared --disable-bootstrap
and
--enable-languages=jit --enable-host-shared --disable-bootstrap --with-gcc-major-version-only
Ok for trunk?

2018-04-13  Jakub Jelinek  <jakub@redhat.com>

	PR jit/85384
	* configure.ac (GCC_DRIVER_NAME): For --with-gcc-major-version-only
	use just major version in the driver filename rather than full
	version.
	* configure: Regenerated.

--- gcc/configure.ac.jj	2018-04-12 10:22:56.179162225 +0200
+++ gcc/configure.ac	2018-04-13 16:16:02.712459619 +0200
@@ -6499,8 +6499,14 @@ AC_DEFINE_UNQUOTED(DIAGNOSTICS_COLOR_DEF
 
 # Generate gcc-driver-name.h containing GCC_DRIVER_NAME for the benefit
 # of jit/jit-playback.c.
+changequote(,)dnl
+gcc_driver_version=$gcc_BASEVER
+if test x$with_gcc_major_version_only = xyes ; then
+  gcc_driver_version=`echo $gcc_BASEVER | sed -e 's/^\([0-9]*\).*$/\1/'`
+fi
+changequote([,])dnl
 cat > gcc-driver-name.h <<EOF
-#define GCC_DRIVER_NAME "${target_noncanonical}-gcc-${gcc_BASEVER}${exeext}"
+#define GCC_DRIVER_NAME "${target_noncanonical}-gcc-${gcc_driver_version}${exeext}"
 EOF
 
 # Check whether --enable-default-pie was given.
--- gcc/configure.jj	2018-04-12 10:22:56.256162248 +0200
+++ gcc/configure	2018-04-13 16:16:17.551468697 +0200
@@ -30084,8 +30084,12 @@ _ACEOF
 
 # Generate gcc-driver-name.h containing GCC_DRIVER_NAME for the benefit
 # of jit/jit-playback.c.
+gcc_driver_version=$gcc_BASEVER
+if test x$with_gcc_major_version_only = xyes ; then
+  gcc_driver_version=`echo $gcc_BASEVER | sed -e 's/^\([0-9]*\).*$/\1/'`
+fi
 cat > gcc-driver-name.h <<EOF
-#define GCC_DRIVER_NAME "${target_noncanonical}-gcc-${gcc_BASEVER}${exeext}"
+#define GCC_DRIVER_NAME "${target_noncanonical}-gcc-${gcc_driver_version}${exeext}"
 EOF
 
 # Check whether --enable-default-pie was given.


	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-13 17:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-01  0:00 [PATCH] configure.ac: honor --with-gcc-major-version in gcc-driver-name.h (PR jit/85384) David Malcolm
2018-01-01  0:00 ` Jakub Jelinek
2018-01-01  0:00 ` [PATCH] configure.ac: honor --with-gcc-major-version in gcc-driver-name.h (PR jit/85384, variant) Jakub Jelinek

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).