Bug 281150 - java/openjdk11: fix build with clang 19 on i386
Summary: java/openjdk11: fix build with clang 19 on i386
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-java (Nobody)
URL:
Keywords:
Depends on:
Blocks: 280562
  Show dependency treegraph
 
Reported: 2024-08-31 08:33 UTC by Dimitry Andric
Modified: 2024-09-01 13:17 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (java)


Attachments
java/openjdk11: fix build with clang 19 on i386 (1.79 KB, patch)
2024-08-31 08:36 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2024-08-31 08:33:53 UTC
Clang 19 has a number of new warnings, and because java/openjdk11
compiles with -Werror by default, on i386 it results in errors similar
to:

    /wrkdirs/usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/java.desktop/share/native/libharfbuzz/graph/../hb-algs.hh:1332:18: error: builtin __has_trivial_assign is deprecated; use __is_trivially_assignable instead [-Werror,-Wdeprecated-builtins]
     1332 |   static_assert (hb_is_trivially_copy_assignable (T), "");
          |                  ^
    /wrkdirs/usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/java.desktop/share/native/libharfbuzz/graph/../hb-meta.hh:204:44: note: expanded from macro 'hb_is_trivially_copy_assignable'
      204 | #define hb_is_trivially_copy_assignable(T) __has_trivial_assign(T)
          |                                            ^

I propose to disable warnings-as-errors for this port, similar to what
is already done for openjdk17. It does not make sense to have this on by
default, unless you are an upstream maintainer.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-08-31 08:36:48 UTC
Created attachment 253199 [details]
java/openjdk11: fix build with clang 19 on i386
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2024-09-01 01:18:19 UTC
Why not:
-.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marmv*} || ${ARCH:Mpowerpc64*}
+.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marmv*} || ${ARCH} == i386 || ${ARCH:Mpowerpc64*}
 CONFIGURE_ARGS+=        --disable-warnings-as-errors
 .endif
???
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2024-09-01 08:08:43 UTC
(In reply to Vladimir Druzenko from comment #2)
In my opinion, for a port it does not make sense to turn on -Werror. I would turn this off unconditionally, and remove the whole .if block instead.
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2024-09-01 11:42:23 UTC
(In reply to Dimitry Andric from comment #3)
IMHO, it looks like it needs to be unconditionally for all arches.
In this list we lack riscv64 only.
Comment 5 Dimitry Andric freebsd_committer freebsd_triage 2024-09-01 13:17:46 UTC
Closing in favor of bug 281188, which fixes this for all openjdk ports.