GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-137959: fix warning 'visibility' attribute ignored in jit/trampoline.c by chris-eibl · Pull Request #140286 · python/cpython

Conversation

@chris-eibl

@chris-eibl chris-eibl commented Oct 18, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Since #137961 we're getting this warning

/home/runner/work/cpython/cpython/Tools/jit/trampoline.c:13:13: warning: 'visibility' attribute ignored [-Wignored-attributes]
   13 |     typedef DECLARE_TARGET((*jit_func));
      |             ^
/home/runner/work/cpython/cpython/Tools/jit/jit.h:11:49: note: expanded from macro 'DECLARE_TARGET'
   11 |     _Py_CODEUNIT *__attribute__((preserve_none, visibility("hidden"))) \
      |                                                 ^
1 warning generated.

for all platforms, e.g.
https://github.com/python/cpython/actions/runs/18575809544/job/52961278295?pr=140233
except i686-pc-windows-msvc, where this warning has to be suppressed

cpython/Tools/jit/_targets.py

Lines 583 to 587 in f937468

elif re.fullmatch(r"i686-pc-windows-msvc", host):
host = "i686-pc-windows-msvc"
condition = "defined(_M_IX86)"
# -Wno-ignored-attributes: __attribute__((preserve_none)) is not supported here.
args = ["-DPy_NO_ENABLE_SHARED", "-Wno-ignored-attributes"]

to silence the many warnings we'd get otherwise, because preserve_none is not supported there.

I suggest to use

cpython/Tools/jit/jit.h

Lines 1 to 4 in f937468

// To use preserve_none in JIT builds, we need to declare a separate function
// pointer with __attribute__((preserve_none)), since this attribute may not be
// supported by the compiler used to build the rest of the interpreter.
typedef jit_func __attribute__((preserve_none)) jit_func_preserve_none;

I've verified with a small Godbolt demo and by comparing the emit_trampoline in the generated jit_stencils.h that the generated code remains the same.

  • Issue: Call JIT code from the interpreter via a trampoline function, instead of inserting shim code in the jitted code #137959

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@chris-eibl
fix warning 'visibility' attribute ignored
4a57d8a
@chris-eibl
chris-eibl requested review from brandtbucher, diegorusso and savannahostrowski as code owners October 18, 2025 09:44
@bedevere-app bedevere-app Bot mentioned this pull request Oct 18, 2025
Call JIT code from the interpreter via a trampoline function, instead of inserting shim code in the jitted code #137959
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Oct 18, 2025
@chris-eibl chris-eibl added skip news topic-JIT labels Oct 18, 2025
@Fidget-Spinner

Fidget-Spinner commented Oct 18, 2025

Copy link
Copy Markdown
Member

I think Savannah already opened a PR for this here #139981. Perhaps you could review it?

chris-eibl reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chris-eibl chris-eibl mentioned this pull request Oct 18, 2025
JIT: Fix compiler warning from visibility attribute in typedef #139981
Merged
@chris-eibl

chris-eibl commented Oct 18, 2025

Copy link
Copy Markdown
Member Author

Thanks Ken. Well spotted, I haven't seen Savannah's PR so closing mine.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chris-eibl chris-eibl closed this Oct 18, 2025
@chris-eibl
chris-eibl deleted the fix_hidden branch November 15, 2025 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@brandtbucher brandtbucher Awaiting requested review from brandtbucher brandtbucher is a code owner
@savannahostrowski savannahostrowski Awaiting requested review from savannahostrowski
@diegorusso diegorusso Awaiting requested review from diegorusso diegorusso is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review skip news topic-JIT

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@chris-eibl @Fidget-Spinner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.