libgccjit: Add a function to check if LTO is supported #103

Open
antoyo wants to merge 1 commit from antoyo/gcc:gccjit/detect-lto into trunk
Member
gcc/jit/ChangeLog:

	* Make-lang.in: Define new variables.
	* docs/topics/compatibility.rst (LIBGCCJIT_ABI_36): New ABI tag.
	* docs/topics/compilation.rst: Document gcc_jit_is_lto_supported.
	* libgccjit.cc (gcc_jit_is_lto_supported): New function.
	* libgccjit.h (gcc_jit_is_lto_supported): New function.
	* libgccjit.map (LIBGCCJIT_ABI_36): New ABI tag.

CC: David Malcolm dmalcolm@redhat.com, jit@gcc.gnu.org

``` gcc/jit/ChangeLog: * Make-lang.in: Define new variables. * docs/topics/compatibility.rst (LIBGCCJIT_ABI_36): New ABI tag. * docs/topics/compilation.rst: Document gcc_jit_is_lto_supported. * libgccjit.cc (gcc_jit_is_lto_supported): New function. * libgccjit.h (gcc_jit_is_lto_supported): New function. * libgccjit.map (LIBGCCJIT_ABI_36): New ABI tag. ``` CC: David Malcolm <dmalcolm@redhat.com>, <jit@gcc.gnu.org>
gcc/jit/ChangeLog:

	* Make-lang.in: Define new variables.
	* docs/topics/compatibility.rst (LIBGCCJIT_ABI_36): New ABI tag.
	* docs/topics/compilation.rst: Document gcc_jit_is_lto_supported.
	* libgccjit.cc (gcc_jit_is_lto_supported): New function.
	* libgccjit.h (gcc_jit_is_lto_supported): New function.
	* libgccjit.map (LIBGCCJIT_ABI_36): New ABI tag.
Member

Welcome to Sourceware Forge

Hi @antoyo, and thanks for your PR. This bot helps you send your patch series to the mailing list.

Please follow these guidelines to ensure a smooth submission.

Writing a Good PR Description

  • If your PR has multiple commits, write a meaningful description. It becomes the cover letter.
  • For a single commit, you can leave the description empty if the commit message is clear.

To CC reviewers, add at the end of your PR description one or more lines like this:

CC: Revi Ewer <revi.ewer@example.com>, Ill Takalook <ill.takalook@example.net>

Avoid copy-pasting a CC list from a previous PR. Doing so may cause failure to send the emails properly.

We recommend reviewing your commit messages carefully before submitting.

This project expects a specific format.
See Submitting Patches for details

Submitting Your Patch

To submit, you must be authorized. Ask any permitted contributor to authorize you by commenting: /allow. This is anyone who has been /allowed before.

Once allowed, comment: /submit

Use /preview to see the emails before sending. (Requires a public forge email.)

Responding to Reviews

Watch for replies on the mailing list. If not subscribed, you can reply by:

  1. Visiting inbox.sourceware.org
  2. Clicking (raw) on the email
  3. Importing it into your mail client

For Gmail:

curl -g --user "<Email>:<Password>" \
  --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt

Updating Your PR

  1. Push new commits, rebase and force push changes to the same branch as needed
  2. Update the PR description with a “Changes since vX” section
  3. Comment again with: /submit

Need help?

Consider joining the gcc and gcc-patches mailing lists..
For real time communication, check the gcc irc channels.

Or join #overseers on Libera Chat, particularly if this automation is not working (stay online to get replies, IRC does not save messages if people are not online).

<!-- pr-welcome --> # Welcome to Sourceware Forge Hi @antoyo, and thanks for your PR. This bot helps you send your patch series to the mailing list. Please follow these guidelines to ensure a smooth submission. ## Writing a Good PR Description - If your PR has **multiple commits**, write a meaningful description. It becomes the cover letter. - For **a single commit**, you can leave the description empty if the commit message is clear. To CC reviewers, add at the end of your PR description one or more lines like this: ```text CC: Revi Ewer <revi.ewer@example.com>, Ill Takalook <ill.takalook@example.net> ``` Avoid copy-pasting a CC list from a previous PR. Doing so may cause failure to send the emails properly. We recommend reviewing your commit messages carefully before submitting. This project expects a specific format. See [Submitting Patches](https://gcc.gnu.org/contribute.html#patches) for details ## Submitting Your Patch To submit, you must be authorized. Ask any permitted contributor to authorize you by commenting: `/allow`. This is anyone who has been `/allow`ed before. Once allowed, comment: `/submit` Use `/preview` to see the emails before sending. (Requires a public forge email.) ## Responding to Reviews Watch for replies on the mailing list. If not subscribed, you can reply by: 1. Visiting [inbox.sourceware.org](https://inbox.sourceware.org) 2. Clicking `(raw)` on the email 3. Importing it into your mail client For Gmail: ```sh curl -g --user "<Email>:<Password>" \ --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt ``` ## Updating Your PR 1. Push new commits, rebase and force push changes to the same branch as needed 2. Update the PR description with a “Changes since vX” section 3. Comment again with: `/submit` ## Need help? Consider joining the [gcc and gcc-patches mailing lists.](https://gcc.gnu.org/lists.html). For real time communication, check the [gcc irc channels](https://gcc.gnu.org/wiki/GCConIRC). Or join [`#overseers`](https://web.libera.chat/#overseers) on Libera Chat, particularly if this automation is not working (stay online to get replies, IRC does not save messages if people are not online).
@ -130,6 +130,10 @@ jit.serial = $(LIBGCCJIT_FILENAME)
# Tell GNU make to ignore these if they exist.
.PHONY: jit
CFLAGS-jit/libgccjit.o += -DDEFAULT_TARGET_VERSION=\"$(version)\" \
Author
Member

This is a .in file, but I was unable to regenerate the file.
Am I doing something wrong or do the Make-lang.in files need not being regenerated?

This is a `.in` file, but I was unable to regenerate the file. Am I doing something wrong or do the `Make-lang.in` files need not being regenerated?
Member

I don't think you need to regenerate anything after changing them indeed. You can verify it by running the autoregen.py script from https://sourceware.org/cgit/builder.

I don't think you need to regenerate anything after changing them indeed. You can verify it by running the `autoregen.py` script from https://sourceware.org/cgit/builder.
Author
Member

I'm not sure how to add a test for this.

I'm not sure how to add a test for this.
Author
Member

/submit

/submit
Member

Version 1 of this pull request has been stored. It includes the following commits:

  • libgccjit: Add a function to check if LTO is supported - da9ff55248
<!-- pr-new-version --> Version 1 of this pull request has been stored. It includes the following commits: - libgccjit: Add a function to check if LTO is supported - da9ff55248bd9f945223bf254d42af2049863f06
Member

Pull Request versions:

# Base Head
1 97da8fece1 da9ff55248 (diff)

In order to compare , clone this repository and run

PR=103
git fetch origin "refs/versioned_pull/${PR}/*:refs/versioned_pull/${PR}/*"
PRV1=1
PRV2=2
git range-diff "refs/versioned_pull/${PR}/${PRV1}/base..refs/versioned_pull/${PR}/${PRV1}/head"  "refs/versioned_pull/${PR}/${PRV2}/base..refs/versioned_pull/${PR}/${PRV2}/head"
<!-- pr-versions --> Pull Request versions: | # | Base | Head | | | - | ---- | ---- | - | | 1 | 97da8fece19caf0277c2be523520d09252821973 | da9ff55248bd9f945223bf254d42af2049863f06 | [(diff)](https://forge.sourceware.org/gcc/gcc-TEST.git/compare/97da8fece19caf0277c2be523520d09252821973...da9ff55248bd9f945223bf254d42af2049863f06) | In order to compare , clone this repository and run ``` PR=103 git fetch origin "refs/versioned_pull/${PR}/*:refs/versioned_pull/${PR}/*" PRV1=1 PRV2=2 git range-diff "refs/versioned_pull/${PR}/${PRV1}/base..refs/versioned_pull/${PR}/${PRV1}/head" "refs/versioned_pull/${PR}/${PRV2}/base..refs/versioned_pull/${PR}/${PRV2}/head" ```
Member

Sent patch series version 1 containing 1 patches to gcc-patches mailing list test-list@sourceware.org and cc'd David Malcolm dmalcolm@redhat.com, jit@gcc.gnu.org.
Cover letter

