JDK-8320131 : Zero build fails on macOS after JDK-8254693
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.foreign
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2023-11-15
  • Updated: 2023-11-27
  • Resolved: 2023-11-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22 masterFixed
Related Reports
Relates :  
Description
=================
configure summary:

./configure --disable-precompiled-headers --with-debug-level=release --with-jvm-variants=zero

Configuration summary:
* Name:           ~/build-release
* Debug level:    release
* HS debug level: product
* JVM variants:   zero
* JVM features:   zero: 'cds dtrace epsilongc g1gc jni-check jvmti management parallelgc serialgc services shenandoahgc vm-structs zero' 
* OpenJDK target: OS: macosx, CPU architecture: aarch64, address length: 64
* Version string: 22-internal-git-12fce4b71 (22-internal)
* Source date:    1699999459 (2023-11-14T22:04:19Z)


=================
error msg:

=== Output from failing command(s) repeated here ===
* For target support_native_java.base_libfallbackLinker_fallbackLinker.o:
~/jdk_src/src/java.base/share/native/libfallbackLinker/fallbackLinker.c:31:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^~~~~~~~~~
1 error generated.

* All command lines available in ~/build-release/make-support/failure-logs.
=== End of repeated output ===
Comments
Changeset: b3616c9a Author: Hao Sun <haosun@openjdk.org> Date: 2023-11-22 05:32:57 +0000 URL: https://git.openjdk.org/jdk/commit/b3616c9ac09a29824441dea4588ce53fa443067d
22-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16775 Date: 2023-11-22 02:06:29 +0000
22-11-2023

Yes, that should be stdlib.h, which is the standard library header that defines malloc: https://en.cppreference.com/w/c/memory/malloc
15-11-2023

Seems that we should use "#include <stdlib.h>" instead. See https://github.com/RIOT-OS/RIOT/issues/2361
15-11-2023