Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916387 - =dev-perl/CryptX-0.80.0: Compilation fails in aesni.c
Summary: =dev-perl/CryptX-0.80.0: Compilation fails in aesni.c
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-10-28 09:00 UTC by Hanno Böck
Modified: 2024-01-20 08:29 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (dev-perl:CryptX-0.80.0:20231028-085505.log,17.14 KB, text/plain)
2023-10-28 09:00 UTC, Hanno Böck
Details
aes.patch (aes.patch,1.24 KB, patch)
2023-10-29 03:50 UTC, Sam James
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hanno Böck gentoo-dev 2023-10-28 09:00:26 UTC
Created attachment 873565 [details]
build log

I get a compilation error with CryptX-0.80.0. The error appears to be related to the aesni code. The included patch CryptX-0.80.0-respect-flags.patch seems to change something related to that, maybe related.

emerge --info '=dev-perl/CryptX-0.80.0::gentoo'
Portage 3.0.54 (python 3.11.6-final-0, default/linux/amd64/17.1, gcc-13, glibc-2.38-r6, 6.5.7 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.5.7-x86_64-Intel-R-_Core-TM-_i7-8550U_CPU_@_1.80GHz-with-glibc2.38
KiB Mem:    16145452 total,   6750068 free
KiB Swap:  140602688 total, 140602688 free
Timestamp of repository gentoo: Sat, 28 Oct 2023 08:00:01 +0000
Head commit of repository gentoo: a448594a30c19dfd99a513c5dd93e1ec9faa7a48
sh bash 5.2_p15-r7
ld GNU ld (Gentoo 2.41 p2) 2.41.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r7::gentoo
dev-java/java-config:      2.3.1-r1::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.11.6::gentoo, 3.12.0_p1::gentoo
dev-lang/rust-bin:         1.73.0::gentoo
dev-util/cmake:            3.27.7::gentoo
dev-util/meson:            1.2.3::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/openrc:           0.51::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/autoconf:        2.71-r7::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.41-r2::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.3::gentoo
sys-devel/gcc:             13.2.1_p20231014::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/llvm:            16.0.6::gentoo, 17.0.3::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.5-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r6::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 3
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 

local
    location: /usr/local/overlays/local
    masters: gentoo
    priority: 0
    volatile: True

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE Unicode-DFS-2016"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=broadwell"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.2/ext-active/ /etc/php/cgi-php8.2/ext-active/ /etc/php/cli-php8.2/ext-active/ /etc/php/fpm-php8.2/ext-active/ /etc/php/phpdbg-php8.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=broadwell"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF-8"
LC_ALL="C.UTF-8"
LDFLAGS="-Wl,-z,relro,-z,now -Wl,-O1 -Wl,--as-needed"
LEX="flex"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X acl alsa amd64 apache2 apng argon2 bluetooth bzip2 cairo cli crypt cups curl dbus default-stack-clash-protection default-znow discid dlz dri egl elogind epub exif flac fortran fpm gd glamor gles2 gold gpg gtk gtk3 harfbuzz hsts http2 iconv icu idn imap intl introspection ipv6 joystick jpeg lapack lcms libaom libcxx libtirpc libunwind lto mad managesieve minizip mp3 multilib musicbrainz mysqli native-headset ncat ncurses networkmanager nightly nls nptl nvme ogg omemo opengl openmp opus pam pcre pcre16 pdf pdo png policykit printsupport pulseaudio qml qt5 rav1e readline seccomp session sieve soap split-usr sqlite ssl statusnotifier svg test-rust text theora tinfo tray truetype uefi unicode upnp usb v4l vaapi vorbis vpx wayland webchannel webp widgets x264 x265 xattr xdg xetex xkb xmlreader xmlrpc xmlwriter xmp xvid yescrypt zip zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias http2 access_compat" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en de" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="modesetting i965 i915 intel iris" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS


emerge -pqv '=dev-perl/CryptX-0.80.0::gentoo'
[ebuild     U ] dev-perl/CryptX-0.80.0 [0.78.0] USE="-minimal -test"
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-29 03:47:42 UTC
src/ltc/headers/tomcrypt_custom.h:
```
[...]
/* ---> Symmetric Block Ciphers <--- */
#ifndef LTC_NO_CIPHERS

#define LTC_BLOWFISH
#define LTC_RC2
#define LTC_RC5
#define LTC_RC6
#define LTC_SAFERP
#define LTC_RIJNDAEL
#define LTC_AES_NI
#define LTC_XTEA
[...]
```

src/ltc/headers/tomcrypt_private.h:
```
[...]
/* tomcrypt_cipher.h */

#if defined(LTC_AES_NI) && defined(LTC_AMD64_SSE4_1)
#define LTC_HAS_AES_NI
#endif
[...]
```

src/ltc/headers/tomcrypt_cfg.h:
```
[...]

/* detect amd64/x64 */
#if defined(__x86_64__) || defined(_M_X64) || defined(_M_AMD64)
   #define ENDIAN_LITTLE
   #define ENDIAN_64BITWORD
   #define LTC_FAST
   #if defined(__SSE4_1__)
      #if __SSE4_1__ == 1
         #define LTC_AMD64_SSE4_1
      #endif
   #endif
#endif
[...]
```

so if we have SSE 4.1, it assumes we have aesni.

I think it should check for __AES__ instead.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-29 03:50:02 UTC
Created attachment 873628 [details, diff]
aes.patch

try this untested patch?
Comment 3 Hanno Böck gentoo-dev 2023-10-29 06:26:22 UTC
(In reply to Sam James from comment #2)
> Created attachment 873628 [details, diff] [details, diff]
> aes.patch
> 
> try this untested patch?

With this patch it compiles.
Comment 4 Larry the Git Cow gentoo-dev 2023-12-29 23:32:15 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b34816f06a5f8ef0ac2151fea06c99411d67bfa

commit 3b34816f06a5f8ef0ac2151fea06c99411d67bfa
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-12-29 23:31:01 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-12-29 23:31:23 +0000

    dev-perl/CryptX: fix build w/ sse4.1 but w/o aesni
    
    Closes: https://bugs.gentoo.org/916387
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-perl/CryptX/CryptX-0.80.0-r1.ebuild         | 52 +++++++++++++++++++++++++
 dev-perl/CryptX/files/CryptX-0.80.0-aesni.patch | 38 ++++++++++++++++++
 2 files changed, 90 insertions(+)