Sent patch series version 1 containing 1 patches to gcc-patches mailing list <test-list@sourceware.org> and cc'd David Malcolm <dmalcolm@redhat.com>, <jit@gcc.gnu.org>. [Cover letter](https://inbox.sourceware.org/test-list/176046874671.992.18142806602657506265.batrachomyomachia.gcc.gcc-TEST.103.1.0@forge-test.rdfm.org)
@ -4709,0 +4712,4 @@
{
#ifdef ENABLE_LTO
char lto1_path[PATH_MAX];
snprintf (lto1_path, sizeof (lto1_path), "%s%s/%s/lto1",
Member

I'm a little bit surprised to see this -- why do you need to verify you can find lto1? Is there a scenario where you had GCC built with --enable-lto (=> ENABLE_LTO) but lto1 was missing (maybe broken packaging)?

I'm a little bit surprised to see this -- why do you need to verify you can find `lto1`? Is there a scenario where you had GCC built with `--enable-lto` (=> `ENABLE_LTO`) but `lto1` was missing (maybe broken packaging)?
Author
Member

I might be wrong here, but I was under the impression that we can just distribute libgccjit.so without the libexec stuff and it would just work while that would not work for gcc.
I guess we could assume that if LTO was enabled, that the lto frontend would be present, but since the LTO frontend is enabled by default, that could be error-prone.
What are your thoughts on this?

I might be wrong here, but I was under the impression that we can just distribute `libgccjit.so` without the libexec stuff and it would just work while that would not work for gcc. I guess we could assume that if LTO was enabled, that the lto frontend would be present, but since the LTO frontend is enabled by default, that could be error-prone. What are your thoughts on this?
Member

I hadn't thought about that (i.e. people thinking it's a standalone library). I think the check is reasonable if you can imagine someone trying to do that. Just mention that as motivation in the commit message?

(Especially for the say, "CI case", where people might assume they can just grab the .so and not worry about anything else, dunno.)

I hadn't thought about that (i.e. people thinking it's a standalone library). I think the check is reasonable if you can imagine someone trying to do that. Just mention that as motivation in the commit message? (Especially for the say, "CI case", where people might assume they can just grab the .so and not worry about anything else, dunno.)
First-time contributor
<!-- linaro-ci-status CI bot https://ci.linaro.org/job/tcwg_gnu_cross_build--master-arm-precommit/106/ --> CI state: success :white_check_mark: CI bot https://ci.linaro.org/job/tcwg_gnu_cross_build--master-arm-precommit/106/ : CI bot tcwg_gnu_cross_build--master-arm: Build results See: https://ci.linaro.org/job/tcwg_gnu_cross_build--master-arm-precommit/106/artifact/artifacts/artifacts.precommit/notify/mail-body.txt
First-time contributor
<!-- linaro-ci-status CI bot https://ci.linaro.org/job/tcwg_gnu_cross_build--master-aarch64-precommit/97/ --> CI state: fail :x: CI bot https://ci.linaro.org/job/tcwg_gnu_cross_build--master-aarch64-precommit/97/ : CI bot tcwg_gnu_cross_build--master-aarch64: Patch failed to apply See: https://ci.linaro.org/job/tcwg_gnu_cross_build--master-aarch64-precommit/97/artifact/artifacts/jenkins/precommit-forge-apply.log
First-time contributor
<!-- linaro-ci-status CI bot https://ci.linaro.org/job/tcwg_gnu_cross_check_gcc--master-arm-precommit/103/ --> CI state: fail :x: CI bot https://ci.linaro.org/job/tcwg_gnu_cross_check_gcc--master-arm-precommit/103/ : CI bot tcwg_gnu_cross_check_gcc--master-arm: Patch failed to apply See: https://ci.linaro.org/job/tcwg_gnu_cross_check_gcc--master-arm-precommit/103/artifact/artifacts/jenkins/precommit-forge-apply.log
This pull request has changes conflicting with the target branch.
  • gcc/jit/docs/topics/compatibility.rst
  • gcc/jit/libgccjit.h
  • gcc/jit/libgccjit.map
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u gccjit/detect-lto:antoyo-gccjit/detect-lto
git switch antoyo-gccjit/detect-lto

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch trunk
git merge --no-ff antoyo-gccjit/detect-lto
git switch antoyo-gccjit/detect-lto
git rebase trunk
git switch trunk
git merge --ff-only antoyo-gccjit/detect-lto
git switch antoyo-gccjit/detect-lto
git rebase trunk
git switch trunk
git merge --no-ff antoyo-gccjit/detect-lto
git switch trunk
git merge --squash antoyo-gccjit/detect-lto
git switch trunk
git merge --ff-only antoyo-gccjit/detect-lto
git switch trunk
git merge antoyo-gccjit/detect-lto
git push origin trunk
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gcc/gcc-TEST!103
No description provided.