Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Oct 2022 11:31:52 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 267333] security/s2n-tls: Fails to build when some variants of CPUTYPE is defined
Message-ID:  <bug-267333-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267333

            Bug ID: 267333
           Summary: security/s2n-tls: Fails to build when some variants of
                    CPUTYPE is defined
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: eduardo@FreeBSD.org
          Reporter: diizzy@FreeBSD.org
          Assignee: eduardo@FreeBSD.org
             Flags: maintainer-feedback?(eduardo@FreeBSD.org)

FAILED: CMakeFiles/s2n.dir/pq-crypto/kyber_r3/kyber512r3_cbd.c.o
/usr/bin/cc -D_FORTIFY_SOURCE=3D2 -D_POSIX_C_SOURCE=3D200809L -Ds2n_EXPORTS
-I/usr/ports/security/s2n-tls/work/s2n-tls-1.3.25
-I/usr/ports/security/s2n-tls/work/s2n-tls-1.3.25/api -O2 -pipe
-march=3Dtigerlake  -fstack-protector-strong -fno-strict-aliasing -O2 -pipe
-march=3Dtigerlake  -fstack-protector-strong -fno-strict-aliasing -fPIC -pe=
dantic
-std=3Dgnu99 -Wall -Wimplicit -Wunused -Wcomment -Wchar-subscripts
-Wuninitialized -Wshadow -Wcast-align -Wwrite-strings
-Wno-deprecated-declarations -Wno-unknown-pragmas -Wformat-security
-Wno-missing-braces -Wa,--noexecstack -Werror -fvisibility=3Dhidden -DS2N_E=
XPORTS
-flto -DS2N_STACKTRACE -DS2N_CPUID_AVAILABLE -fPIC -DS2N_FALL_THROUGH_SUPPO=
RTED
-DS2N___RESTRICT__SUPPORTED -DS2N_MADVISE_SUPPORTED -DS2N_MINHERIT_SUPPORTED
-DS2N_LIBCRYPTO_SUPPORTS_EVP_MD5_SHA1_HASH -DS2N_LIBCRYPTO_SUPPORTS_EVP_RC4
-DS2N_LIBCRYPTO_SUPPORTS_EVP_MD_CTX_SET_PKEY_CTX -MD -MT
CMakeFiles/s2n.dir/pq-crypto/kyber_r3/kyber512r3_cbd.c.o -MF
CMakeFiles/s2n.dir/pq-crypto/kyber_r3/kyber512r3_cbd.c.o.d -o
CMakeFiles/s2n.dir/pq-crypto/kyber_r3/kyber512r3_cbd.c.o -c
/usr/ports/security/s2n-tls/work/s2n-tls-1.3.25/pq-crypto/kyber_r3/kyber512=
r3_cbd.c
/usr/ports/security/s2n-tls/work/s2n-tls-1.3.25/pq-crypto/kyber_r3/kyber512=
r3_cbd.c:5:1:
error: expected identifier or '('
S2N_ENSURE_PORTABLE_OPTIMIZATIONS
^
/usr/ports/security/s2n-tls/work/s2n-tls-1.3.25/pq-crypto/s2n_pq_asm.h:26:5:
note: expanded from macro 'S2N_ENSURE_PORTABLE_OPTIMIZATIONS'
    #error "Compiling portable code with non-portable assembly optimization=
s.
This can result in runtime crashes if artifacts are deployed to older CPU's
without these CPU instructions"
    ^
/usr/ports/security/s2n-tls/work/s2n-tls-1.3.25/pq-crypto/kyber_r3/kyber512=
r3_cbd.c:60:23:
error: implicit declaration of function 'load32_littleendian' is invalid in=
 C99
[-Werror,-Wimplicit-function-declaration]
        uint32_t t  =3D load32_littleendian(buf + 4 * i);
                      ^
/usr/ports/security/s2n-tls/work/s2n-tls-1.3.25/pq-crypto/kyber_r3/kyber512=
r3_cbd.c:60:23:
note: did you mean 'load24_littleendian'?
/usr/ports/security/s2n-tls/work/s2n-tls-1.3.25/pq-crypto/kyber_r3/kyber512=
r3_cbd.c:37:17:
note: 'load24_littleendian' declared here
static uint32_t load24_littleendian(const uint8_t x[3]) {
                ^
2 errors generated.

Ugly hack is to define _CPUCFLAGS=3D in s2n's Makefile

https://github.com/aws/s2n-tls/blob/main/CMakeLists.txt#L298

Having a quick look it seems (I may be reading it wrong) that anything that
defines __AVX__ || __AVX2__ || __BMI2__ will fail.

Reference:
https://cgit.freebsd.org/src/tree/share/examples/etc/make.conf?h=3Dstable/13

Tested on FreeBSD 13.1-STABLE ( CPUTYPE?=3Dtigerlake in /etc/make.conf)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-267333-7788>