Skip to content

8348348: Remove unnecessary #ifdef STATIC_BUILD around DEF_STATIC_JNI_OnLoad from zip_util.c#23247

Closed
jianglizhou wants to merge 1 commit intoopenjdk:masterfrom
jianglizhou:JDK-8348348
Closed

8348348: Remove unnecessary #ifdef STATIC_BUILD around DEF_STATIC_JNI_OnLoad from zip_util.c#23247
jianglizhou wants to merge 1 commit intoopenjdk:masterfrom
jianglizhou:JDK-8348348

Conversation

@jianglizhou
Copy link
Contributor

@jianglizhou jianglizhou commented Jan 23, 2025

Please review this trivial cleanup that removes the #ifdef STATIC_BUILD around DEF_STATIC_JNI_OnLoad from zip_util.c. Thanks.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8348348: Remove unnecessary #ifdef STATIC_BUILD around DEF_STATIC_JNI_OnLoad from zip_util.c (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23247/head:pull/23247
$ git checkout pull/23247

Update a local copy of the PR:
$ git checkout pull/23247
$ git pull https://git.openjdk.org/jdk.git pull/23247/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23247

View PR using the GUI difftool:
$ git pr show -t 23247

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23247.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 23, 2025

👋 Welcome back jiangli! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 23, 2025

@jianglizhou This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8348348: Remove unnecessary #ifdef STATIC_BUILD around DEF_STATIC_JNI_OnLoad from zip_util.c

Reviewed-by: sgehwolf

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 76 new commits pushed to the master branch:

  • fb066ca: 8347272: [ubsan] JvmLauncher.cpp:262:52: runtime error: applying non-zero offset 40 to null pointer
  • 5fec999: 8339668: Parallel: Adopt PartialArrayState to consolidate marking stack in Full GC
  • 2bef5b4: 8348323: Corrupted timezone string in JVM crash log
  • 3a8680e: 8347058: When automatically translating the page to pt-br, all CSS styling disappears
  • a4942a2: 8348286: [AIX] clang 17 introduces new warning Wtentative-Definitions which produces Build errors
  • 558255a: 8328919: Add BodyHandlers / BodySubscribers methods to handle excessive server input
  • 1f74caa: 8348401: [IR Framework] PrintTimes should not require verbose
  • f71541c: 8344976: Remove the jmx.invoke.getters compatibility property
  • 2537a05: 8348384: RISC-V: Disable auto-enable Vector on buggy kernels
  • 46f48e4: 8348515: Add docs for -XX:AOT* options in java man pages
  • ... and 66 more: https://git.openjdk.org/jdk/compare/8cf0735839727300e446828f4f4a8ef6354a8c7a...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 23, 2025
@openjdk
Copy link

openjdk bot commented Jan 23, 2025

@jianglizhou The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Jan 23, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 23, 2025

Webrevs

@jianglizhou
Copy link
Contributor Author

I would appreciate if anyone can help take a look of this, thanks.

Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. DEF_STATIC_JNI_OnLoad will do the right thing based on the STATIC_BUILD define here:

#ifdef STATIC_BUILD
/* Macros for handling declaration of static/dynamic
* JNI library Load/Unload functions
*
* Use DEF_JNI_On{Un}Load when you want a static and non-static entry points.
* Use DEF_STATIC_JNI_On{Un}Load when you only want a static one.
*
* LIBRARY_NAME must be set to the name of the library
*/
/* These three macros are needed to get proper concatenation of
* the LIBRARY_NAME
*
* NOTE: LIBRARY_NAME must be set for static builds.
*/
#define ADD_LIB_NAME3(name, lib) name ## lib
#define ADD_LIB_NAME2(name, lib) ADD_LIB_NAME3(name, lib)
#define ADD_LIB_NAME(entry) ADD_LIB_NAME2(entry, LIBRARY_NAME)
#define DEF_JNI_OnLoad \
ADD_LIB_NAME(JNI_OnLoad_)(JavaVM *vm, void *reserved) \
{ \
jint JNICALL ADD_LIB_NAME(JNI_OnLoad_dynamic_)(JavaVM *vm, void *reserved); \
ADD_LIB_NAME(JNI_OnLoad_dynamic_)(vm, reserved); \
return JNI_VERSION_1_8; \
} \
jint JNICALL ADD_LIB_NAME(JNI_OnLoad_dynamic_)
#define DEF_STATIC_JNI_OnLoad \
JNIEXPORT jint JNICALL ADD_LIB_NAME(JNI_OnLoad_)(JavaVM *vm, void *reserved) { \
return JNI_VERSION_1_8; \
}
#define DEF_JNI_OnUnload \
ADD_LIB_NAME(JNI_OnUnload_)(JavaVM *vm, void *reserved) \
{ \
void JNICALL ADD_LIB_NAME(JNI_OnUnload_dynamic_)(JavaVM *vm, void *reserved); \
ADD_LIB_NAME(JNI_OnUnload_dynamic_)(vm, reserved); \
} \
void JNICALL ADD_LIB_NAME(JNI_OnUnload_dynamic_)
#define DEF_STATIC_JNI_OnUnload \
ADD_LIB_NAME(JNI_OnUnload_)
#else
#define DEF_JNI_OnLoad JNI_OnLoad
#define DEF_STATIC_JNI_OnLoad
#define DEF_JNI_OnUnload JNI_OnUnload
#define DEF_STATIC_JNI_OnUnload
#endif

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 28, 2025
@jianglizhou
Copy link
Contributor Author

Thanks for the review, @jerboaa!

@jianglizhou
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 28, 2025

Going to push as commit 8103256.
Since your change was applied there have been 76 commits pushed to the master branch:

  • fb066ca: 8347272: [ubsan] JvmLauncher.cpp:262:52: runtime error: applying non-zero offset 40 to null pointer
  • 5fec999: 8339668: Parallel: Adopt PartialArrayState to consolidate marking stack in Full GC
  • 2bef5b4: 8348323: Corrupted timezone string in JVM crash log
  • 3a8680e: 8347058: When automatically translating the page to pt-br, all CSS styling disappears
  • a4942a2: 8348286: [AIX] clang 17 introduces new warning Wtentative-Definitions which produces Build errors
  • 558255a: 8328919: Add BodyHandlers / BodySubscribers methods to handle excessive server input
  • 1f74caa: 8348401: [IR Framework] PrintTimes should not require verbose
  • f71541c: 8344976: Remove the jmx.invoke.getters compatibility property
  • 2537a05: 8348384: RISC-V: Disable auto-enable Vector on buggy kernels
  • 46f48e4: 8348515: Add docs for -XX:AOT* options in java man pages
  • ... and 66 more: https://git.openjdk.org/jdk/compare/8cf0735839727300e446828f4f4a8ef6354a8c7a...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 28, 2025
@openjdk openjdk bot closed this Jan 28, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 28, 2025
@openjdk
Copy link

openjdk bot commented Jan 28, 2025

@jianglizhou Pushed as commit 8103256.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants