Skip to content

--enable-experimental-jit fails to build: AssertionError: SHT_NOTE in 3.13.0b1 #118836

Closed
@mgorny

Description

@mgorny

Bug report

Bug description:

When trying to build CPython with --enable-experimental-jit against LLVM 18.1.5, I'm getting the following error:

$ make
python3.13 ./Tools/jit/build.py x86_64-pc-linux-gnu

==========================================================
JIT support for x86_64-pc-linux-gnu is still experimental!
         Please report any issues you encounter.          
==========================================================

  + Exception Group Traceback (most recent call last):
  |   File "/home/mgorny/git/cpython/./Tools/jit/build.py", line 28, in <module>
  |     args.target.build(pathlib.Path.cwd(), comment=comment, force=args.force)
  |     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/mgorny/git/cpython/Tools/jit/_targets.py", line 214, in build
  |     stencil_groups = asyncio.run(self._build_stencils())
  |   File "/usr/lib/python3.13/asyncio/runners.py", line 194, in run
  |     return runner.run(main)
  |            ~~~~~~~~~~^^^^^^
  |   File "/usr/lib/python3.13/asyncio/runners.py", line 118, in run
  |     return self._loop.run_until_complete(task)
  |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  |   File "/usr/lib/python3.13/asyncio/base_events.py", line 721, in run_until_complete
  |     return future.result()
  |            ~~~~~~~~~~~~~^^
  |   File "/home/mgorny/git/cpython/Tools/jit/_targets.py", line 189, in _build_stencils
  |     async with asyncio.TaskGroup() as group:
  |     ...<4 lines>...
  |             tasks.append(group.create_task(coro, name=opname))
  |   File "/usr/lib/python3.13/asyncio/taskgroups.py", line 154, in __aexit__
  |     raise me from None
  | ExceptionGroup: unhandled errors in a TaskGroup (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/home/mgorny/git/cpython/Tools/jit/_targets.py", line 181, in _compile
    |     return await self._parse(o)
    |            ^^^^^^^^^^^^^^^^^^^^
    |   File "/home/mgorny/git/cpython/Tools/jit/_targets.py", line 89, in _parse
    |     self._handle_section(wrapped_section["Section"], group)
    |     ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/home/mgorny/git/cpython/Tools/jit/_targets.py", line 349, in _handle_section
    |     assert section_type in {
    |            ^^^^^^^^^^^^^^^^^
    |     ...<5 lines>...
    |     }, section_type
    |     ^
    | AssertionError: SHT_NOTE
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "/home/mgorny/git/cpython/Tools/jit/_targets.py", line 181, in _compile
    |     return await self._parse(o)
    |            ^^^^^^^^^^^^^^^^^^^^
    |   File "/home/mgorny/git/cpython/Tools/jit/_targets.py", line 89, in _parse
    |     self._handle_section(wrapped_section["Section"], group)
    |     ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/home/mgorny/git/cpython/Tools/jit/_targets.py", line 349, in _handle_section
    |     assert section_type in {
    |            ^^^^^^^^^^^^^^^^^
    |     ...<5 lines>...
    |     }, section_type
    |     ^
    | AssertionError: SHT_NOTE
    +------------------------------------
Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x7f2fa5251760>
Traceback (most recent call last):
  File "/usr/lib/python3.13/asyncio/base_subprocess.py", line 127, in __del__
  File "/usr/lib/python3.13/asyncio/base_subprocess.py", line 104, in close
  File "/usr/lib/python3.13/asyncio/unix_events.py", line 603, in close
  File "/usr/lib/python3.13/asyncio/unix_events.py", line 627, in _close
  File "/usr/lib/python3.13/asyncio/base_events.py", line 829, in call_soon
  File "/usr/lib/python3.13/asyncio/base_events.py", line 552, in _check_closed
RuntimeError: Event loop is closed
make: *** [Makefile:3015: jit_stencils.h] Error 1

I don't recall which alpha I've tested it last on, but I'm pretty sure it used to work (against LLVM 16). I'm getting the same result on main as of 7c87ce7.

This is Gentoo Linux amd64.

I've reproduced by doing (in git repo):

export PATH=/usr/lib/llvm/18/bin:${PATH}
./configure --enable-experimental-jit
make

Resulting log (70k): python-log.txt

CPython versions tested on:

3.13, CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Labels

buildThe build process and cross-buildtopic-JITtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions