From sroy at openjdk.org Mon Dec 1 12:45:35 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Mon, 1 Dec 2025 12:45:35 GMT Subject: RFR: Add support for AIX in build process [v2] In-Reply-To: <5fGLnFg1xHomCu4iNljgEcIZmzBz5E4e6lem7I9Yqas=.8cf1ef32-d971-4291-a84f-414f6ea0e8d1@github.com> References: <5fGLnFg1xHomCu4iNljgEcIZmzBz5E4e6lem7I9Yqas=.8cf1ef32-d971-4291-a84f-414f6ea0e8d1@github.com> Message-ID: On Thu, 20 Nov 2025 14:50:10 GMT, Jorn Vernee wrote: >> Suchismith Roy has updated the pull request incrementally with one additional commit since the last revision: >> >> Restore gradlew executable > > Question: Are you planning on using the MakeFile build? We are currently only using this for Oracle internal CI Hi @JornVernee can you kindly review this for further changes ? ------------- PR Comment: https://git.openjdk.org/jextract/pull/297#issuecomment-3596366122 From sroy at openjdk.org Mon Dec 1 13:34:27 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Mon, 1 Dec 2025 13:34:27 GMT Subject: RFR: 7904115: Fix for AIX test case failures due to incorrect alignment for double and pointer [v2] In-Reply-To: <6ozZL2ADnfbZeg2EIIidAuaCLPhnx1rNPLXKb7g8xnY=.1a2899e1-90c8-4ed9-9378-a4931ec67904@github.com> References: <6ozZL2ADnfbZeg2EIIidAuaCLPhnx1rNPLXKb7g8xnY=.1a2899e1-90c8-4ed9-9378-a4931ec67904@github.com> Message-ID: On Fri, 21 Nov 2025 15:40:01 GMT, Jorn Vernee wrote: >> Varada M has updated the pull request incrementally with two additional commits since the last revision: >> >> - addition of -m64 at right place >> - addition of -m64 at right place > > @varada1110 > > You could also try the following patch: > > > diff --git a/src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java b/src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java > index 7c1ae3a..a317dc5 100644 > --- a/src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java > +++ b/src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java > @@ -30,7 +30,6 @@ import org.openjdk.jextract.Type.Declared; > import org.openjdk.jextract.Type.Delegated; > import org.openjdk.jextract.Type.Function; > import org.openjdk.jextract.Type.Primitive; > -import org.openjdk.jextract.impl.DeclarationImpl.ClangAlignOf; > import org.openjdk.jextract.impl.DeclarationImpl.ClangEnumType; > import org.openjdk.jextract.impl.DeclarationImpl.DeclarationString; > import org.openjdk.jextract.impl.DeclarationImpl.JavaName; > @@ -201,19 +200,25 @@ abstract class ClassSourceBuilder { > throw new IllegalArgumentException("Not handled: " + type); > } > > + private static final int NO_ALIGN_REQUIRED_MARKER = -1; > + > String layoutString(Type type) { > - return layoutString(type, Long.MAX_VALUE); > + return fieldLayoutString(type, -1, NO_ALIGN_REQUIRED_MARKER); > } > > - String layoutString(Type type, long align) { > + String fieldLayoutString(Type type, long typeAlign, long expectedAlign) { > return switch (type) { > - case Primitive p -> primitiveLayoutString(p, align); > - case Declared d when Utils.isEnum(d) -> layoutString(ClangEnumType.get(d.tree()).get(), align); > - case Declared d when Utils.isStructOrUnion(d) -> alignIfNeeded(JavaName.getFullNameOrThrow(d.tree()) + ".layout()", ClangAlignOf.getOrThrow(d.tree()) / 8, align); > - case Delegated d when d.kind() == Delegated.Kind.POINTER -> alignIfNeeded(runtimeHelperName() + ".C_POINTER", 8, align); > - case Delegated d -> layoutString(d.type(), align); > - case Function _ -> alignIfNeeded(runtimeHelperName() + ".C_POINTER", 8, align); > - case Array a -> String.format("MemoryLayout.sequenceLayout(%1$d, %2$s)", a.elementCount().orElse(0L), layoutString(a.elementType(), align)); > + case Primitive p -> primitiveLayoutString(p, typeAlign, expectedAlign); > + case Declared d when Utils.isEnum(d) -> > + fieldLayoutString(ClangEnumType.get(d.tree()).get(), typeAlign, expectedAlign); > + case Declared d when Utils.isStructOrUnion(d) -> > + alignIfNeeded(JavaName.getFull... @JornVernee can we have another round of reviews for this PR ? ------------- PR Comment: https://git.openjdk.org/jextract/pull/296#issuecomment-3596566459 From jvernee at openjdk.org Mon Dec 1 18:02:52 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Mon, 1 Dec 2025 18:02:52 GMT Subject: RFR: Add support for AIX in build process [v3] In-Reply-To: <2MBJ7VAY6U_67ePZtbdZlKMgJqoye6JbC_npEDIo-Lk=.134f681c-ecac-4959-b5a1-33e6e3e36a90@github.com> References: <2MBJ7VAY6U_67ePZtbdZlKMgJqoye6JbC_npEDIo-Lk=.134f681c-ecac-4959-b5a1-33e6e3e36a90@github.com> Message-ID: On Thu, 20 Nov 2025 15:01:05 GMT, Suchismith Roy wrote: >> Summary of the issues: >> >> 1. There is no support for compiling AIX dynamic .a library and the tool was compiling .so files instead. >> 2. There is no logic to support libclang.a. >> 3. There is no support to load shared member of .a dynamic libraries of AIX. >> >> JBS Issue: [CODETOOLS-7904116](https://bugs.openjdk.org/browse/CODETOOLS-7904116) > > Suchismith Roy has updated the pull request incrementally with one additional commit since the last revision: > > remove debug codE Also, please check the failing GitHub actions. build.gradle line 41: > 39: } > 40: def clang_version = clang_versions[0] > 41: Please clean up the spurious white space changes from the patch. build.gradle line 95: > 93: include("libclang.a") > 94: into("$buildDir/test-libs") > 95: } This doesn't look right. This task is meant from creating the jmod inputs, not for setting up tests. This shouldn't be needed any way, since the tests are run on a runtime image that includes the library already. build.gradle line 281: > 279: tasks.named("jtreg") { > 280: dependsOn("copyLibClangToTestLib") > 281: } I'm not sure why this needs to be done. Jextract should be able to load the libclang library from the runtime image we create for the tests. If this extra copy step is needed as well, that would indicate that the runtime image is not functional. make/Common.gmk line 95: > 93: endif > 94: endif > 95: endif Please undo the format changes. src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 88: > 86: static { > 87: String osName = System.getProperty("os.name"); > 88: String libName = ""; This variable doesn't look like it needs to be hoisted. src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 105: > 103: } > 104: } > 105: SYMBOL_LOOKUP = SymbolLookup.libraryLookup(libName + "(libclang.so.14)", Arena.global()); Pleas fix the indentation here. test/test-support/CMakeLists.txt line 32: > 30: # Link against libm to resolve sqrt() and other math symbols > 31: target_link_libraries(${LIB_NAME} m) > 32: This does not work on Windows: LINK : fatal error LNK1181: cannot open input file 'm.lib' ------------- PR Comment: https://git.openjdk.org/jextract/pull/297#issuecomment-3598076388 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2577785978 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2577789402 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2577794443 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2577797083 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2578091244 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2578014464 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2578024219 From jvernee at openjdk.org Mon Dec 1 18:02:44 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Mon, 1 Dec 2025 18:02:44 GMT Subject: RFR: Add support for AIX in build process [v2] In-Reply-To: References: <5fGLnFg1xHomCu4iNljgEcIZmzBz5E4e6lem7I9Yqas=.8cf1ef32-d971-4291-a84f-414f6ea0e8d1@github.com> Message-ID: On Thu, 20 Nov 2025 14:57:06 GMT, Suchismith Roy wrote: > > Question: Are you planning on using the MakeFile build? We are currently only using this for Oracle internal CI > > Yes. There was no support for AIX , I had to add the path for libclang.a. Just to be clear, I'm asking if _you_ are using the MakeFile build. You've updated both the Gradle and MakeFile builds, are you actually using both of them? If you don't need the MakeFile build, I suggest we just keep AIX support unimplemented there. Like I said, it's really only there to support Oracle CI at the moment (and Oracle doesn't build/test on AIX), the Gradle build is for public use. ------------- PR Comment: https://git.openjdk.org/jextract/pull/297#issuecomment-3598054650 From jvernee at openjdk.org Mon Dec 1 18:02:55 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Mon, 1 Dec 2025 18:02:55 GMT Subject: RFR: Add support for AIX in build process [v3] In-Reply-To: References: <2MBJ7VAY6U_67ePZtbdZlKMgJqoye6JbC_npEDIo-Lk=.134f681c-ecac-4959-b5a1-33e6e3e36a90@github.com> Message-ID: On Mon, 1 Dec 2025 17:35:36 GMT, Jorn Vernee wrote: >> Suchismith Roy has updated the pull request incrementally with one additional commit since the last revision: >> >> remove debug codE > > src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 105: > >> 103: } >> 104: } >> 105: SYMBOL_LOOKUP = SymbolLookup.libraryLookup(libName + "(libclang.so.14)", Arena.global()); > > Pleas fix the indentation here. Also, hard-coding paths the the build directories in the production code seems fishy. It also shouldn't be needed. If the library is properly included in the runtime image, that's where it can be found, and I'm expecting the call to `libraryLookup` to succeed. If it doesn't then there's something wrong with the runtime image. You might want to test grabbing the .jmod file from the build, and creating another runtime image with it, and then trying to access some of the jextract API classes in e.g. a jshell session, to see if the library can be loaded. > test/test-support/CMakeLists.txt line 32: > >> 30: # Link against libm to resolve sqrt() and other math symbols >> 31: target_link_libraries(${LIB_NAME} m) >> 32: > > This does not work on Windows: > > > LINK : fatal error LNK1181: cannot open input file 'm.lib' Maybe you could use something like: Suggestion: # Link against libm to resolve sqrt() and other math symbols find_library(LIBM, m) if(LIBM) target_link_libraries(${LIB_NAME} ${LIBM}) endif() ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2578023133 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2578088201 From jvernee at openjdk.org Mon Dec 1 18:12:28 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Mon, 1 Dec 2025 18:12:28 GMT Subject: RFR: 7904115: Fix for AIX test case failures due to incorrect alignment for double and pointer [v2] In-Reply-To: <6ozZL2ADnfbZeg2EIIidAuaCLPhnx1rNPLXKb7g8xnY=.1a2899e1-90c8-4ed9-9378-a4931ec67904@github.com> References: <6ozZL2ADnfbZeg2EIIidAuaCLPhnx1rNPLXKb7g8xnY=.1a2899e1-90c8-4ed9-9378-a4931ec67904@github.com> Message-ID: <2sRzyC4F18VJJ4kxsQ7yJz247PwxyAb-8kmnPF9sznQ=.e6aa4856-a598-48ae-aab2-13cd6966773c@github.com> On Fri, 21 Nov 2025 15:40:01 GMT, Jorn Vernee wrote: >> Varada M has updated the pull request incrementally with two additional commits since the last revision: >> >> - addition of -m64 at right place >> - addition of -m64 at right place > > @varada1110 > > You could also try the following patch: > > > diff --git a/src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java b/src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java > index 7c1ae3a..a317dc5 100644 > --- a/src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java > +++ b/src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java > @@ -30,7 +30,6 @@ import org.openjdk.jextract.Type.Declared; > import org.openjdk.jextract.Type.Delegated; > import org.openjdk.jextract.Type.Function; > import org.openjdk.jextract.Type.Primitive; > -import org.openjdk.jextract.impl.DeclarationImpl.ClangAlignOf; > import org.openjdk.jextract.impl.DeclarationImpl.ClangEnumType; > import org.openjdk.jextract.impl.DeclarationImpl.DeclarationString; > import org.openjdk.jextract.impl.DeclarationImpl.JavaName; > @@ -201,19 +200,25 @@ abstract class ClassSourceBuilder { > throw new IllegalArgumentException("Not handled: " + type); > } > > + private static final int NO_ALIGN_REQUIRED_MARKER = -1; > + > String layoutString(Type type) { > - return layoutString(type, Long.MAX_VALUE); > + return fieldLayoutString(type, -1, NO_ALIGN_REQUIRED_MARKER); > } > > - String layoutString(Type type, long align) { > + String fieldLayoutString(Type type, long typeAlign, long expectedAlign) { > return switch (type) { > - case Primitive p -> primitiveLayoutString(p, align); > - case Declared d when Utils.isEnum(d) -> layoutString(ClangEnumType.get(d.tree()).get(), align); > - case Declared d when Utils.isStructOrUnion(d) -> alignIfNeeded(JavaName.getFullNameOrThrow(d.tree()) + ".layout()", ClangAlignOf.getOrThrow(d.tree()) / 8, align); > - case Delegated d when d.kind() == Delegated.Kind.POINTER -> alignIfNeeded(runtimeHelperName() + ".C_POINTER", 8, align); > - case Delegated d -> layoutString(d.type(), align); > - case Function _ -> alignIfNeeded(runtimeHelperName() + ".C_POINTER", 8, align); > - case Array a -> String.format("MemoryLayout.sequenceLayout(%1$d, %2$s)", a.elementCount().orElse(0L), layoutString(a.elementType(), align)); > + case Primitive p -> primitiveLayoutString(p, typeAlign, expectedAlign); > + case Declared d when Utils.isEnum(d) -> > + fieldLayoutString(ClangEnumType.get(d.tree()).get(), typeAlign, expectedAlign); > + case Declared d when Utils.isStructOrUnion(d) -> > + alignIfNeeded(JavaName.getFull... > @JornVernee can we have another round of reviews for this PR ? I was still waiting for the changes we discussed last time to be implemented. I was assuming @varada1110 was still working on them. ------------- PR Comment: https://git.openjdk.org/jextract/pull/296#issuecomment-3598113587 From nizar.benalla at oracle.com Mon Dec 1 21:06:37 2025 From: nizar.benalla at oracle.com (Nizar Benalla) Date: Mon, 1 Dec 2025 21:06:37 +0000 Subject: Release frequency for binaries In-Reply-To: References: <2928b70c-2fd0-497b-9f9e-f6d2de6a3c7e@oracle.com> Message-ID: Hi Adrian, Just a quick update, we've refreshed the binaries a few days ago. We're also working towards increasing the release frequency going forward. Nizar ________________________________ From: jextract-dev on behalf of Adrian Trapletti Sent: Friday, November 14, 2025 5:02 PM To: Maurizio Cimadamore Cc: jextract-dev at openjdk.org Subject: Re: Release frequency for binaries Hi Maurizio, That's great to hear! Thx Adrian Dr. Adrian Trapletti CEO Uster Metrics GmbH Steinstrasse 9b 8610 Uster, Switzerland P +41 32 512 83 63 M +41 79 103 71 31 a.trapletti at ustermetrics.com www.ustermetrics.com This email message including any attachments is confidential and may be privileged. It is intended solely for the use of the individual or entity named on this message. It is provided for informational purposes only and does not constitute an offer or invitation to subscribe for or purchase any services or products. Any form of disclosure, copying, modification or distribution is unauthorized. If you are not the intended recipient, you are requested to please notify the sender immediately and delete the message including any attachments from your computer system network. Email transmission cannot be guaranteed to be secure or error free as information could be modified. We therefore do not accept responsibility or liability as to the completeness or accuracy of the information contained in this message or any attachments. On Fri, Nov 14, 2025, 16:57 Maurizio Cimadamore > wrote: Hi Adrian, we used to issue new binaries sparingly, but are working towards improving on that front. Re. the specific bug you mention, I've already brought that to the attenion of the team, as I agree that's serious enoug to warrant a respin. Maurizio On 13/11/2025 19:50, Adrian Trapletti wrote: Hi, I am wondering what is the release frequency or strategy for jextract binaries, in particular e.g. after a bug like https://github.com/openjdk/jextract/commit/91fc954c46fac907cae6cd1417d835208c9df150 has been detected and fixed, are you going to provide a new binary release? Best, Adrian Dr. Adrian Trapletti CEO Uster Metrics GmbH | Steinstrasse 9b, 8610 Uster, Switzerland P +41 32 512 83 63 | M +41 79 103 71 31 a.trapletti at ustermetrics.com | www.ustermetrics.com This email message including any attachments is confidential and may be privileged. It is intended solely for the use of the individual or entity named on this message. It is provided for informational purposes only and does not constitute an offer or invitation to subscribe for or purchase any services or products. Any form of disclosure, copying, modification or distribution is unauthorized. If you are not the intended recipient, you are requested to please notify the sender immediately and delete the message including any attachments from your computer system network. Email transmission cannot be guaranteed to be secure or error free as information could be modified. We therefore do not accept responsibility or liability as to the completeness or accuracy of the information contained in this message or any attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sroy at openjdk.org Thu Dec 4 06:37:31 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Thu, 4 Dec 2025 06:37:31 GMT Subject: RFR: Add support for AIX in build process [v2] In-Reply-To: References: <5fGLnFg1xHomCu4iNljgEcIZmzBz5E4e6lem7I9Yqas=.8cf1ef32-d971-4291-a84f-414f6ea0e8d1@github.com> Message-ID: On Mon, 1 Dec 2025 17:56:06 GMT, Jorn Vernee wrote: > > > Question: Are you planning on using the MakeFile build? We are currently only using this for Oracle internal CI > > > > > > Yes. There was no support for AIX , I had to add the path for libclang.a. > > Just to be clear, I'm asking if _you_ are using the MakeFile build. You've updated both the Gradle and MakeFile builds, are you actually using both of them? > > If you don't need the MakeFile build, I suggest we just keep AIX support unimplemented there. Like I said, it's really only there to support Oracle CI at the moment (and Oracle doesn't build/test on AIX), the Gradle build is for public use. Are you referring to the changes only in make/Build.gmk ? ------------- PR Comment: https://git.openjdk.org/jextract/pull/297#issuecomment-3610530747 From sroy at openjdk.org Thu Dec 4 07:59:52 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Thu, 4 Dec 2025 07:59:52 GMT Subject: RFR: Add support for AIX in build process [v3] In-Reply-To: References: <2MBJ7VAY6U_67ePZtbdZlKMgJqoye6JbC_npEDIo-Lk=.134f681c-ecac-4959-b5a1-33e6e3e36a90@github.com> Message-ID: On Mon, 1 Dec 2025 17:38:00 GMT, Jorn Vernee wrote: >> src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 105: >> >>> 103: } >>> 104: } >>> 105: SYMBOL_LOOKUP = SymbolLookup.libraryLookup(libName + "(libclang.so.14)", Arena.global()); >> >> Pleas fix the indentation here. > > Also, hard-coding paths the the build directories in the production code seems fishy. It also shouldn't be needed. If the library is properly included in the runtime image, that's where it can be found, and I'm expecting the call to `libraryLookup` to succeed. > > If it doesn't then there's something wrong with the runtime image. You might want to test grabbing the .jmod file from the build, and creating another runtime image with it, and then trying to access some of the jextract API classes in e.g. a jshell session, to see if the library can be loaded. @JornVernee for AIX dynamic libraries we need to mention the shared member (libclang.so.14) for it succeed. @JornVernee not sure if there a way to fetch clang version ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2587952959 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2587959256 From jvernee at openjdk.org Thu Dec 4 09:53:37 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Thu, 4 Dec 2025 09:53:37 GMT Subject: RFR: Add support for AIX in build process [v2] In-Reply-To: References: <5fGLnFg1xHomCu4iNljgEcIZmzBz5E4e6lem7I9Yqas=.8cf1ef32-d971-4291-a84f-414f6ea0e8d1@github.com> Message-ID: On Thu, 4 Dec 2025 06:35:08 GMT, Suchismith Roy wrote: > > > > Question: Are you planning on using the MakeFile build? We are currently only using this for Oracle internal CI > > > > > > > > > Yes. There was no support for AIX , I had to add the path for libclang.a. > > > > > > Just to be clear, I'm asking if _you_ are using the MakeFile build. You've updated both the Gradle and MakeFile builds, are you actually using both of them? > > If you don't need the MakeFile build, I suggest we just keep AIX support unimplemented there. Like I said, it's really only there to support Oracle CI at the moment (and Oracle doesn't build/test on AIX), the Gradle build is for public use. > > Are you referring to the changes only in make/Build.gmk ? I'm talking about all the make file changes, so make/Build.gmk, make/Common.gmk, and make/NativeCompilation.gmk. ------------- PR Comment: https://git.openjdk.org/jextract/pull/297#issuecomment-3611170164 From sroy at openjdk.org Thu Dec 4 09:57:42 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Thu, 4 Dec 2025 09:57:42 GMT Subject: RFR: Add support for AIX in build process [v2] In-Reply-To: References: <5fGLnFg1xHomCu4iNljgEcIZmzBz5E4e6lem7I9Yqas=.8cf1ef32-d971-4291-a84f-414f6ea0e8d1@github.com> Message-ID: On Thu, 4 Dec 2025 09:50:33 GMT, Jorn Vernee wrote: > > > > > Question: Are you planning on using the MakeFile build? We are currently only using this for Oracle internal CI > > > > > > > > > > > > Yes. There was no support for AIX , I had to add the path for libclang.a. > > > > > > > > > Just to be clear, I'm asking if _you_ are using the MakeFile build. You've updated both the Gradle and MakeFile builds, are you actually using both of them? > > > If you don't need the MakeFile build, I suggest we just keep AIX support unimplemented there. Like I said, it's really only there to support Oracle CI at the moment (and Oracle doesn't build/test on AIX), the Gradle build is for public use. > > > > > > Are you referring to the changes only in make/Build.gmk ? > > I'm talking about all the make file changes, so make/Build.gmk, make/Common.gmk, and make/NativeCompilation.gmk. Ok. Let me revert some changes and keep checking if that works. was not sure which build file causes the effects. ------------- PR Comment: https://git.openjdk.org/jextract/pull/297#issuecomment-3611194703 From jvernee at openjdk.org Thu Dec 4 10:15:45 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Thu, 4 Dec 2025 10:15:45 GMT Subject: RFR: Add support for AIX in build process [v3] In-Reply-To: References: <2MBJ7VAY6U_67ePZtbdZlKMgJqoye6JbC_npEDIo-Lk=.134f681c-ecac-4959-b5a1-33e6e3e36a90@github.com> Message-ID: On Thu, 4 Dec 2025 07:57:20 GMT, Suchismith Roy wrote: >> Also, hard-coding paths the the build directories in the production code seems fishy. It also shouldn't be needed. If the library is properly included in the runtime image, that's where it can be found, and I'm expecting the call to `libraryLookup` to succeed. >> >> If it doesn't then there's something wrong with the runtime image. You might want to test grabbing the .jmod file from the build, and creating another runtime image with it, and then trying to access some of the jextract API classes in e.g. a jshell session, to see if the library can be loaded. > > @JornVernee not sure if there a way to fetch clang version I'm confused, that patch has a test that shows loading a library through `System.loadLibrary` working, and I remember seeing those patches in the JDK, and thought `loadLibrary` support was working on AIX as well now. Why doesn't that work for clang? Is it possible to change the way you're building clang to not use an archive member? ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2588388101 From jvernee at openjdk.org Thu Dec 4 10:15:46 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Thu, 4 Dec 2025 10:15:46 GMT Subject: RFR: Add support for AIX in build process [v3] In-Reply-To: References: <2MBJ7VAY6U_67ePZtbdZlKMgJqoye6JbC_npEDIo-Lk=.134f681c-ecac-4959-b5a1-33e6e3e36a90@github.com> Message-ID: <5SZkAOkpTFwPbGGbe2shK6EtnSudqsAXARTYUUKvVq0=.a9314c12-d1f3-40c6-8585-a913f701d345@github.com> On Thu, 4 Dec 2025 10:11:58 GMT, Jorn Vernee wrote: >> @JornVernee not sure if there a way to fetch clang version > > I'm confused, that patch has a test that shows loading a library through `System.loadLibrary` working, and I remember seeing those patches in the JDK, and thought `loadLibrary` support was working on AIX as well now. Why doesn't that work for clang? Is it possible to change the way you're building clang to not use an archive member? Otherwise, if `loadLibrary` needs to be used, I think the resolution of the library should be done relative to `System.getProperty("java.home")` and then I suppose jlink puts the library under `lib`. ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2588391457 From sroy at openjdk.org Thu Dec 4 13:57:04 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Thu, 4 Dec 2025 13:57:04 GMT Subject: RFR: Add support for AIX in build process [v3] In-Reply-To: <5SZkAOkpTFwPbGGbe2shK6EtnSudqsAXARTYUUKvVq0=.a9314c12-d1f3-40c6-8585-a913f701d345@github.com> References: <2MBJ7VAY6U_67ePZtbdZlKMgJqoye6JbC_npEDIo-Lk=.134f681c-ecac-4959-b5a1-33e6e3e36a90@github.com> <5SZkAOkpTFwPbGGbe2shK6EtnSudqsAXARTYUUKvVq0=.a9314c12-d1f3-40c6-8585-a913f701d345@github.com> Message-ID: <4tHdDYEJl9wM-0DYTqK96MAS0ApJM2qcV9Po8-3TDFY=.5627554e-fef6-49a9-8ca1-a744e81d36c1@github.com> On Thu, 4 Dec 2025 10:12:52 GMT, Jorn Vernee wrote: >> I'm confused, that patch has a test that shows loading a library through `System.loadLibrary` working, and I remember seeing those patches in the JDK, and thought `loadLibrary` support was working on AIX as well now. Why doesn't that work for clang? Is it possible to change the way you're building clang to not use an archive member? > > Otherwise, if `loadLibrary` needs to be used, I think the resolution of the library should be done relative to `System.getProperty("java.home")` and then I suppose jlink puts the library under `lib`. The test is for cases where we do not refer to shared members and just dynamic libraries with .an extension. To refer shared members one needs to give full path using System.load. ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2589180310 From sroy at openjdk.org Thu Dec 4 14:05:44 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Thu, 4 Dec 2025 14:05:44 GMT Subject: RFR: Add support for AIX in build process [v3] In-Reply-To: <4tHdDYEJl9wM-0DYTqK96MAS0ApJM2qcV9Po8-3TDFY=.5627554e-fef6-49a9-8ca1-a744e81d36c1@github.com> References: <2MBJ7VAY6U_67ePZtbdZlKMgJqoye6JbC_npEDIo-Lk=.134f681c-ecac-4959-b5a1-33e6e3e36a90@github.com> <5SZkAOkpTFwPbGGbe2shK6EtnSudqsAXARTYUUKvVq0=.a9314c12-d1f3-40c6-8585-a913f701d345@github.com> <4tHdDYEJl9wM-0DYTqK96MAS0ApJM2qcV9Po8-3TDFY=.5627554e-fef6-49a9-8ca1-a744e81d36c1@github.com> Message-ID: On Thu, 4 Dec 2025 13:53:51 GMT, Suchismith Roy wrote: >> Otherwise, if `loadLibrary` needs to be used, I think the resolution of the library should be done relative to `System.getProperty("java.home")` and then I suppose jlink puts the library under `lib`. > > The test is for cases where we do not refer to shared members and just dynamic libraries with .an extension. > To refer shared members one needs to give full path using System.load. > Otherwise, if `loadLibrary` needs to be used, I think the resolution of the library should be done relative to `System.getProperty("java.home")` and then I suppose jlink puts the library under `lib`. Aren't the files copied from lib clang directory to lib under jextract folder? Hence I used user.dir, as the application runs there ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2589214429 From jvernee at openjdk.org Thu Dec 4 14:11:04 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Thu, 4 Dec 2025 14:11:04 GMT Subject: RFR: Add support for AIX in build process [v3] In-Reply-To: References: <2MBJ7VAY6U_67ePZtbdZlKMgJqoye6JbC_npEDIo-Lk=.134f681c-ecac-4959-b5a1-33e6e3e36a90@github.com> <5SZkAOkpTFwPbGGbe2shK6EtnSudqsAXARTYUUKvVq0=.a9314c12-d1f3-40c6-8585-a913f701d345@github.com> <4tHdDYEJl9wM-0DYTqK96MAS0ApJM2qcV9Po8-3TDFY=.5627554e-fef6-49a9-8ca1-a744e81d36c1@github.com> Message-ID: <5QaPPMIT5XM6aSLbh9eHNnQo-z96YVA8Q85DgNgzvV8=.3684580a-d9a7-4a13-b50f-91d23b284256@github.com> On Thu, 4 Dec 2025 14:03:18 GMT, Suchismith Roy wrote: > > Otherwise, if `loadLibrary` needs to be used, I think the resolution of the library should be done relative to `System.getProperty("java.home")` and then I suppose jlink puts the library under `lib`. > > Aren't the files copied from lib clang directory to lib under jextract folder? Hence I used user.dir, as the application runs there No, that's only for the build. In the final app image (under `./build/jextract` when using the gradle build) they are in the Java runtime image under `jextract/runtime/lib` (or `jextract/runtime/bin`. This is just where jlink puts them btw. We first create a .jmod file with the native libraries, and then use that to generate the runtime image using jlink. ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2589231619 From jvernee at openjdk.org Thu Dec 4 14:25:02 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Thu, 4 Dec 2025 14:25:02 GMT Subject: RFR: Add support for AIX in build process [v3] In-Reply-To: <5QaPPMIT5XM6aSLbh9eHNnQo-z96YVA8Q85DgNgzvV8=.3684580a-d9a7-4a13-b50f-91d23b284256@github.com> References: <2MBJ7VAY6U_67ePZtbdZlKMgJqoye6JbC_npEDIo-Lk=.134f681c-ecac-4959-b5a1-33e6e3e36a90@github.com> <5SZkAOkpTFwPbGGbe2shK6EtnSudqsAXARTYUUKvVq0=.a9314c12-d1f3-40c6-8585-a913f701d345@github.com> <4tHdDYEJl9wM-0DYTqK96MAS0ApJM2qcV9Po8-3TDFY=.5627554e-fef6-49a9-8ca1-a744e81d36c1@github.com> <5QaPPMIT5XM6aSLbh9eHNnQo-z96YVA8Q85DgNgzvV8=.3684580a-d9a7-4a13-b50f-91d23b284256@github.com> Message-ID: On Thu, 4 Dec 2025 14:07:55 GMT, Jorn Vernee wrote: >>> Otherwise, if `loadLibrary` needs to be used, I think the resolution of the library should be done relative to `System.getProperty("java.home")` and then I suppose jlink puts the library under `lib`. >> >> Aren't the files copied from lib clang directory to lib under jextract folder? Hence I used user.dir, as the application runs there > >> > Otherwise, if `loadLibrary` needs to be used, I think the resolution of the library should be done relative to `System.getProperty("java.home")` and then I suppose jlink puts the library under `lib`. >> >> Aren't the files copied from lib clang directory to lib under jextract folder? Hence I used user.dir, as the application runs there > > No, that's only for the build. In the final app image (under `./build/jextract` when using the gradle build) they are in the Java runtime image under `jextract/runtime/lib` (or `jextract/runtime/bin`. This is just where jlink puts them btw. We first create a .jmod file with the native libraries, and then use that to generate the runtime image using jlink. Try these steps: ./gradlew build export PATH=$PWD/build/jextract/bin:$PATH cd /some/other/path/somewhere jextract foo.h `foo.h` can just be an empty file, but this is enough to trigger the loading of libclang. In this case, `user.dir` would be `/some/other/path/somewhere`, so the library can't be found relative to that. ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2589287001 From sroy at openjdk.org Mon Dec 8 08:36:21 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Mon, 8 Dec 2025 08:36:21 GMT Subject: RFR: Add support for AIX in build process [v4] In-Reply-To: References: Message-ID: > Summary of the issues: > > 1. There is no support for compiling AIX dynamic .a library and the tool was compiling .so files instead. > 2. There is no logic to support libclang.a. > 3. There is no support to load shared member of .a dynamic libraries of AIX. > > JBS Issue: [CODETOOLS-7904116](https://bugs.openjdk.org/browse/CODETOOLS-7904116) Suchismith Roy has updated the pull request incrementally with three additional commits since the last revision: - change library lookup path: - Indendtation - Restore changes in Build files ------------- Changes: - all: https://git.openjdk.org/jextract/pull/297/files - new: https://git.openjdk.org/jextract/pull/297/files/73da4b04..b3df01c2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jextract&pr=297&range=03 - incr: https://webrevs.openjdk.org/?repo=jextract&pr=297&range=02-03 Stats: 107 lines in 6 files changed: 18 ins; 71 del; 18 mod Patch: https://git.openjdk.org/jextract/pull/297.diff Fetch: git fetch https://git.openjdk.org/jextract.git pull/297/head:pull/297 PR: https://git.openjdk.org/jextract/pull/297 From sroy at openjdk.org Mon Dec 8 08:42:59 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Mon, 8 Dec 2025 08:42:59 GMT Subject: RFR: Add support for AIX in build process [v5] In-Reply-To: References: Message-ID: > Summary of the issues: > > 1. There is no support for compiling AIX dynamic .a library and the tool was compiling .so files instead. > 2. There is no logic to support libclang.a. > 3. There is no support to load shared member of .a dynamic libraries of AIX. > > JBS Issue: [CODETOOLS-7904116](https://bugs.openjdk.org/browse/CODETOOLS-7904116) Suchismith Roy has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains three new commits since the last revision: - change library lookup path: - Indendtation - Restore changes in Build files ------------- Changes: - all: https://git.openjdk.org/jextract/pull/297/files - new: https://git.openjdk.org/jextract/pull/297/files/b3df01c2..92967cdd Webrevs: - full: https://webrevs.openjdk.org/?repo=jextract&pr=297&range=04 - incr: https://webrevs.openjdk.org/?repo=jextract&pr=297&range=03-04 Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jextract/pull/297.diff Fetch: git fetch https://git.openjdk.org/jextract.git pull/297/head:pull/297 PR: https://git.openjdk.org/jextract/pull/297 From sroy at openjdk.org Mon Dec 8 08:43:00 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Mon, 8 Dec 2025 08:43:00 GMT Subject: RFR: Add support for AIX in build process [v2] In-Reply-To: References: <5fGLnFg1xHomCu4iNljgEcIZmzBz5E4e6lem7I9Yqas=.8cf1ef32-d971-4291-a84f-414f6ea0e8d1@github.com> Message-ID: On Thu, 4 Dec 2025 09:50:33 GMT, Jorn Vernee wrote: >>> > > Question: Are you planning on using the MakeFile build? We are currently only using this for Oracle internal CI >>> > >>> > >>> > Yes. There was no support for AIX , I had to add the path for libclang.a. >>> >>> Just to be clear, I'm asking if _you_ are using the MakeFile build. You've updated both the Gradle and MakeFile builds, are you actually using both of them? >>> >>> If you don't need the MakeFile build, I suggest we just keep AIX support unimplemented there. Like I said, it's really only there to support Oracle CI at the moment (and Oracle doesn't build/test on AIX), the Gradle build is for public use. >> >> Are you referring to the changes only in make/Build.gmk ? > >> > > > Question: Are you planning on using the MakeFile build? We are currently only using this for Oracle internal CI >> > > >> > > >> > > Yes. There was no support for AIX , I had to add the path for libclang.a. >> > >> > >> > Just to be clear, I'm asking if _you_ are using the MakeFile build. You've updated both the Gradle and MakeFile builds, are you actually using both of them? >> > If you don't need the MakeFile build, I suggest we just keep AIX support unimplemented there. Like I said, it's really only there to support Oracle CI at the moment (and Oracle doesn't build/test on AIX), the Gradle build is for public use. >> >> Are you referring to the changes only in make/Build.gmk ? > > I'm talking about all the make file changes, so make/Build.gmk, make/Common.gmk, and make/NativeCompilation.gmk. Hi @JornVernee I have incorporated your changes. Thank you so much for your inputs, a lot of extra build files and code got eliminated because of it. kindly give a round of review. ------------- PR Comment: https://git.openjdk.org/jextract/pull/297#issuecomment-3625685693 From jvernee at openjdk.org Mon Dec 8 12:03:39 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Mon, 8 Dec 2025 12:03:39 GMT Subject: RFR: Add support for AIX in build process [v5] In-Reply-To: References: Message-ID: On Mon, 8 Dec 2025 08:42:59 GMT, Suchismith Roy wrote: >> Summary of the issues: >> >> 1. There is no support for compiling AIX dynamic .a library and the tool was compiling .so files instead. >> 2. There is no logic to support libclang.a. >> 3. There is no support to load shared member of .a dynamic libraries of AIX. >> >> JBS Issue: [CODETOOLS-7904116](https://bugs.openjdk.org/browse/CODETOOLS-7904116) > > Suchismith Roy has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains three new commits since the last revision: > > - change library lookup path: > - Indendtation > - Restore changes in Build files The current approach looks good to me now, thanks. Let's clean up the patch a bit more before integrating. I've left some comment inline. build.gradle line 210: > 208: } > 209: > 210: Please clean up the spurious white space changes in this file. src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 39: > 37: import java.util.StringTokenizer; > 38: import static java.lang.foreign.MemoryLayout.PathElement.*; > 39: import java.io.File; These import changes don't look like they're needed (with dropped the dependency on `File` in the other suggestion I made). src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 84: > 82: } > 83: > 84: static SymbolLookup SYMBOL_LOOKUP; This should still be `static final` Suggestion: static final SymbolLookup SYMBOL_LOOKUP; src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 95: > 93: libName = f.getAbsolutePath(); > 94: } > 95: SYMBOL_LOOKUP = SymbolLookup.libraryLookup(libName + "(libclang.so.14)", Arena.global()); If we don't enter the `if` statement, the library name will end up as `null(libclang.so.14)`. `libraryLookup` throws an IAE when the library can not be loaded, so I think we can just construct the name and try to load the library. Suggestion: String javaHome = System.getProperty("java.home"); String libName = javaHome + "/lib/libclang.a(libclang.so.14)"; SYMBOL_LOOKUP = SymbolLookup.libraryLookup(libName, LIBRARY_ARENA); test/test-support/CMakeLists.txt line 24: > 22: else() > 23: add_library(${LIB_NAME} SHARED ${TEST_LIB}) > 24: endif() `add_library(${LIB_NAME} SHARED ${TEST_LIB})` is common here, so I think this can be: Suggestion: add_library(${LIB_NAME} SHARED ${TEST_LIB}) if(${CMAKE_SYSTEM_NAME} MATCHES "AIX") set_target_properties(${LIB_NAME} PROPERTIES PREFIX "lib" SUFFIX ".a" COMPILE_FLAGS "-q64 -qhalt=e -qcpluscmt" LINK_FLAGS "-q64 -G -Wl,-bnoentry,-bexpall" ) endif() ------------- PR Review: https://git.openjdk.org/jextract/pull/297#pullrequestreview-3551615966 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2598318118 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2598316520 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2598303886 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2598299276 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2598326409 From jvernee at openjdk.org Mon Dec 8 12:03:39 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Mon, 8 Dec 2025 12:03:39 GMT Subject: RFR: Add support for AIX in build process [v5] In-Reply-To: References: Message-ID: On Mon, 8 Dec 2025 11:44:34 GMT, Jorn Vernee wrote: >> Suchismith Roy has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains three new commits since the last revision: >> >> - change library lookup path: >> - Indendtation >> - Restore changes in Build files > > src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 95: > >> 93: libName = f.getAbsolutePath(); >> 94: } >> 95: SYMBOL_LOOKUP = SymbolLookup.libraryLookup(libName + "(libclang.so.14)", Arena.global()); > > If we don't enter the `if` statement, the library name will end up as `null(libclang.so.14)`. `libraryLookup` throws an IAE when the library can not be loaded, so I think we can just construct the name and try to load the library. > Suggestion: > > String javaHome = System.getProperty("java.home"); > String libName = javaHome + "/lib/libclang.a(libclang.so.14)"; > SYMBOL_LOOKUP = SymbolLookup.libraryLookup(libName, LIBRARY_ARENA); Also, this should use `LIBRARY_ARENA`, so the library can be unloaded. ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2598307316 From jvernee at openjdk.org Mon Dec 8 12:03:39 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Mon, 8 Dec 2025 12:03:39 GMT Subject: RFR: Add support for AIX in build process [v5] In-Reply-To: References: Message-ID: On Mon, 8 Dec 2025 11:46:39 GMT, Jorn Vernee wrote: >> src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 95: >> >>> 93: libName = f.getAbsolutePath(); >>> 94: } >>> 95: SYMBOL_LOOKUP = SymbolLookup.libraryLookup(libName + "(libclang.so.14)", Arena.global()); >> >> If we don't enter the `if` statement, the library name will end up as `null(libclang.so.14)`. `libraryLookup` throws an IAE when the library can not be loaded, so I think we can just construct the name and try to load the library. >> Suggestion: >> >> String javaHome = System.getProperty("java.home"); >> String libName = javaHome + "/lib/libclang.a(libclang.so.14)"; >> SYMBOL_LOOKUP = SymbolLookup.libraryLookup(libName, LIBRARY_ARENA); > > Also, this should use `LIBRARY_ARENA`, so the library can be unloaded. As for hard-coding the library version. We could potentially record the libclang version in a file we store under `conf` in the runtime image, similar to what we do for the bundled header files. The version could then be loaded from that file here. ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2598349179 From sroy at openjdk.org Tue Dec 9 09:04:39 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Tue, 9 Dec 2025 09:04:39 GMT Subject: RFR: Add support for AIX in build process [v5] In-Reply-To: References: Message-ID: <9lZkWNl7eCcYjpRdmpzdxSojYq-zWRFGrQQTKY_8OGk=.d10e0218-bee1-4d46-a955-33eaf1545a74@github.com> On Mon, 8 Dec 2025 11:58:57 GMT, Jorn Vernee wrote: >> Also, this should use `LIBRARY_ARENA`, so the library can be unloaded. > > As for hard-coding the library version. We could potentially record the libclang version in a file we store under `conf` in the runtime image, similar to what we do for the bundled header files. The version could then be loaded from that file here. so we create a version file in jextract folder and copy to conf using task in build.gradle ? and then refer it in Index_.h.java ? ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2601699208 From jvernee at openjdk.org Tue Dec 9 13:02:40 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Tue, 9 Dec 2025 13:02:40 GMT Subject: RFR: Add support for AIX in build process [v5] In-Reply-To: <9lZkWNl7eCcYjpRdmpzdxSojYq-zWRFGrQQTKY_8OGk=.d10e0218-bee1-4d46-a955-33eaf1545a74@github.com> References: <9lZkWNl7eCcYjpRdmpzdxSojYq-zWRFGrQQTKY_8OGk=.d10e0218-bee1-4d46-a955-33eaf1545a74@github.com> Message-ID: On Tue, 9 Dec 2025 09:01:28 GMT, Suchismith Roy wrote: >> As for hard-coding the library version. We could potentially record the libclang version in a file we store under `conf` in the runtime image, similar to what we do for the bundled header files. The version could then be loaded from that file here. > > so we create a version file in jextract folder and copy to conf using task in build.gradle ? and then refer it in Index_.h.java ? I think both generating the file and copying it to conf can be done during the build. And then we refer to if from Index_h.java. ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2602553609 From sroy at openjdk.org Tue Dec 9 17:00:16 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Tue, 9 Dec 2025 17:00:16 GMT Subject: RFR: Add support for AIX in build process [v6] In-Reply-To: References: Message-ID: > Summary of the issues: > > 1. There is no support for compiling AIX dynamic .a library and the tool was compiling .so files instead. > 2. There is no logic to support libclang.a. > 3. There is no support to load shared member of .a dynamic libraries of AIX. > > JBS Issue: [CODETOOLS-7904116](https://bugs.openjdk.org/browse/CODETOOLS-7904116) Suchismith Roy has updated the pull request incrementally with two additional commits since the last revision: - extra lines - version file ------------- Changes: - all: https://git.openjdk.org/jextract/pull/297/files - new: https://git.openjdk.org/jextract/pull/297/files/92967cdd..489a2cc1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jextract&pr=297&range=05 - incr: https://webrevs.openjdk.org/?repo=jextract&pr=297&range=04-05 Stats: 36 lines in 3 files changed: 23 ins; 7 del; 6 mod Patch: https://git.openjdk.org/jextract/pull/297.diff Fetch: git fetch https://git.openjdk.org/jextract.git pull/297/head:pull/297 PR: https://git.openjdk.org/jextract/pull/297 From sroy at openjdk.org Tue Dec 9 17:15:16 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Tue, 9 Dec 2025 17:15:16 GMT Subject: RFR: Add support for AIX in build process [v7] In-Reply-To: References: Message-ID: > Summary of the issues: > > 1. There is no support for compiling AIX dynamic .a library and the tool was compiling .so files instead. > 2. There is no logic to support libclang.a. > 3. There is no support to load shared member of .a dynamic libraries of AIX. > > JBS Issue: [CODETOOLS-7904116](https://bugs.openjdk.org/browse/CODETOOLS-7904116) Suchismith Roy has updated the pull request incrementally with four additional commits since the last revision: - extra lines - extra lines - extra lines - extra lines ------------- Changes: - all: https://git.openjdk.org/jextract/pull/297/files - new: https://git.openjdk.org/jextract/pull/297/files/489a2cc1..45b49ca7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jextract&pr=297&range=06 - incr: https://webrevs.openjdk.org/?repo=jextract&pr=297&range=05-06 Stats: 20 lines in 1 file changed: 0 ins; 5 del; 15 mod Patch: https://git.openjdk.org/jextract/pull/297.diff Fetch: git fetch https://git.openjdk.org/jextract.git pull/297/head:pull/297 PR: https://git.openjdk.org/jextract/pull/297 From sroy at openjdk.org Tue Dec 9 17:15:20 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Tue, 9 Dec 2025 17:15:20 GMT Subject: RFR: Add support for AIX in build process [v5] In-Reply-To: References: Message-ID: On Mon, 8 Dec 2025 11:49:07 GMT, Jorn Vernee wrote: >> Suchismith Roy has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains three new commits since the last revision: >> >> - change library lookup path: >> - Indendtation >> - Restore changes in Build files > > src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 39: > >> 37: import java.util.StringTokenizer; >> 38: import static java.lang.foreign.MemoryLayout.PathElement.*; >> 39: import java.io.File; > > These import changes don't look like they're needed (after dropping the dependency on `File` in the other suggestion I made). I have used Buffered reader to read the file. Kindly check the current approach. Do you recommend reading some property variable to read the version ? ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2603544957 From jvernee at openjdk.org Tue Dec 9 18:39:04 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Tue, 9 Dec 2025 18:39:04 GMT Subject: RFR: Add support for AIX in build process [v7] In-Reply-To: References: Message-ID: <1tAQMAn2y-HX0fYw22s_s38YPvSj75YPtXOMHPPuAAE=.7eada385-344d-4f30-8933-9feab54410f1@github.com> On Tue, 9 Dec 2025 17:15:16 GMT, Suchismith Roy wrote: >> Summary of the issues: >> >> 1. There is no support for compiling AIX dynamic .a library and the tool was compiling .so files instead. >> 2. There is no logic to support libclang.a. >> 3. There is no support to load shared member of .a dynamic libraries of AIX. >> >> JBS Issue: [CODETOOLS-7904116](https://bugs.openjdk.org/browse/CODETOOLS-7904116) > > Suchismith Roy has updated the pull request incrementally with four additional commits since the last revision: > > - extra lines > - extra lines > - extra lines > - extra lines As for the Windows failure in GHA, it can be ignored. It's a know issue: https://bugs.openjdk.org/browse/CODETOOLS-7903174 src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 37: > 35: import java.util.stream.*; > 36: import static java.lang.foreign.ValueLayout.*; > 37: import java.util.StringTokenizer; StringTokenizer still looks unused. src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 98: > 96: } catch (Exception e) { > 97: throw new IllegalStateException("Failed to read libclang.version", e); > 98: } FWIW, `clangVersion` is definitely assigned after the try block, so a default value is not needed. Also, `Files::readString` makes this a little simpler: Suggestion: String clangVersion; try { clangVersion = Files.readString(Path.of(javaHome + "/conf/jextract/libclang.version")); } catch (Exception e) { throw new IllegalStateException("Failed to read libclang.version", e); } ------------- PR Comment: https://git.openjdk.org/jextract/pull/297#issuecomment-3633694463 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2603844214 PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2603844648 From jvernee at openjdk.org Tue Dec 9 18:39:06 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Tue, 9 Dec 2025 18:39:06 GMT Subject: RFR: Add support for AIX in build process [v5] In-Reply-To: References: Message-ID: On Tue, 9 Dec 2025 17:07:52 GMT, Suchismith Roy wrote: >> src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 39: >> >>> 37: import java.util.StringTokenizer; >>> 38: import static java.lang.foreign.MemoryLayout.PathElement.*; >>> 39: import java.io.File; >> >> These import changes don't look like they're needed (after dropping the dependency on `File` in the other suggestion I made). > > I have used Buffered reader to read the file. Kindly check the current approach. Do you recommend reading some property variable to read the version ? I think what you have now looks good. ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2603857085 From sroy at openjdk.org Wed Dec 10 07:00:03 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Wed, 10 Dec 2025 07:00:03 GMT Subject: RFR: Add support for AIX in build process [v7] In-Reply-To: <1tAQMAn2y-HX0fYw22s_s38YPvSj75YPtXOMHPPuAAE=.7eada385-344d-4f30-8933-9feab54410f1@github.com> References: <1tAQMAn2y-HX0fYw22s_s38YPvSj75YPtXOMHPPuAAE=.7eada385-344d-4f30-8933-9feab54410f1@github.com> Message-ID: <-hjs5FU8OqlxNPikbiXvjHaT0hf9BvOhzPXTFfrBKK8=.900c14f7-ad16-428f-a816-eb44967da106@github.com> On Tue, 9 Dec 2025 18:31:58 GMT, Jorn Vernee wrote: >> Suchismith Roy has updated the pull request incrementally with four additional commits since the last revision: >> >> - extra lines >> - extra lines >> - extra lines >> - extra lines > > src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 37: > >> 35: import java.util.stream.*; >> 36: import static java.lang.foreign.ValueLayout.*; >> 37: import java.util.StringTokenizer; > > StringTokenizer still looks unused. @JornVernee Removing the import is causing a lot of spurious errors. ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2605438185 From sroy at openjdk.org Wed Dec 10 07:13:37 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Wed, 10 Dec 2025 07:13:37 GMT Subject: RFR: Add support for AIX in build process [v8] In-Reply-To: References: Message-ID: > Summary of the issues: > > 1. There is no support for compiling AIX dynamic .a library and the tool was compiling .so files instead. > 2. There is no logic to support libclang.a. > 3. There is no support to load shared member of .a dynamic libraries of AIX. > > JBS Issue: [CODETOOLS-7904116](https://bugs.openjdk.org/browse/CODETOOLS-7904116) Suchismith Roy has updated the pull request incrementally with two additional commits since the last revision: - extra imports - read string ------------- Changes: - all: https://git.openjdk.org/jextract/pull/297/files - new: https://git.openjdk.org/jextract/pull/297/files/45b49ca7..c39a5b9b Webrevs: - full: https://webrevs.openjdk.org/?repo=jextract&pr=297&range=07 - incr: https://webrevs.openjdk.org/?repo=jextract&pr=297&range=06-07 Stats: 8 lines in 1 file changed: 0 ins; 2 del; 6 mod Patch: https://git.openjdk.org/jextract/pull/297.diff Fetch: git fetch https://git.openjdk.org/jextract.git pull/297/head:pull/297 PR: https://git.openjdk.org/jextract/pull/297 From sroy at openjdk.org Wed Dec 10 12:38:05 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Wed, 10 Dec 2025 12:38:05 GMT Subject: RFR: Add support for AIX in build process [v7] In-Reply-To: <1tAQMAn2y-HX0fYw22s_s38YPvSj75YPtXOMHPPuAAE=.7eada385-344d-4f30-8933-9feab54410f1@github.com> References: <1tAQMAn2y-HX0fYw22s_s38YPvSj75YPtXOMHPPuAAE=.7eada385-344d-4f30-8933-9feab54410f1@github.com> Message-ID: On Tue, 9 Dec 2025 18:32:02 GMT, Jorn Vernee wrote: >> Suchismith Roy has updated the pull request incrementally with four additional commits since the last revision: >> >> - extra lines >> - extra lines >> - extra lines >> - extra lines > > src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 98: > >> 96: } catch (Exception e) { >> 97: throw new IllegalStateException("Failed to read libclang.version", e); >> 98: } > > FWIW, `clangVersion` is definitely assigned after the try block, so a default value is not needed. Also, `Files::readString` makes this a little simpler: > Suggestion: > > String clangVersion; > try { > clangVersion = Files.readString(Path.of(javaHome + "/conf/jextract/libclang.version")); > } catch (Exception e) { > throw new IllegalStateException("Failed to read libclang.version", e); > } thanks @JornVernee incorporated it. ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2606497361 From jvernee at openjdk.org Wed Dec 10 13:30:12 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Wed, 10 Dec 2025 13:30:12 GMT Subject: RFR: Add support for AIX in build process [v8] In-Reply-To: References: Message-ID: On Wed, 10 Dec 2025 07:13:37 GMT, Suchismith Roy wrote: >> Summary of the issues: >> >> 1. There is no support for compiling AIX dynamic .a library and the tool was compiling .so files instead. >> 2. There is no logic to support libclang.a. >> 3. There is no support to load shared member of .a dynamic libraries of AIX. >> >> JBS Issue: [CODETOOLS-7904116](https://bugs.openjdk.org/browse/CODETOOLS-7904116) > > Suchismith Roy has updated the pull request incrementally with two additional commits since the last revision: > > - extra imports > - read string Looks good now, thanks ------------- Marked as reviewed by jvernee (Reviewer). PR Review: https://git.openjdk.org/jextract/pull/297#pullrequestreview-3562547706 From sroy at openjdk.org Wed Dec 10 14:10:33 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Wed, 10 Dec 2025 14:10:33 GMT Subject: RFR: Add support for AIX in build process [v8] In-Reply-To: References: Message-ID: On Wed, 10 Dec 2025 13:27:38 GMT, Jorn Vernee wrote: > Looks good now, thanks Is this good to integrate ? Is another review needed ? ------------- PR Comment: https://git.openjdk.org/jextract/pull/297#issuecomment-3637258244 From jvernee at openjdk.org Wed Dec 10 14:32:26 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Wed, 10 Dec 2025 14:32:26 GMT Subject: RFR: Add support for AIX in build process [v8] In-Reply-To: References: Message-ID: On Wed, 10 Dec 2025 14:07:54 GMT, Suchismith Roy wrote: > > Looks good now, thanks > > Is this good to integrate ? Is another review needed ? It's good to integrate now. Please go ahead. ------------- PR Comment: https://git.openjdk.org/jextract/pull/297#issuecomment-3637357373 From nbenalla at openjdk.org Wed Dec 10 16:44:44 2025 From: nbenalla at openjdk.org (Nizar Benalla) Date: Wed, 10 Dec 2025 16:44:44 GMT Subject: RFR: 7904120: Update jcheck configuration to allow more tags Message-ID: Please review this PR to allow the use of release tags such as `jextract-25+4` ------------- Commit messages: - permit more tags Changes: https://git.openjdk.org/jextract/pull/298/files Webrev: https://webrevs.openjdk.org/?repo=jextract&pr=298&range=00 Issue: https://bugs.openjdk.org/browse/CODETOOLS-7904120 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jextract/pull/298.diff Fetch: git fetch https://git.openjdk.org/jextract.git pull/298/head:pull/298 PR: https://git.openjdk.org/jextract/pull/298 From duke at openjdk.org Thu Dec 11 05:03:58 2025 From: duke at openjdk.org (duke) Date: Thu, 11 Dec 2025 05:03:58 GMT Subject: Withdrawn: 7904089: jextract cannot handle "void foo(int foo)" In-Reply-To: <5AZScqGIAOfygZlyXt3P90g7DLfNlsedz_2g7a6SEu8=.74cf5d14-023d-44ae-8ced-3d24272286c8@github.com> References: <5AZScqGIAOfygZlyXt3P90g7DLfNlsedz_2g7a6SEu8=.74cf5d14-023d-44ae-8ced-3d24272286c8@github.com> Message-ID: <3cMFvfVf-QBa47n1Sxw_G79JHSN-bKJpluf3TV8qUdI=.63450f8d-2f9b-4936-89db-883559202237@github.com> On Wed, 15 Oct 2025 11:33:58 GMT, Nizar Benalla wrote: > Please review this change to fix a name conflicts between functions and name parameters. > > TIA! This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jextract/pull/292 From duke at openjdk.org Thu Dec 11 07:29:59 2025 From: duke at openjdk.org (duke) Date: Thu, 11 Dec 2025 07:29:59 GMT Subject: RFR: Add support for AIX in build process [v8] In-Reply-To: References: Message-ID: On Wed, 10 Dec 2025 07:13:37 GMT, Suchismith Roy wrote: >> Summary of the issues: >> >> 1. There is no support for compiling AIX dynamic .a library and the tool was compiling .so files instead. >> 2. There is no logic to support libclang.a. >> 3. There is no support to load shared member of .a dynamic libraries of AIX. >> >> JBS Issue: [CODETOOLS-7904116](https://bugs.openjdk.org/browse/CODETOOLS-7904116) > > Suchismith Roy has updated the pull request incrementally with two additional commits since the last revision: > > - extra imports > - read string @suchismith1993 Your change (at version c39a5b9bd7d8670330d9b500a1b684a4822c3ded) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jextract/pull/297#issuecomment-3640606975 From mcimadamore at openjdk.org Thu Dec 11 09:57:36 2025 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Thu, 11 Dec 2025 09:57:36 GMT Subject: RFR: 7904120: Update jcheck configuration to allow more tags In-Reply-To: References: Message-ID: On Wed, 10 Dec 2025 16:36:26 GMT, Nizar Benalla wrote: > Please review this PR to allow the use of release tags such as `jextract-25+4` Marked as reviewed by mcimadamore (Reviewer). .jcheck/conf line 10: > 8: > 9: [repository] > 10: tags=jextract(-[123][0-9]\+[0-9]+) Are you baking in an assumption that build numbers can't be > 39 ? Any reason this shouldn't just be: `jextract(-[0-9]++[0-9]+)` (what you wrote is fine, and seems to cover the builds we emitted so far, I'm more trying to understand the rationale) ------------- PR Review: https://git.openjdk.org/jextract/pull/298#pullrequestreview-3566623681 PR Review Comment: https://git.openjdk.org/jextract/pull/298#discussion_r2609923463 From mcimadamore at openjdk.org Thu Dec 11 09:57:36 2025 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Thu, 11 Dec 2025 09:57:36 GMT Subject: RFR: 7904120: Update jcheck configuration to allow more tags In-Reply-To: References: Message-ID: On Thu, 11 Dec 2025 09:52:34 GMT, Maurizio Cimadamore wrote: >> Please review this PR to allow the use of release tags such as `jextract-25+4` > > .jcheck/conf line 10: > >> 8: >> 9: [repository] >> 10: tags=jextract(-[123][0-9]\+[0-9]+) > > Are you baking in an assumption that build numbers can't be > 39 ? Any reason this shouldn't just be: > > `jextract(-[0-9]++[0-9]+)` > > (what you wrote is fine, and seems to cover the builds we emitted so far, I'm more trying to understand the rationale) Comment sent too fast -- you are assuming the first number is a JDK version -- so it will have, presumably, 2 digits, and the first digit is likely 2-3 (but you added 1 probably to be backwards compatible as well -- as we also have jextract builds for JDK 19). All good, ------------- PR Review Comment: https://git.openjdk.org/jextract/pull/298#discussion_r2609931157 From sroy at openjdk.org Thu Dec 11 12:21:36 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Thu, 11 Dec 2025 12:21:36 GMT Subject: Integrated: Add support for AIX in build process In-Reply-To: References: Message-ID: On Thu, 20 Nov 2025 13:47:53 GMT, Suchismith Roy wrote: > Summary of the issues: > > 1. There is no support for compiling AIX dynamic .a library and the tool was compiling .so files instead. > 2. There is no logic to support libclang.a. > 3. There is no support to load shared member of .a dynamic libraries of AIX. > > JBS Issue: [CODETOOLS-7904116](https://bugs.openjdk.org/browse/CODETOOLS-7904116) This pull request has now been integrated. Changeset: e38e1c53 Author: Suchismith Roy Committer: Jorn Vernee URL: https://git.openjdk.org/jextract/commit/e38e1c53ab78d20a649906336703d1c96078e835 Stats: 63 lines in 3 files changed: 49 ins; 7 del; 7 mod Add support for AIX in build process Reviewed-by: jvernee ------------- PR: https://git.openjdk.org/jextract/pull/297 From erikj at openjdk.org Thu Dec 11 16:32:15 2025 From: erikj at openjdk.org (Erik Joelsson) Date: Thu, 11 Dec 2025 16:32:15 GMT Subject: RFR: 7904120: Update jcheck configuration to allow more tags In-Reply-To: References: Message-ID: On Wed, 10 Dec 2025 16:36:26 GMT, Nizar Benalla wrote: > Please review this PR to allow the use of release tags such as `jextract-25+4` Looks ok to me, but I'm curious why limit the major version digits to max 39. ------------- Marked as reviewed by erikj (Committer). PR Review: https://git.openjdk.org/jextract/pull/298#pullrequestreview-3568306902 From nbenalla at openjdk.org Fri Dec 12 13:36:34 2025 From: nbenalla at openjdk.org (Nizar Benalla) Date: Fri, 12 Dec 2025 13:36:34 GMT Subject: RFR: 7904120: Update jcheck configuration to allow more tags In-Reply-To: References: Message-ID: On Wed, 10 Dec 2025 16:36:26 GMT, Nizar Benalla wrote: > Please review this PR to allow the use of release tags such as `jextract-25+4` The number 39 is arbitrary, just an upper bound to avoid an unbounded regex. I wanted to cover a range of releases in the near future. Thanks for the reviews! ------------- PR Comment: https://git.openjdk.org/jextract/pull/298#issuecomment-3646507733 From duke at openjdk.org Fri Dec 12 13:36:35 2025 From: duke at openjdk.org (duke) Date: Fri, 12 Dec 2025 13:36:35 GMT Subject: RFR: 7904120: Update jcheck configuration to allow more tags In-Reply-To: References: Message-ID: <5zVWICw9fpHcS6wNCGJfaND29edvtJ8WWF4JSvSEFek=.e94e7a0d-d04a-45da-b771-18326418e7e9@github.com> On Wed, 10 Dec 2025 16:36:26 GMT, Nizar Benalla wrote: > Please review this PR to allow the use of release tags such as `jextract-25+4` @nizarbenalla Your change (at version e258c0f83b5bb5d47bf408caade913dac1fb0014) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jextract/pull/298#issuecomment-3646509208 From nbenalla at openjdk.org Fri Dec 12 14:44:56 2025 From: nbenalla at openjdk.org (Nizar Benalla) Date: Fri, 12 Dec 2025 14:44:56 GMT Subject: Integrated: 7904120: Update jcheck configuration to allow more tags In-Reply-To: References: Message-ID: <02XyX2SaLwahM1w9mcdN8GvNps8F1zLKnKYKuIk_pr4=.7845b9b6-d7ce-4723-bc1f-0a9edb6c761f@github.com> On Wed, 10 Dec 2025 16:36:26 GMT, Nizar Benalla wrote: > Please review this PR to allow the use of release tags such as `jextract-25+4` This pull request has now been integrated. Changeset: b96ad661 Author: Nizar Benalla Committer: Maurizio Cimadamore URL: https://git.openjdk.org/jextract/commit/b96ad6618a70ddbdf6b67cc3eb8342efc39c0692 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 7904120: Update jcheck configuration to allow more tags Reviewed-by: mcimadamore, erikj ------------- PR: https://git.openjdk.org/jextract/pull/298 From varadam at openjdk.org Fri Dec 12 15:27:56 2025 From: varadam at openjdk.org (Varada M) Date: Fri, 12 Dec 2025 15:27:56 GMT Subject: RFR: 7904115: Fix for AIX test case failures due to incorrect alignment for double and pointer [v4] In-Reply-To: References: Message-ID: > Total of 10 test failures observed on AIX: > jtreg/generator/nestedTypes/TestNestedTypesUnsupported.java > jtreg/generator/test8246400/LibTest8246400Test.java > jtreg/generator/test8258605/LibTest8258605Test.java > jtreg/generator/test8261511/Test8261511.java > jtreg/generator/testStruct/LibStructTest.java > testng/org/openjdk/jextract/test/toolprovider/ConstantsTest.java > testng/org/openjdk/jextract/test/toolprovider/IncompleteArrayTest.java > testng/org/openjdk/jextract/test/toolprovider/Test8240811.java > testng/org/openjdk/jextract/test/toolprovider/TestClassGeneration.java > testng/org/openjdk/jextract/test/toolprovider/nestedAnonOffset/TestNestedAnonOffset.java > > This PR fixes AIX specific layout generation issues related to incorrect alignment double and pointer types. > 1. Structs containing double fields fail with: > i. Unsupported layout: 4%D8 > ii. Invalid alignment constraint for member layout > double in AIX structs has size 8 but alignment 4 (except as first field). AIX specific handling for C_DOUBLE computes the correct alignment. > > 2. Clang was detected as 32-bit due to missing -m64 during macro extraction, causing inconsistent macros. This caused jextract to interpret pointer constants incorrectly, leading to failures like: > expected [-1] but found [4294967295] > > 3. TestNestedAnonOffset.java test failed on AIX because it also expects more padding similar to platforms like windows and linux > > > After the patch jtreg tests passes successfully. > > JBS: [CODETOOLS-7904115](https://bugs.openjdk.org/browse/CODETOOLS-7904115) Varada M has updated the pull request incrementally with one additional commit since the last revision: added field alignment and natural alignment argument ------------- Changes: - all: https://git.openjdk.org/jextract/pull/296/files - new: https://git.openjdk.org/jextract/pull/296/files/f43b66fb..56d5b88f Webrevs: - full: https://webrevs.openjdk.org/?repo=jextract&pr=296&range=03 - incr: https://webrevs.openjdk.org/?repo=jextract&pr=296&range=02-03 Stats: 52 lines in 6 files changed: 23 ins; 4 del; 25 mod Patch: https://git.openjdk.org/jextract/pull/296.diff Fetch: git fetch https://git.openjdk.org/jextract.git pull/296/head:pull/296 PR: https://git.openjdk.org/jextract/pull/296 From varadam at openjdk.org Fri Dec 12 15:41:16 2025 From: varadam at openjdk.org (Varada M) Date: Fri, 12 Dec 2025 15:41:16 GMT Subject: RFR: 7904115: Fix for AIX test case failures due to incorrect alignment for double and pointer [v4] In-Reply-To: References: Message-ID: On Fri, 12 Dec 2025 15:27:56 GMT, Varada M wrote: >> Total of 10 test failures observed on AIX: >> jtreg/generator/nestedTypes/TestNestedTypesUnsupported.java >> jtreg/generator/test8246400/LibTest8246400Test.java >> jtreg/generator/test8258605/LibTest8258605Test.java >> jtreg/generator/test8261511/Test8261511.java >> jtreg/generator/testStruct/LibStructTest.java >> testng/org/openjdk/jextract/test/toolprovider/ConstantsTest.java >> testng/org/openjdk/jextract/test/toolprovider/IncompleteArrayTest.java >> testng/org/openjdk/jextract/test/toolprovider/Test8240811.java >> testng/org/openjdk/jextract/test/toolprovider/TestClassGeneration.java >> testng/org/openjdk/jextract/test/toolprovider/nestedAnonOffset/TestNestedAnonOffset.java >> >> This PR fixes AIX specific layout generation issues related to incorrect alignment double and pointer types. >> 1. Structs containing double fields fail with: >> i. Unsupported layout: 4%D8 >> ii. Invalid alignment constraint for member layout >> double in AIX structs has size 8 but alignment 4 (except as first field). AIX specific handling for C_DOUBLE computes the correct alignment. >> >> 2. Clang was detected as 32-bit due to missing -m64 during macro extraction, causing inconsistent macros. This caused jextract to interpret pointer constants incorrectly, leading to failures like: >> expected [-1] but found [4294967295] >> >> 3. TestNestedAnonOffset.java test failed on AIX because it also expects more padding similar to platforms like windows and linux >> >> >> After the patch jtreg tests passes successfully. >> >> JBS: [CODETOOLS-7904115](https://bugs.openjdk.org/browse/CODETOOLS-7904115) > > Varada M has updated the pull request incrementally with one additional commit since the last revision: > > added field alignment and natural alignment argument The test failure "Invalid alignment constraint for member layout: D8(d)" on AIX occurs because the default alignment mode is power where the subsequent double fields is 4 byte aligned, but the generated double is D8, 8 byte aligned. Using the natural alignment mode resolves the test failures ------------- PR Comment: https://git.openjdk.org/jextract/pull/296#issuecomment-3647059054 From jvernee at openjdk.org Fri Dec 12 17:06:43 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Fri, 12 Dec 2025 17:06:43 GMT Subject: RFR: 7904115: Fix for AIX test case failures due to incorrect alignment for double and pointer [v4] In-Reply-To: References: Message-ID: On Fri, 12 Dec 2025 15:27:56 GMT, Varada M wrote: >> Total of 10 test failures observed on AIX: >> jtreg/generator/nestedTypes/TestNestedTypesUnsupported.java >> jtreg/generator/test8246400/LibTest8246400Test.java >> jtreg/generator/test8258605/LibTest8258605Test.java >> jtreg/generator/test8261511/Test8261511.java >> jtreg/generator/testStruct/LibStructTest.java >> testng/org/openjdk/jextract/test/toolprovider/ConstantsTest.java >> testng/org/openjdk/jextract/test/toolprovider/IncompleteArrayTest.java >> testng/org/openjdk/jextract/test/toolprovider/Test8240811.java >> testng/org/openjdk/jextract/test/toolprovider/TestClassGeneration.java >> testng/org/openjdk/jextract/test/toolprovider/nestedAnonOffset/TestNestedAnonOffset.java >> >> This PR fixes AIX specific layout generation issues related to incorrect alignment double and pointer types. >> 1. Structs containing double fields fail with: >> i. Unsupported layout: 4%D8 >> ii. Invalid alignment constraint for member layout >> double in AIX structs has size 8 but alignment 4 (except as first field). AIX specific handling for C_DOUBLE computes the correct alignment. >> >> 2. Clang was detected as 32-bit due to missing -m64 during macro extraction, causing inconsistent macros. This caused jextract to interpret pointer constants incorrectly, leading to failures like: >> expected [-1] but found [4294967295] >> >> 3. TestNestedAnonOffset.java test failed on AIX because it also expects more padding similar to platforms like windows and linux >> >> >> After the patch jtreg tests passes successfully. >> >> JBS: [CODETOOLS-7904115](https://bugs.openjdk.org/browse/CODETOOLS-7904115) > > Varada M has updated the pull request incrementally with one additional commit since the last revision: > > added field alignment and natural alignment argument Ok, the current approach means that jextract would only work when the C code is using natural alignment. If you're happy with that, I can accept the patch. But, all the of the changes I suggested are not needed in that case. I really think you should try to adjust `expectedAlign` in StructBuilder to get the right alignment (based on Maurizio's comment here: https://github.com/openjdk/jextract/pull/296#issuecomment-3564203711) ------------- PR Comment: https://git.openjdk.org/jextract/pull/296#issuecomment-3647392590