RFR: 8326433: Make libjdwp and libjava closeDescriptors() as static function

Jiangli Zhou jiangli at openjdk.org
Mon Feb 26 22:17:44 UTC 2024


On Mon, 26 Feb 2024 20:40:52 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> Please help review this trivial fix for resolving `ld: error: duplicate symbol: closeDescriptors` when static linking with both libjdwp and libjava, thanks.
>
> src/java.base/unix/native/libjava/childproc.h line 134:
> 
>> 132: int closeSafely(int fd);
>> 133: int isAsciiDigit(char c);
>> 134: int closeDescriptors(void);
> 
> It seems that most of the APIs in this file should be static. I don't think you should selectively deal with just one of them because of the conflict. Since this ends up being a more involved change, and is in a different component than the jdwp change, it should probably have a separate PR.

@plummercj thanks for looking into this! Sounds good to make the additional local functions static in these files. Perhaps we can use two different FRs. I'll make the current one to handle the ones in src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18013#discussion_r1503379848


More information about the serviceability-dev mailing list