Commit 99d36115 authored by Matthias Klose's avatar Matthias Klose

* Fix PR jit/87808: Don't rely on the gcc driver. Let libgccjit0

    depend on binutils and libgcc-dev. Addresses: #911668.
parent 23851f42
......@@ -3,6 +3,8 @@ gcc-7 (7.4.0-8) UNRELEASED; urgency=medium
* Fix PR tree-optimization/89505, taken from the gcc-8 branch.
* Fix package descriptions for cross packages.
* Fix cross building gdc (Helmut Grohne). Addresses: #925040.
* Fix PR jit/87808: Don't rely on the gcc driver. Let libgccjit0
depend on binutils and libgcc-dev. Addresses: #911668.
-- Matthias Klose <doko@debian.org> Wed, 13 Mar 2019 21:38:19 +0100
......
......@@ -3363,7 +3363,7 @@ ifdef(`MULTIARCH', `Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
')`'dnl
Priority: optional
Depends: BASEDEP, ${shlibs:Depends}, ${misc:Depends}
Depends: BASEDEP, libgcc`'PV-dev, binutils, ${shlibs:Depends}, ${misc:Depends}
Breaks: python-gccjit (<< 0.4-4), python3-gccjit (<< 0.4-4)
BUILT_USING`'dnl
Description: GCC just-in-time compilation (shared library)
......
# DP: Fix PR jit/87808.
* Make-lang.in (CFLAGS-jit/jit-playback.o): Pass fallback
GCC_EXEC_PREFIX.
* jit-playback.c (invoke_embedded_driver): Use fallback GCC_EXEC_PREFIX
when external driver is not present.
--- a/src/gcc/jit/Make-lang.in
+++ b/src/gcc/jit/Make-lang.in
@@ -84,6 +84,9 @@
jit/jit-spec.o \
gcc.o
+CFLAGS-jit/jit-playback.o += \
+ -DFALLBACK_GCC_EXEC_PREFIX=\"$(libdir)/gcc/$(target_subdir)/$(version)\"
+
# Use strict warnings for this front end.
jit-warn = $(STRICT_WARN)
--- a/src/gcc/jit/jit-playback.c
+++ b/src/gcc/jit/jit-playback.c
@@ -39,6 +39,7 @@
#include "opt-suggestions.h"
#include "gcc.h"
#include "diagnostic.h"
+#include "file-find.h"
#include <pthread.h>
@@ -2482,7 +2483,31 @@
playback::context::
invoke_embedded_driver (const vec <char *> *argvec)
{
+ static char* gcc_driver_file = NULL;
+
JIT_LOG_SCOPE (get_logger ());
+
+ /* process_command() uses make_relative_prefix(), searches PATH
+ for the external driver, which might not be found. In this case
+ fall back to the configured default. */
+#ifdef FALLBACK_GCC_EXEC_PREFIX
+ if (gcc_driver_file == NULL && ::getenv ("GCC_EXEC_PREFIX") == NULL)
+ {
+ struct path_prefix path;
+
+ prefix_from_env ("PATH", &path);
+ gcc_driver_file = find_a_file (&path, gcc_driver_name, X_OK);
+ if (gcc_driver_file == NULL)
+ {
+ char *str = concat ("GCC_EXEC_PREFIX=",
+ FALLBACK_GCC_EXEC_PREFIX, NULL);
+ ::putenv (str);
+ log ("gcc driver %s not found, using fallback GCC_EXEC_PREFIX=%s",
+ gcc_driver_name, FALLBACK_GCC_EXEC_PREFIX);
+ }
+ }
+#endif
+
driver d (true, /* can_finalize */
false); /* debug */
int result = d.main (argvec->length (),
......@@ -94,6 +94,7 @@ debian_patches += \
kfreebsd-decimal-float \
pr89585 \
pr89505 \
pr87808 \
# FIXME: see #915194
# gcc-search-prefixed-as-ld \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment