public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: Lorenzo Salvadore <developer@lorenzosalvadore.it>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	"jit@gcc.gnu.org" <jit@gcc.gnu.org>
Cc: "rguenth@gcc.gnu.org" <rguenth@gcc.gnu.org>,
	"dmalcolm@gcc.gnu.org" <dmalcolm@gcc.gnu.org>
Subject: [PATCH] jit: Install jit headers in $(libsubincludedir) [PR 101491]
Date: Wed, 16 Nov 2022 16:03:17 +0000	[thread overview]
Message-ID: <ORTB8ja1orPQI2PlPNzQUO4jsLD8w4L7DFPV-Gc_lt29nt6oJn7d4sVnjtdlnn4ehnd0FBYvRUR0lH1QTVFVku2n94g-7xC5xi2Nq2jUSG0=@lorenzosalvadore.it> (raw)

Hello,

I would like to submit the patch below addressing bug jit/101491.
Please note that another patch has also been submitted in the bug
report by another FreeBSD user. We worked indipendently. The two
patches look functionally equivalent but use different styles. In
particular, I followed Richard Biener's suggestion from
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101491#c5 .

Thanks,

Lorenzo Salvadore

---

From f8e2c2ee89a7d8741bb65163d1f1c20edcd546ac Mon Sep 17 00:00:00 2001
From: Lorenzo Salvadore <developer@lorenzosalvadore.it>
Date: Wed, 16 Nov 2022 11:27:38 +0100
Subject: [PATCH] jit: Install jit headers in $(libsubincludedir) [PR 101491]

Installing jit/libgccjit.h and jit/libgccjit++.h headers in
$(includedir) can be a problem for machines where multiple versions of
GCC are required simultaneously, see for example this bug report on
FreeBSD:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257060

Hence,

- define $(libsubincludedir) the same way it is defined in libgomp;
- install jit/libgccjit.h and jit/libgccjit++.h in $(libsubincludedir).

The patch has already been applied successfully in the official FreeBSD
ports tree for the ports lang/gcc11 and lang/gcc12. Please see the
following commits:

https://cgit.freebsd.org/ports/commit/?id=0338e04504ee269b7a95e6707f1314bc1c4239fe
https://cgit.freebsd.org/ports/commit/?id=f1957296ed2dce8a09bb9582e9a5a715bf8b3d4d

gcc/ChangeLog:

2022-11-16  Lorenzo Salvadore  <developer@lorenzosalvadore.it>

	PR jit/101491
        * Makefile.in: Define and create $(libsubincludedir)

gcc/jit/ChangeLog:

2022-11-16  Lorenzo Salvadore  <developer@lorenzosalvadore.it>

	PR jit/101491
        * Make-lang.in: Install headers in $(libsubincludedir)
---
 gcc/Makefile.in      | 3 +++
 gcc/jit/Make-lang.in | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f672e6ea549..3bcf1c491ab 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -635,6 +635,8 @@ libexecdir = @libexecdir@

 # Directory in which the compiler finds libraries etc.
 libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
+# Directory in which the compiler finds headers.
+libsubincludedir = $(libdir)/gcc/$(target_alias)/$(version)/include
 # Directory in which the compiler finds executables
 libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
 # Directory in which all plugin resources are installed
@@ -3642,6 +3644,7 @@ install-cpp: installdirs cpp$(exeext)
 # $(libdir)/gcc/include isn't currently searched by cpp.
 installdirs:
 	$(mkinstalldirs) $(DESTDIR)$(libsubdir)
+	$(mkinstalldirs) $(DESTDIR)$(libsubincludedir)
 	$(mkinstalldirs) $(DESTDIR)$(libexecsubdir)
 	$(mkinstalldirs) $(DESTDIR)$(bindir)
 	$(mkinstalldirs) $(DESTDIR)$(includedir)
diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index 248ec45b729..ba1b3e95da5 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -360,9 +360,9 @@ selftest-jit:
 # Install hooks:
 jit.install-headers: installdirs
 	$(INSTALL_DATA) $(srcdir)/jit/libgccjit.h \
-	  $(DESTDIR)$(includedir)/libgccjit.h
+	  $(DESTDIR)$(libsubincludedir)/libgccjit.h
 	$(INSTALL_DATA) $(srcdir)/jit/libgccjit++.h \
-	  $(DESTDIR)$(includedir)/libgccjit++.h
+	  $(DESTDIR)$(libsubincludedir)/libgccjit++.h

 ifneq (,$(findstring mingw,$(target)))
 jit.install-common: installdirs jit.install-headers
--
2.38.0



                 reply	other threads:[~2022-11-16 16:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ORTB8ja1orPQI2PlPNzQUO4jsLD8w4L7DFPV-Gc_lt29nt6oJn7d4sVnjtdlnn4ehnd0FBYvRUR0lH1QTVFVku2n94g-7xC5xi2Nq2jUSG0=@lorenzosalvadore.it' \
    --to=developer@lorenzosalvadore.it \
    --cc=dmalcolm@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jit@gcc.gnu.org \
    --cc=rguenth@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).