Integrated: 8330539: Use #include <alloca.h> instead of -Dalloca'(size)'=__builtin_alloca'(size)' for AIX
Joachim Kern
jkern at openjdk.org
Fri May 3 08:34:57 UTC 2024
On Thu, 2 May 2024 09:54:14 GMT, Joachim Kern <jkern at openjdk.org> wrote:
> We need to find a better way to handle alloca on AIX.
>
> See the discussion in the PR for https://bugs.openjdk.org/browse/JDK-8329257, e.g. https://github.com/openjdk/jdk/pull/18536#discussion_r1568650313 in which three alternatives are suggested. Quoting:
>
> Let me summarize the choices we have and ask for your vote.
> Magnus dislikes the -Dalloca'(size)'=__builtin_alloca'(size)' in flags-cflags.m4 I introduced to get rid of
>
> #if defined(_AIX)
> #include <alloca.h>
> #endif
>
> in globalDefinitions_gcc.hpp.
>
> We have four possible solutions
>
> 1. Reintroduce
>
> #if defined(_AIX)
> #include <alloca.h>
> #endif
>
> in globalDefinitions_gcc.hpp.
>
> 2. Unconditionally introduce only #include <alloca.h> in globalDefinitions_gcc.hpp. This should work for all platforms using this header including the unofficial Windows/gcc Port, although only AIX needs it.
>
> 3. Add
>
> #if defined(_AIX)
> #include <alloca.h>
> #endif
>
> to the sources using alloca(). These are
> /hotspot/share/runtime/os.cpp
> /hotspot/share/runtime/javaThread.cpp
> /hotspot/share/utilities/vmError.cpp
> Here we need the AIX condition, because otherwise the classic Windows Build (NTAMD64) fails.
>
> 4. Replace -Dalloca'(size)'=__builtin_alloca'(size)' in flags-cflags.m4 by -U__STRICT_ANSI__ at the same place. Explanation can also found in https://github.com/openjdk/jdk/pull/18536#discussion_r1583360569 and following.
>
> I will implement the solution with the most likes and having no dislike.
This pull request has now been integrated.
Changeset: a10845b5
Author: Joachim Kern <jkern at openjdk.org>
Committer: Martin Doerr <mdoerr at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/a10845b553fc6fe7e06a0f37ce73fe5f704dc7c4
Stats: 2 lines in 2 files changed: 1 ins; 0 del; 1 mod
8330539: Use #include <alloca.h> instead of -Dalloca'(size)'=__builtin_alloca'(size)' for AIX
Reviewed-by: jwaters, mdoerr, kbarrett, ihse
-------------
PR: https://git.openjdk.org/jdk/pull/19053
More information about the build-dev
mailing list