Skip to content

gh-153740: use native _Float16 in PyFloat_Pack/Unpack2 - #154796

Open
skirpichev wants to merge 8 commits into
python:mainfrom
skirpichev:use-_Float16/153740
Open

gh-153740: use native _Float16 in PyFloat_Pack/Unpack2#154796
skirpichev wants to merge 8 commits into
python:mainfrom
skirpichev:use-_Float16/153740

Conversation

@skirpichev

@skirpichev skirpichev commented Jul 28, 2026

Copy link
Copy Markdown
Member

@skirpichev

Copy link
Copy Markdown
Member Author

Not sure how to fix this error:

/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
Objects/floatobject.o: in function `PyFloat_Pack2':
floatobject.c:(.text.PyFloat_Pack2[PyFloat_Pack2]+0x32): undefined reference to `__truncdfhf2'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

CC @StanFromIreland (fuzzers)

@StanFromIreland

Copy link
Copy Markdown
Member

The configure probe only tests a compile-time _Float16 constant, so it reports "yes" in the OSS-Fuzz Docker container where clang accepts the type but the container's pre-GCC-12 libgcc lacks __truncdfhf2 which is the runtime helper the PyFloat_Pack2 double to _Float16 conversion links against. I suggest you make configure do a runtime double to _Float16 conversion.

@skirpichev
skirpichev force-pushed the use-_Float16/153740 branch from 46fe384 to 8bda53a Compare July 30, 2026 00:18
@skirpichev

Copy link
Copy Markdown
Member Author

I suggest you make configure do a runtime double to _Float16 conversion.

Good idea, that works.

@skirpichev
skirpichev marked this pull request as ready for review July 30, 2026 01:03
Comment thread configure.ac Outdated
@skirpichev skirpichev added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 30, 2026
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @skirpichev for commit ac38cb8 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F154796%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 30, 2026
@skirpichev skirpichev removed their assignment Jul 30, 2026
Comment thread configure.ac Outdated
@skirpichev

Copy link
Copy Markdown
Member Author

!buildbot risc

@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @skirpichev for commit 7267d2d 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F154796%2Fmerge

The command will test the builders whose names match following regular expression: risc

The builders matched are:

  • RISC-V 64-bit Ubuntu Clang PR
  • RISC-V 64-bit Ubuntu NoGIL PR
  • RISC-V 64-bit Ubuntu PR
  • riscv64 Ubuntu PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants