RFR: 8311606: Change read_icc_profile() to static function in java.desktop/share/native/libjavajpeg/imageioJPEG.c [v3]
Jiangli Zhou
jiangli at openjdk.org
Tue Jul 11 00:05:14 UTC 2023
On Mon, 10 Jul 2023 21:26:21 GMT, Phil Race <prr at openjdk.org> wrote:
>> Jiangli Zhou has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>>
>> - Merge branch 'master' into JDK-8311606
>> - Merge branch 'master' into JDK-8311606
>> - JDK-8311606: Change read_icc_profile() to static function in java.desktop/share/native/libjavajpeg/imageioJPEG.c
>
> I'm reading the bug report and I want to understand this better.
>
> Why is this function in particular a problem ? What is special about it vs many others ?
>
> You wrote "when statically linking with JDK."
>
> Which would mean statically linking this code (in the JDK) with another JDK ? What exactly is this scenario.
>
> And you say 'potential problem'. Have you seen an 'actual problem' ? You hint at 'a certain jpeg library'.
@prrace thanks for looking into this issue.
> I'm reading the bug report and I want to understand this better.
>
> Why is this function in particular a problem ? What is special about it vs many others ?
>
> You wrote "when statically linking with JDK."
>
> Which would mean statically linking this code (in the JDK) with another JDK ? What exactly is this scenario.
The linking failure due to duplicate `read_icc_profile` symbol occur when statically linking the Java launcher executable with JDK `libjavajpeg.a` and user library code together. Only one version of the JDK/hotspot static libraries are linked with. No multiple JDK are linked together.
>
> And you say 'potential problem'. Have you seen an 'actual problem' ? You hint at 'a certain jpeg library'.
I found a public reference to the code that I was referring to:
https://github.com/mm2/Little-CMS/blob/master/utils/jpgicc/iccjpeg.c#L165
When testing JDK static linking capability, we ran into the linking failure with a test case:
ld: error: duplicate symbol: read_icc_profile
>>> defined at imageioJPEG.c:1295 (/tmp/jdkbuild/srcs/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c:1295)
>>> libjavajpeg_relocatable.o:(read_icc_profile) in archive third_party/java/jdk/jdk11-k8/lib_static/libjavajpeg.a
>>> defined at iccjpeg.c
>>> .../iccjpeg.o:(.text+0x0)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14794#issuecomment-1629895714
More information about the client-libs-dev
mailing list