Bug 85384 - libgccjit does not work if --with-gcc-major-version is used
Summary: libgccjit does not work if --with-gcc-major-version is used
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: jit (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: 7.4
Assignee: David Malcolm
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-12 18:34 UTC by David Malcolm
Modified: 2018-06-25 09:33 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-04-12 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Malcolm 2018-04-12 18:34:51 UTC
As noted in this downstream bug:
  https://bugzilla.redhat.com/show_bug.cgi?id=1566178
libgccjit does not honor --with-gcc-major-version.

Specifically, gcc/configure.ac does not use get_gcc_base_ver when generating gcc-driver-name.h, hence GCC_DRIVER_NAME contains the wrong value when --with-gcc-major-version is used.

This leads to link errors as reported in that bug, when using the default embedded driver, and to the driver not being found when using:

  gcc_jit_context_set_bool_use_external_driver (ctxt, 1);

Affects trunk and gcc-7-branch.

I'm about to submit a candidate fix.
Comment 1 Jakub Jelinek 2018-04-12 18:45:28 UTC
gcc_get_base_ver is meant for uses in Makefiles (which is why it uses $$), so it can't be easily used in a shell script.
Comment 2 David Malcolm 2018-04-12 20:44:12 UTC
Candidate patch:
  https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00638.html
Comment 3 Jakub Jelinek 2018-04-18 09:47:31 UTC
Author: jakub
Date: Wed Apr 18 09:46:58 2018
New Revision: 259462

URL: https://gcc.gnu.org/viewcvs?rev=259462&root=gcc&view=rev
Log:
	PR jit/85384
	* acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression.

	* 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: Regenerate.

	* configure: Regenerate.

Modified:
    trunk/config/ChangeLog
    trunk/config/acx.m4
    trunk/fixincludes/ChangeLog
    trunk/fixincludes/configure
    trunk/gcc/ChangeLog
    trunk/gcc/configure
    trunk/gcc/configure.ac
    trunk/libada/ChangeLog
    trunk/libada/configure
    trunk/libatomic/ChangeLog
    trunk/libatomic/configure
    trunk/libcc1/ChangeLog
    trunk/libcc1/configure
    trunk/libffi/ChangeLog
    trunk/libffi/configure
    trunk/libgcc/ChangeLog
    trunk/libgcc/configure
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/configure
    trunk/libgomp/ChangeLog
    trunk/libgomp/configure
    trunk/libhsail-rt/ChangeLog
    trunk/libhsail-rt/configure
    trunk/libitm/ChangeLog
    trunk/libitm/configure
    trunk/libmpx/ChangeLog
    trunk/libmpx/configure
    trunk/libobjc/ChangeLog
    trunk/libobjc/configure
    trunk/liboffloadmic/ChangeLog
    trunk/liboffloadmic/configure
    trunk/liboffloadmic/plugin/configure
    trunk/libquadmath/ChangeLog
    trunk/libquadmath/configure
    trunk/libsanitizer/ChangeLog
    trunk/libsanitizer/configure
    trunk/libssp/ChangeLog
    trunk/libssp/configure
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/configure
    trunk/libvtv/ChangeLog
    trunk/libvtv/configure
    trunk/lto-plugin/ChangeLog
    trunk/lto-plugin/configure
Comment 4 Jakub Jelinek 2018-04-18 09:50:27 UTC
Richard prefered David's patch and we have some sed invocations that expect s/something.*// to match everything until end of line in gcc/Makefile.in, so if some sed versions don't do it, it would break other things.

So, fixed for GCC8+ so far, should be backported to 7 at some point.
Comment 5 Jakub Jelinek 2018-06-22 21:17:26 UTC
Author: jakub
Date: Fri Jun 22 21:16:41 2018
New Revision: 261957

URL: https://gcc.gnu.org/viewcvs?rev=261957&root=gcc&view=rev
Log:
2018-06-22  Jakub Jelinek  <jakub@redhat.com>

	Backported from mainline
	2018-04-18  David Malcolm  <dmalcolm@redhat.com>

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

	* 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: Regenerate.

	* configure: Regenerate.

Modified:
    branches/gcc-7-branch/ChangeLog
    branches/gcc-7-branch/config/ChangeLog
    branches/gcc-7-branch/config/acx.m4
    branches/gcc-7-branch/configure
    branches/gcc-7-branch/fixincludes/ChangeLog
    branches/gcc-7-branch/fixincludes/configure
    branches/gcc-7-branch/gcc/ChangeLog
    branches/gcc-7-branch/gcc/configure
    branches/gcc-7-branch/gcc/configure.ac
    branches/gcc-7-branch/libada/ChangeLog
    branches/gcc-7-branch/libada/configure
    branches/gcc-7-branch/libatomic/ChangeLog
    branches/gcc-7-branch/libatomic/configure
    branches/gcc-7-branch/libcc1/ChangeLog
    branches/gcc-7-branch/libcc1/configure
    branches/gcc-7-branch/libcilkrts/ChangeLog
    branches/gcc-7-branch/libcilkrts/configure
    branches/gcc-7-branch/libffi/ChangeLog
    branches/gcc-7-branch/libffi/configure
    branches/gcc-7-branch/libgcc/ChangeLog
    branches/gcc-7-branch/libgcc/configure
    branches/gcc-7-branch/libgfortran/ChangeLog
    branches/gcc-7-branch/libgfortran/configure
    branches/gcc-7-branch/libgomp/ChangeLog
    branches/gcc-7-branch/libgomp/configure
    branches/gcc-7-branch/libhsail-rt/ChangeLog
    branches/gcc-7-branch/libhsail-rt/configure
    branches/gcc-7-branch/libitm/ChangeLog
    branches/gcc-7-branch/libitm/configure
    branches/gcc-7-branch/libmpx/ChangeLog
    branches/gcc-7-branch/libmpx/configure
    branches/gcc-7-branch/libobjc/ChangeLog
    branches/gcc-7-branch/libobjc/configure
    branches/gcc-7-branch/liboffloadmic/ChangeLog
    branches/gcc-7-branch/liboffloadmic/configure
    branches/gcc-7-branch/liboffloadmic/plugin/configure
    branches/gcc-7-branch/libquadmath/ChangeLog
    branches/gcc-7-branch/libquadmath/configure
    branches/gcc-7-branch/libsanitizer/ChangeLog
    branches/gcc-7-branch/libsanitizer/configure
    branches/gcc-7-branch/libssp/ChangeLog
    branches/gcc-7-branch/libssp/configure
    branches/gcc-7-branch/libstdc++-v3/ChangeLog
    branches/gcc-7-branch/libstdc++-v3/configure
    branches/gcc-7-branch/libvtv/ChangeLog
    branches/gcc-7-branch/libvtv/configure
Comment 6 Jakub Jelinek 2018-06-25 09:33:52 UTC
Fixed for 7.4+.