Bug 240090 - security/nettle: Enable fat library build on amd64 / arm
Summary: security/nettle: Enable fat library build on amd64 / arm
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Some People
Assignee: Sunpoet Po-Chuan Hsieh
URL:
Keywords: feature, needs-qa, performance
Depends on:
Blocks:
 
Reported: 2019-08-25 07:25 UTC by daniel.engberg.lists
Modified: 2019-10-04 07:05 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)
koobs: merge-quarterly?


Attachments
v1 (1.80 KB, patch)
2019-08-25 07:25 UTC, daniel.engberg.lists
no flags Details | Diff
v2 (1.83 KB, patch)
2019-08-25 07:52 UTC, daniel.engberg.lists
no flags Details | Diff
nettle-3.5.1_2.log.armv7 (191.92 KB, text/plain)
2019-08-25 17:42 UTC, Fukang Chen
no flags Details
nettle-3.5.1_2.log.aarch64 (165.28 KB, text/plain)
2019-08-25 17:43 UTC, Fukang Chen
no flags Details
v3 (1.80 KB, patch)
2019-08-25 21:46 UTC, daniel.engberg.lists
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description daniel.engberg.lists 2019-08-25 07:25:07 UTC
Created attachment 206877 [details]
v1

Enable fat library by default on AMD64, ARM64 and ARM(v7) as this makes libnettle include multiple versions of certain functions in the library and select the ones to use at run-time. This enables various instructions such as AES-NI on AMD64 and allows libnettle to use NEON when possible on ARM. Also set TEST_TARGET so "make test" runs as expected.
Comment 1 daniel.engberg.lists 2019-08-25 07:28:47 UTC
I forgot to mention that I moved USES variable to make portlint happy, sorry about that.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2019-08-25 07:38:15 UTC
@Fukang Can you assist with ARM poudriere confirmation?
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2019-08-25 07:38:36 UTC
Thank you for the report and patch Daniel
Comment 4 daniel.engberg.lists 2019-08-25 07:52:51 UTC
Created attachment 206878 [details]
v2

List supported architectures in menu for fat library option
Comment 5 Fukang Chen freebsd_committer 2019-08-25 17:41:23 UTC
(In reply to Kubilay Kocak from comment #2)
Sure thing. poudriere OK.
Comment 6 Fukang Chen freebsd_committer 2019-08-25 17:42:41 UTC
Created attachment 206898 [details]
nettle-3.5.1_2.log.armv7
Comment 7 Fukang Chen freebsd_committer 2019-08-25 17:43:22 UTC
Created attachment 206899 [details]
nettle-3.5.1_2.log.aarch64
Comment 8 daniel.engberg.lists 2019-08-25 21:46:41 UTC
Created attachment 206904 [details]
v3

I missed the fact that the configure script isn't arm64/aarch64 aware while the code does take 64-bit platforms into account.

https://git.lysator.liu.se/nettle/nettle/blob/nettle_3.5.1_release_20190627/fat-arm.c#L124
https://git.lysator.liu.se/nettle/nettle/blob/nettle_3.5.1_release_20190627/configure.ac#L431

I also tried to modify the configure script to include assembly code (files) on aarch64 however that resulted in compliation errors so I think we have to settle for amd64 and arm(v7) for now. My apologies for not noticing it earlier.

This revision doesn't enable fat library on arm64/aarch64
Comment 9 Sunpoet Po-Chuan Hsieh freebsd_committer 2019-08-29 16:06:28 UTC
(In reply to daniel.engberg.lists from comment #8)

I'll add OPTIONS_DEFINE_{am64,armv7}=FAT instead of adding FAT to OPTIONS_DEFINE since we can only build fat library on those 2 architectures currently.

OPTIONS_DEFINE= DOCS EXAMPLES
OPTIONS_DEFINE_amd64=   FAT
OPTIONS_DEFINE_armv7=   FAT
OPTIONS_DEFAULT_amd64=  FAT
OPTIONS_DEFAULT_armv7=  FAT
FAT_DESC=       Build fat library
Comment 10 mikael.urankar 2019-08-29 18:40:19 UTC
(In reply to daniel.engberg.lists from comment #0)
How is that supposed to work for us? The runtime cpu detection seems specific for linux: https://git.lysator.liu.se/nettle/nettle/blob/nettle_3.5.1_release_20190627/fat-arm.c#L64
Comment 11 daniel.engberg.lists 2019-10-04 07:05:53 UTC
Closing this for now, I don't have time to look into this further. Sorry for the late reply.