Skip to content

deps: update libffi to 3.6.0 - #64040

Merged
aduh95 merged 2 commits into
mainfrom
actions/truetools-update-libffi
Jun 22, 2026
Merged

deps: update libffi to 3.6.0#64040
aduh95 merged 2 commits into
mainfrom
actions/truetools-update-libffi

Conversation

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

This is an automated update of libffi to 3.6.0.

@nodejs-github-botnodejs-github-bot added dependencies Pull requests that update a dependency file. ffi Issues and PRs related to experimental Foreign Function Interface support. labels Jun 21, 2026
@nodejs-github-bot

Copy link
Copy Markdown
CollaboratorAuthor

Review requested:

  • @nodejs/ffi
  • @nodejs/security-wg

@nodejs-github-botnodejs-github-bot added the needs-ci PRs that need a full CI run. label Jun 21, 2026
@aduh95aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jun 21, 2026
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 21, 2026
@nodejs-github-bot

Copy link
Copy Markdown
CollaboratorAuthor

@aduh95aduh95 added the fast-track PRs that do not need to wait for 48 hours to land. label Jun 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Fast-track has been requested by @aduh95. Please 👍 to approve.

@aduh95

Copy link
Copy Markdown
Contributor

Let's fast-track to include it in the next 26.x release, which I'd like to be able to prepare today

@aduh95

Copy link
Copy Markdown
Contributor

Related compilation failure on AIX and Windows

../deps/libffi/src/powerpc/ffi_darwin.c:1456:14: error: use of undeclared identifier 'PPC_LD_NONE'
1456 | return PPC_LD_NONE;
| ^
../deps/libffi/src/powerpc/ffi_darwin.c:1458:14: error: use of undeclared identifier 'PPC_LD_F32'
1458 | return PPC_LD_F32;
| ^
../deps/libffi/src/powerpc/ffi_darwin.c:1460:14: error: use of undeclared identifier 'PPC_LD_F64'
1460 | return PPC_LD_F64;
| ^
../deps/libffi/src/powerpc/ffi_darwin.c:1463:14: error: use of undeclared identifier 'PPC_LD_F128'
1463 | return PPC_LD_F128;
| ^
../deps/libffi/src/powerpc/ffi_darwin.c:1466:14: error: use of undeclared identifier 'PPC_LD_U8'
1466 | return PPC_LD_U8;
| ^
../deps/libffi/src/powerpc/ffi_darwin.c:1468:14: error: use of undeclared identifier 'PPC_LD_S8'
1468 | return PPC_LD_S8;
| ^
../deps/libffi/src/powerpc/ffi_darwin.c:1470:14: error: use of undeclared identifier 'PPC_LD_U16'
1470 | return PPC_LD_U16;
| ^
../deps/libffi/src/powerpc/ffi_darwin.c:1472:14: error: use of undeclared identifier 'PPC_LD_S16'
1472 | return PPC_LD_S16;
| ^
../deps/libffi/src/powerpc/ffi_darwin.c:1474:14: error: use of undeclared identifier 'PPC_LD_U32'
1474 | return PPC_LD_U32;
| ^
../deps/libffi/src/powerpc/ffi_darwin.c:1477:14: error: use of undeclared identifier 'PPC_LD_S32'
1477 | return PPC_LD_S32;
| ^
../deps/libffi/src/powerpc/ffi_darwin.c:1479:14: error: use of undeclared identifier 'PPC_LD_PTR'
1479 | return PPC_LD_PTR;
| ^
../deps/libffi/src/powerpc/ffi_darwin.c:1482:14: error: use of undeclared identifier 'PPC_LD_I64'
1482 | return PPC_LD_I64;
| ^
2 warnings and 12 errors generated.

Comment threaddeps/libffi/libffi.gyp
@nodejs-github-bot

Copy link
Copy Markdown
CollaboratorAuthor

@Renegade334Renegade334 added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Jun 21, 2026
@aduh95

Copy link
Copy Markdown
Contributor

@nodejs/platform-aix any idea on how to fix the compilation?

@richardlau

Copy link
Copy Markdown
Member

@nodejs/platform-aix any idea on how to fix the compilation?

Why are we compiling ../deps/libffi/src/powerpc/ffi_darwin.c on AIX in the first place?

['target_arch == "ppc64" and OS == "aix"', {
'variables': {
'libffi_arch_sources': [
'src/powerpc/ffi_darwin.c',
'src/powerpc/aix.S',
'src/powerpc/aix_closure.S',
],
},
}],

@Renegade334

Renegade334 commented Jun 21, 2026

Copy link
Copy Markdown
Member

Why are we compiling ../deps/libffi/src/powerpc/ffi_darwin.c on AIX in the first place?

This appears to be how libffi plays it.

As for the missing defines, these were added to ffi_powerpc.h in this update, but there's clearly something janky going on with the includes. ffi_darwin.c is missing this header, whereas ffi.c/ffi_linux64.c/ffi_sysv.c include it.

https://github.com/nodejs/node/blob/d393b3267c82384e37dcf88836b6d48fc97132be/deps/libffi/src/powerpc/ffi_powerpc.h#L35-L94

@aduh95

Copy link
Copy Markdown
Contributor

@Renegade334

Copy link
Copy Markdown
Member

ffi.c uses the linux64/sysv asm symbols, not the aix symbols, hence (presumably) the linker error. ffi_darwin.c is explicitly the correct source here:

FFI support for Darwin and AIX.

@Renegade334

Renegade334 commented Jun 21, 2026

Copy link
Copy Markdown
Member

Let's give this a go.

https://ci.nodejs.org/job/node-test-commit-aix/63337/

Edit: guess not then 😆

@Renegade334

Renegade334 commented Jun 21, 2026

Copy link
Copy Markdown
Member

I get the sense that this is just busted at source.

The function in ffi_darwin.c that returns these constants still expects to return a ffi_type*, which is consistent with the cif->rtype that was previously returned prior to libffi/libffi@840add3. The respective functions in linux64/sysv have been updated to return an int, which matches the new constants.

I note that libffi only tests powerpc64 builds targeting linux, not darwin or aix.

@Renegade334

Renegade334 commented Jun 21, 2026

Copy link
Copy Markdown
Member

Opened libffi/libffi#987. We have a suggested patch to try, going to give it a go!

https://ci.nodejs.org/job/node-test-commit-aix/63338/

@Renegade334
Renegade334force-pushed the actions/truetools-update-libffi branch from 4537b46 to 432321bCompareJune 21, 2026 21:13
@aduh95

Copy link
Copy Markdown
Contributor

432321bbc0249d754be701208747e4dfab83e32b Would need to be a deps: libffi: cherry-pick …, not a fixup commit

@Renegade334

Renegade334 commented Jun 21, 2026

Copy link
Copy Markdown
Member

👍

Once we confirm the build is green, then it can be landed upstream and we can formally cherry-pick.

@Renegade334
Renegade334force-pushed the actions/truetools-update-libffi branch from 432321b to b07e414CompareJune 21, 2026 22:56
@Renegade334Renegade334 added commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. and removed commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Jun 21, 2026
@nodejs-github-bot

Copy link
Copy Markdown
CollaboratorAuthor

@Renegade334
Renegade334 requested a review from aduh95June 22, 2026 00:12
nodejs-github-botand others added 2 commits June 22, 2026 08:55
PR-URL: #64040
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Original commit message:
powerpc: fix aix/darwin closure build errors
unbuildable: the PPC_LD_* jump-table indexes (defined in ffi_powerpc.h,
which this file cannot include) were missing, and the closure helper
functions still declared an ffi_type* return type inconsistent with the
PPC_LD_* constants they now return.
Define the PPC_LD_* constants locally and change the closure helper
return types to int.
Fixes#987
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Refs: libffi/libffi@9ca53a1
PR-URL: #64040
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
@aduh95
aduh95force-pushed the actions/truetools-update-libffi branch from b07e414 to e9a9065CompareJune 22, 2026 06:56
@aduh95
aduh95 merged commit e9a9065 into mainJun 22, 2026
17 of 18 checks passed
@aduh95
aduh95 deleted the actions/truetools-update-libffi branch June 22, 2026 06:56
@aduh95

aduh95 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Landed in 1f806f2...e9a9065

aduh95 pushed a commit that referenced this pull request Jun 22, 2026
PR-URL: #64040
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
aduh95 pushed a commit that referenced this pull request Jun 22, 2026
Original commit message:
powerpc: fix aix/darwin closure build errors
unbuildable: the PPC_LD_* jump-table indexes (defined in ffi_powerpc.h,
which this file cannot include) were missing, and the closure helper
functions still declared an ffi_type* return type inconsistent with the
PPC_LD_* constants they now return.
Define the PPC_LD_* constants locally and change the closure helper
return types to int.
Fixes#987
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Refs: libffi/libffi@9ca53a1
PR-URL: #64040
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
@sxa

sxa commented Jun 30, 2026

Copy link
Copy Markdown
Member

3.6.0 also includes the fix that I backported in #63794 so great to no longer have that patch being floated :-)

Renegade334 added a commit that referenced this pull request Jul 1, 2026
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
PR-URL: #64222
Refs: #64040
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
richardlau pushed a commit that referenced this pull request Jul 3, 2026
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
PR-URL: #64222
Refs: #64040
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
AC_INIT([libffi],[3.6.0],[http://github.com/libffi/libffi/issues])
AC_CONFIG_HEADERS([fficonfig.h])

FFI_VERSION_STRING="3.5.2"

@aduh95aduh95Jul 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why this wasn't updated, that's the string that get reported when running node -p process.versions.libffi. I've asked in libffi/libffi#992

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

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.commit-queue-rebaseAdd this label to allow the Commit Queue to land a PR in several commits.dependenciesPull requests that update a dependency file.fast-trackPRs that do not need to wait for 48 hours to land.ffiIssues and PRs related to experimental Foreign Function Interface support.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@nodejs-github-bot@aduh95@richardlau@Renegade334@sxa@ShogunPanda@atgreen