Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v7]

2023-11-22 Thread suchismith1993
On Wed, 22 Nov 2023 06:50:07 GMT, Jorn Vernee wrote: >> suchismith1993 has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Fix Typos >> - Remove unnecessary includes > > Note that on Windows we also have a lookup mechanism on the Java sid

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v8]

2023-11-22 Thread suchismith1993
> The math library in AIX specifically, is a static archive. Doing a -lm wont > suffice, because when the symbols are looked up using dlsym or accessing > native code through Java, it will lead to failures. > Hence we had to come up with a list of symbols to allow math library symbols > to be ac

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v7]

2023-11-22 Thread Amit Kumar
On Tue, 21 Nov 2023 19:30:30 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v7]

2023-11-21 Thread Jorn Vernee
On Tue, 21 Nov 2023 19:30:30 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v7]

2023-11-21 Thread suchismith1993
On Tue, 21 Nov 2023 19:30:30 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v7]

2023-11-21 Thread Jorn Vernee
On Tue, 21 Nov 2023 19:30:30 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v7]

2023-11-21 Thread David Holmes
On Tue, 21 Nov 2023 19:30:30 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v7]

2023-11-21 Thread Magnus Ihse Bursie
On Tue, 21 Nov 2023 19:30:30 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v7]

2023-11-21 Thread suchismith1993
> The math library in AIX specifically, is a static archive. Doing a -lm wont > suffice, because when the symbols are looked up using dlsym or accessing > native code through Java, it will lead to failures. > Hence we had to come up with a list of symbols to allow math library symbols > to be ac

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v7]

2023-11-21 Thread Martin Doerr
On Tue, 21 Nov 2023 19:30:30 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v6]

2023-11-21 Thread Martin Doerr
On Tue, 21 Nov 2023 17:54:08 GMT, suchismith1993 wrote: >> src/java.base/aix/native/libsyslookup/syslookup.c line 30: >> >>> 28: #include >>> 29: #include >>> 30: #include >> >> Are string.h and stdlib.h needed? I can't see them in the comments below. > > string.h is needed for strlen. Let m

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v6]

2023-11-21 Thread Martin Doerr
On Tue, 21 Nov 2023 17:49:43 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v6]

2023-11-21 Thread suchismith1993
On Tue, 21 Nov 2023 17:50:04 GMT, Martin Doerr wrote: >> suchismith1993 has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Comments >> - Change comments > > src/java.base/aix/native/libsyslookup/syslookup.c line 30: > >> 28: #include >

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v6]

2023-11-21 Thread suchismith1993
> The math library in AIX specifically, is a static archive. Doing a -lm wont > suffice, because when the symbols are looked up using dlsym or accessing > native code through Java, it will lead to failures. > Hence we had to come up with a list of symbols to allow math library symbols > to be ac

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v5]

2023-11-21 Thread Martin Doerr
On Tue, 21 Nov 2023 13:01:50 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v5]

2023-11-21 Thread Magnus Ihse Bursie
On Tue, 21 Nov 2023 13:01:50 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v5]

2023-11-21 Thread Martin Doerr
On Tue, 21 Nov 2023 13:01:50 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v5]

2023-11-21 Thread suchismith1993
> The math library in AIX specifically, is a static archive. Doing a -lm wont > suffice, because when the symbols are looked up using dlsym or accessing > native code through Java, it will lead to failures. > Hence we had to come up with a list of symbols to allow math library symbols > to be ac

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v4]

2023-11-21 Thread suchismith1993
> The math library in AIX specifically, is a static archive. Doing a -lm wont > suffice, because when the symbols are looked up using dlsym or accessing > native code through Java, it will lead to failures. > Hence we had to come up with a list of symbols to allow math library symbols > to be ac

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v3]

2023-11-21 Thread Martin Doerr
On Tue, 21 Nov 2023 11:52:23 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v3]

2023-11-21 Thread suchismith1993
> The math library in AIX specifically, is a static archive. Doing a -lm wont > suffice, because when the symbols are looked up using dlsym or accessing > native code through Java, it will lead to failures. > Hence we had to come up with a list of symbols to allow math library symbols > to be ac

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v2]

2023-11-21 Thread Martin Doerr
On Tue, 21 Nov 2023 11:21:40 GMT, suchismith1993 wrote: >> The math library in AIX specifically, is a static archive. Doing a -lm wont >> suffice, because when the symbols are looked up using dlsym or accessing >> native code through Java, it will lead to failures. >> Hence we had to come up wi

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols [v2]

2023-11-21 Thread suchismith1993
> The math library in AIX specifically, is a static archive. Doing a -lm wont > suffice, because when the symbols are looked up using dlsym or accessing > native code through Java, it will lead to failures. > Hence we had to come up with a list of symbols to allow math library symbols > to be ac

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-18 Thread Jorn Vernee
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > The math library in AIX specifically, is a static archive. Doing a -lm wont > suffice, because when the symbols are looked up using dlsym or accessing > native code through Java, it will lead to failures. > Hence we had to come up with a

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-18 Thread suchismith1993
On Fri, 17 Nov 2023 15:39:49 GMT, Magnus Ihse Bursie wrote: > The syslookup.c solution for Windows looks interesting. While it is still a > hard-coded list, at least you will get compile time errors if the include > file changes to mismatch with the symbols... I don't think AIX has a way to do

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-17 Thread Magnus Ihse Bursie
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > The math library in AIX specifically, is a static archive. Doing a -lm wont > suffice, because when the symbols are looked up using dlsym or accessing > native code through Java, it will lead to failures. > Hence we had to come up with a

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-17 Thread suchismith1993
On Fri, 17 Nov 2023 13:02:22 GMT, Martin Doerr wrote: > > And I still don't understand if this is the list of symbols that are > > required by our tests, or the complete list of symbols that FFI > > `defaultLookup` returns to user applications. If it is the latter, then > > this is sort-of oka

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-17 Thread Jorn Vernee
On Fri, 17 Nov 2023 13:02:22 GMT, Martin Doerr wrote: > My understanding is that a lot of symbols can be found out of the box because > they are in dynamically linked libraries. Only some libraries are special on > AIX which don't support dynamic linking and we need this workaround for them. T

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-17 Thread Martin Doerr
On Fri, 17 Nov 2023 12:45:32 GMT, suchismith1993 wrote: > And I still don't understand if this is the list of symbols that are required > by our tests, or the complete list of symbols that FFI `defaultLookup` > returns to user applications. If it is the latter, then this is sort-of okay > as a

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-17 Thread suchismith1993
On Fri, 17 Nov 2023 12:06:48 GMT, Martin Doerr wrote: >>> > There is not generic way of generating this. It needs a manual >>> > intervention and symbols are to be added on a need basis in future. Looks >>> > like a list to be maintained. I had tried adding comments to explain the >>> > list,

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-17 Thread Magnus Ihse Bursie
On Fri, 17 Nov 2023 12:06:48 GMT, Martin Doerr wrote: >>> > There is not generic way of generating this. It needs a manual >>> > intervention and symbols are to be added on a need basis in future. Looks >>> > like a list to be maintained. I had tried adding comments to explain the >>> > list,

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-17 Thread Magnus Ihse Bursie
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) make/data/hotspot-symbols/symbols-aix-foreign line 1: > 1: Maybe delete the two leading empty

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-17 Thread Martin Doerr
On Mon, 13 Nov 2023 11:47:52 GMT, suchismith1993 wrote: >>> There is not generic way of generating this. It needs a manual intervention >>> and symbols are to be added on a need basis in future. Looks like a list to >>> be maintained. I had tried adding comments to explain the list, but that >

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-14 Thread Magnus Ihse Bursie
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) It does beg the question though: Why is AIX not using dynamic loading of the standard library?

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-14 Thread Magnus Ihse Bursie
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) Okay, I checked the spec for `nativeLinker()`. * @implNote The libraries exposed by the {@

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-14 Thread Magnus Ihse Bursie
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) I've done another pass of reading through all comments and background. I think we're not even ne

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-13 Thread David Holmes
On Mon, 13 Nov 2023 07:46:37 GMT, Jorn Vernee wrote: >>> For some context: `java.lang.foreign.Linker.nativeLinker().defaultLookup()` >>> returns a `SymbolLookup` that can be used to find symbols from the standard >>> library. >>> >>> We use a shim library that re-exports symbols from the stand

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-13 Thread suchismith1993
On Mon, 13 Nov 2023 07:41:11 GMT, Alan Bateman wrote: > > There is not generic way of generating this. It needs a manual intervention > > and symbols are to be added on a need basis in future. Looks like a list to > > be maintained. I had tried adding comments to explain the list, but that > >

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-12 Thread Jorn Vernee
On Fri, 10 Nov 2023 07:56:46 GMT, suchismith1993 wrote: > > That said, I think we should limit the exported symbols to only those found > > in the standard C library header files: > > https://en.cppreference.com/w/c/header > > Currently the symbols are restricted to some parts of libc and the

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-12 Thread Alan Bateman
On Fri, 10 Nov 2023 16:30:35 GMT, suchismith1993 wrote: > There is not generic way of generating this. It needs a manual intervention > and symbols are to be added on a need basis in future. Looks like a list to > be maintained. I had tried adding comments to explain the list, but that > cause

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-12 Thread Jorn Vernee
On Mon, 13 Nov 2023 02:32:48 GMT, David Holmes wrote: > I cannot decide if this is an AIX issue for not using dynamic libraries; a > FFI issue for assuming dynamic libraries; or a test issue. Won't this be a > general problem for any function you try to access via FFI that is statically > link

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-12 Thread David Holmes
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) I cannot decide if this is an AIX issue for not using dynamic libraries; a FFI issue for assumin

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-10 Thread Magnus Ihse Bursie
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) Not even using `nm` on the libraries in question? The file seem to be consumed by the compiler,

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-10 Thread suchismith1993
On Fri, 10 Nov 2023 15:48:59 GMT, Magnus Ihse Bursie wrote: > > Which directory do you suggest to put the exports list in ? Do we create a > > new directory or use any existing directory. > > My initial thinking is like Erik's, that this list should be dynamically > generated at build-time. I

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-10 Thread Magnus Ihse Bursie
On Fri, 10 Nov 2023 07:54:40 GMT, suchismith1993 wrote: > Which directory do you suggest to put the exports list in ? Do we create a > new directory or use any existing directory. My initial thinking is like Erik's, that this list should be dynamically generated at build-time. I am pretty sure

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-10 Thread suchismith1993
On Thu, 9 Nov 2023 17:46:20 GMT, Erik Joelsson wrote: > For some context: `java.lang.foreign.Linker.nativeLinker().defaultLookup()` > returns a `SymbolLookup` that can be used to find symbols from the standard > library. > > We use a shim library that re-exports symbols from the standard libra

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-10 Thread suchismith1993
On Wed, 8 Nov 2023 21:11:32 GMT, Magnus Ihse Bursie wrote: > First and foremost, the `make/data/hotspot-symbols` directory is, as the name > says, for hotspot symbols. These are not hotspot symbols. If you really do > need the file, then it needs to reside in a proper location. > > Secondly: d

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-09 Thread Erik Joelsson
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) > Problem: There is syslookup file which expects the required symbols to be > exported using the

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-09 Thread Jorn Vernee
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) For some context: `java.lang.foreign.Linker.nativeLinker().defaultLookup()` returns a `SymbolLoo

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-08 Thread suchismith1993
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) Problem: There is syslookup file which expects the required symbols to be exported using the co

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-08 Thread David Holmes
On Wed, 8 Nov 2023 21:14:41 GMT, Magnus Ihse Bursie wrote: > Also, please don't ever force push once you have published a PR. Now it makes > Martin's comment just dangling in the air. @magicus I think the force-push happened whilst the PR was still in draft (skara bot did not complain), which

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-08 Thread David Holmes
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) I agree with Magnus that we need to understand the problem first, and then review the solution.

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-08 Thread Magnus Ihse Bursie
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) Also, please don't ever force push once you have published a PR. Now it makes Martin's comment j

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-08 Thread Magnus Ihse Bursie
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) First and foremost, the `make/data/hotspot-symbols` directory is, as the name says, for hotspot

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-08 Thread Magnus Ihse Bursie
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) No, no... This is bad on several accounts. - PR Comment: https://git.openjdk.org/jd

Re: RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

2023-11-08 Thread Martin Doerr
On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 wrote: > 1. Adding required compiler flags. > 2. Adding required symbols. > > JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799) Changes requested by mdoerr (Reviewer). LGTM. You may want to replace the Copyright header of th