Bug 282272 - archivers/snappy-java: enable armv6 and armv7
Summary: archivers/snappy-java: enable armv6 and armv7
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-22 15:11 UTC by Ronald Klop
Modified: 2024-11-28 12:45 UTC (History)
2 users (show)

See Also:
language.devel: maintainer-feedback+


Attachments
git diff used to build (3.56 KB, patch)
2024-10-22 15:11 UTC, Ronald Klop
ronald: maintainer-approval? (language.devel)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ronald Klop freebsd_committer freebsd_triage 2024-10-22 15:11:23 UTC
Created attachment 254447 [details]
git diff used to build

Armv7 builds fine for me with this patch.
Can't test armv6, but I dare to enable it (as the 'broken' message was the same) and see if we get an issue report in the future.
Comment 1 Ronald Klop freebsd_committer freebsd_triage 2024-10-22 15:12:35 UTC
Comment on attachment 254447 [details]
git diff used to build

NB: If you agree I can commit the patch myself.
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-10-27 10:03:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=28a93b27557094699ee751eacf29f6466b9e0c57

commit 28a93b27557094699ee751eacf29f6466b9e0c57
Author:     Ronald Klop <ronald@FreeBSD.org>
AuthorDate: 2024-10-24 10:36:53 +0000
Commit:     Ronald Klop <ronald@FreeBSD.org>
CommitDate: 2024-10-27 10:01:31 +0000

    archivers/snappy-java: enable armv6 and armv7

    PR:     282272
    Approved by:    Angelo Polo (maintainer)

 archivers/snappy-java/Makefile                    |  6 +++---
 archivers/snappy-java/files/patch-Makefile.common | 13 ++++++++++---
 2 files changed, 13 insertions(+), 6 deletions(-)
Comment 3 Ronald Klop freebsd_committer freebsd_triage 2024-10-27 10:06:16 UTC
Thanks for the approval.

I cross compiled the port in an armv7 jail on aarch64 (RPI4).
There I needed to add -DSNAPPY_HAVE_NEON=0 FreeBSD-arm_CXXFLAGS to prevent the build to pick up arm64 NEON vector instructions which were auto detected.
I don't know if the official package builders run armv7 native or do cross compile.
Anyway, if the official armv7 build breaks I will add -DSNAPPY_HAVE_NEON=0.

I'll close the issue for now. Thanks.
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-11-26 16:06:23 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=806a884dc73261c24423f3a32d149e4776b4c546

commit 806a884dc73261c24423f3a32d149e4776b4c546
Author:     Ronald Klop <ronald@FreeBSD.org>
AuthorDate: 2024-11-26 15:59:18 +0000
Commit:     Ronald Klop <ronald@FreeBSD.org>
CommitDate: 2024-11-26 16:05:50 +0000

    archivers/snappy-java: force disable NEON on armv7

    Cross compilation might pick up NEON from the host aarch64 system
    in our package build cluster.
    This gave an error:
    In file included from target/snappy-1.1.10/snappy.cc:29:
    target/snappy-1.1.10/snappy-internal.h:107:10: error: use of undeclared identifier 'vqtbl1q_u8'; did you mean 'vtbl1_u8'?
      107 |   return vqtbl1q_u8(input, shuffle_mask);
          |          ^~~~~~~~~~
          |          vtbl1_u8

    PR:     282272
    Approved by:    Angelo Polo (maintainer) (via earlier comment in the PR)

 archivers/snappy-java/files/patch-Makefile.common | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 5 Michal Meloun freebsd_committer freebsd_triage 2024-11-28 12:45:25 UTC
Only FYI. It's not a problem with cross-compile or with armv7 jail. It's a bug in the snappy-java configuration script. CMakeLists.txt uses the vld1q_dup_u8() and vst1q_u8() instructions to detect SNAPPY_HAVE_NEON. These exist in all (v7, arch32 and aarch64) modes. However, the code also uses the vqtbl1q_u8() instruction, which is only defined in aarch64 mode.

Michal