photon icon indicating copy to clipboard operation
photon copied to clipboard

Build improvement for OpenJDK 17/21

Open dcasota opened this issue 10 months ago • 5 comments

Is your feature request related to a problem? Please describe.

The (classic) x86_64 make build process of OpenJDK 17 and 21 is more versatile by adding the switch --build=x86_64-unknown-linux-gnu. With this, the make build of OpenJDK17 and OpenJDK21 succeeds e.g. on wsl as well. For a rich Broadcom ecosystem, you are the engineers, could you integrate the change, please?

I tried to populate a pull request but in branches 3/4/5/master/dev are different versions which led me to the conclusion better asking first.

Describe the solution you'd like

This is the fix for make build in non-VVF environment

%ifarch aarch64
sh ./configur* \
    --with-target-bits=64 \
    --enable-headless-only \
    --with-extra-cxxflags="-Wno-error -fno-delete-null-pointer-checks -fno-lifetime-dse" \
    --with-extra-cflags="-fno-delete-null-pointer-checks -Wno-error -fno-lifetime-dse" \
    --with-freetype-include=%{_includedir}/freetype2 \
    --with-freetype-lib=%{_libdir} \
    --with-stdc++lib=dynamic \
    --disable-warnings-as-errors
%else
sh ./configur* \
    --with-target-bits=64 \
    --enable-headless-only \
    --with-extra-cxxflags="-Wno-error -fno-delete-null-pointer-checks -fno-lifetime-dse" \
    --with-extra-cflags="-fno-delete-null-pointer-checks -Wno-error -fno-lifetime-dse" \
    --with-freetype-include=%{_includedir}/freetype2 \
    --with-freetype-lib=%{_libdir} \
    --with-stdc++lib=dynamic \
    --build=x86_64-unknown-linux-gnu \
    --disable-warnings-as-errors
%endif

Describe alternatives you've considered

This has been tested for a successful make build.

cd photon

cp SPECS/openjdk/openjdk17.spec openjdk17.spec.tmp
sudo sed "s/--disable-warnings-as-errors/--disable-warnings-as-errors --build=x86_64-unknown-linux-gnu/" openjdk17.spec.tmp > SPECS/openjdk/openjdk17.spec
rm openjdk17.spec.tmp

cp SPECS/openjdk/openjdk21.spec openjdk21.spec.tmp
sudo sed "s/--disable-warnings-as-errors/--disable-warnings-as-errors --build=x86_64-unknown-linux-gnu/" openjdk21.spec.tmp > SPECS/openjdk/openjdk21.spec
rm openjdk21.spec.tmp

Additional context

No response

dcasota avatar Jan 31 '25 12:01 dcasota

Hi Daniel, good point! Please submit a PR with this change to have it under your authorship. Thanks

YustasSwamp avatar Feb 08 '25 00:02 YustasSwamp

Hi @sshedi Shreenidhi, could you please review the developer drafts regarding policies, impact of 'if %aarch64' clause and more? Before filling merged pull requests, I need to know whether both developer pull requests 17/21 meet the expectations of the Photon OS team.

dcasota avatar Feb 09 '25 09:02 dcasota