RFR: JDK-8308288: Fix xlc17 clang warnings and build errors in hotspot

Matthias Baesken mbaesken at openjdk.org
Tue Jun 6 10:38:53 UTC 2023


On Fri, 2 Jun 2023 11:28:45 GMT, JoKern65 <duke at openjdk.org> wrote:

> This pr is a split off from JDK-8308288 : Fix xlc17 clang warnings in shared code https://github.com/openjdk/jdk/pull/14146
> It handles the part in hotspot.
> 
> It handles the error introduced by a redefine of malloc in stdlib.h resulting in the following build error:
> 
> /data/d042520/pr/jdk/src/hotspot/share/runtime/os.cpp:616:5: error: no member named '_vec_malloc' in 'LogTag'; did you mean 'vec_malloc'?
>     log_warning(malloc, free)("ptr caught: " PTR_FORMAT, p2i(ptr));
>     ^~~~~~~~~~~~~~~~~~~~~~~~~
> /data/d042520/pr/jdk/src/hotspot/share/logging/log.hpp:46:28: note: expanded from macro 'log_warning'
> #define log_warning(...) (!log_is_enabled(Warning, __VA_ARGS__)) ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Warning>
>                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /data/d042520/pr/jdk/src/hotspot/share/logging/log.hpp:68:45: note: expanded from macro 'log_is_enabled'
> #define log_is_enabled(level, ...) (LogImpl<LOG_TAGS(__VA_ARGS__)>::is_level(LogLevel::level))
>                                             ^~~~~~~~~~~~~~~~~~~~~
> /data/d042520/pr/jdk/src/hotspot/share/logging/logTag.hpp:221:38: note: expanded from macro 'LOG_TAGS'
> #define LOG_TAGS(...) EXPAND_VARARGS(LOG_TAGS_EXPANDED(__VA_ARGS__, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG))
>                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /data/d042520/pr/jdk/src/hotspot/share/logging/logTag.hpp:217:57: note: expanded from macro 'LOG_TAGS_EXPANDED'
> #define LOG_TAGS_EXPANDED(T0, T1, T2, T3, T4, T5, ...)  PREFIX_LOG_TAG(T0), PREFIX_LOG_TAG(T1), PREFIX_LOG_TAG(T2), \
>                                                         ^~~~~~~~~~~~~~~~~~
>    ... (rest of output omitted)
> 
> 
> Additionally it solves the need for an #include <alloca.h> on AIX for any usage of the alloca function, by adding the include to globalDefinitions_xlc.hpp

The malloc change does not look very nice, but I think for now we can use that on AIX with xlc17.

-------------

Marked as reviewed by mbaesken (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14283#pullrequestreview-1464865277


More information about the hotspot-dev mailing list