diff --git a/images/packages/gnutls/werf.inc.yaml b/images/packages/gnutls/werf.inc.yaml index af30ab62c0..682886d916 100644 --- a/images/packages/gnutls/werf.inc.yaml +++ b/images/packages/gnutls/werf.inc.yaml @@ -51,6 +51,7 @@ altPackages: - liboqs-devel - iproute2-devel - wget +- tree packages: - libbrotli libidn2 libgcrypt libgmp - nettle zlib zstd p11-kit @@ -94,10 +95,17 @@ shell: cd /src - # Fake distcheck-hook that checks bootstrap is called without --skip-po - mkdir -p po/.reference + # Limit optimisations to x86-64 level 2 microarchitecture. + # This prevent "invalid opcode" errors on CPUs without level v3 extensions + # AVX2, BMI2, etc.: Intel Ivy Bridge and older, AMD Steamroller and older. + export CFLAGS="-march=x86-64-v2" + export CPPFLAGS="-march=x86-64-v2" + export CXXFLAGS="-march=x86-64-v2" - ./bootstrap --skip-po + # Skip po downloads: bootstrap checks .reference directory to decide if it should download po files. + mkdir -p po/.reference + # Skip git clone: gnulib is already downloaded in the src-artifact image. + ./bootstrap --skip-po --no-git --gnulib-srcdir=/src/gnulib ./configure \ --prefix=/usr \ @@ -123,3 +131,5 @@ shell: make -j$(nproc) make DESTDIR=$OUTDIR install-strip + + tree -hp $OUTDIR diff --git a/images/packages/libgmp/werf.inc.yaml b/images/packages/libgmp/werf.inc.yaml index 46dc63b87a..21acc9f0fe 100644 --- a/images/packages/libgmp/werf.inc.yaml +++ b/images/packages/libgmp/werf.inc.yaml @@ -57,9 +57,21 @@ shell: cd /src + # Limit optimisations to x86-64 level 2 microarchitecture. + # This prevent "invalid opcode" errors on CPUs without level v3 extensions + # AVX2, BMI2, etc.: Intel Ivy Bridge and older, AMD Steamroller and older. + export CFLAGS="-march=x86-64-v2" + export CPPFLAGS="-march=x86-64-v2" + export CXXFLAGS="-march=x86-64-v2" + + # Notes: + # - Use x86_64 cpu to produce the most portable binary but not the most performant one. + # - Disable fat binary. ./configure \ --prefix=/usr \ --libdir=/usr/lib64 \ + --disable-fat \ + --build x86_64-linux-gnu \ --enable-cxx make -j$(nproc) diff --git a/images/packages/libvirt/werf.inc.yaml b/images/packages/libvirt/werf.inc.yaml index d6b8ad0070..b7862bb10f 100644 --- a/images/packages/libvirt/werf.inc.yaml +++ b/images/packages/libvirt/werf.inc.yaml @@ -266,4 +266,4 @@ shell: echo "Stripped: $execfile" fi done - tree -hp $OUTDIR \ No newline at end of file + tree -hp $OUTDIR diff --git a/images/packages/swtpm/werf.inc.yaml b/images/packages/swtpm/werf.inc.yaml index 17f3086573..5981399098 100644 --- a/images/packages/swtpm/werf.inc.yaml +++ b/images/packages/swtpm/werf.inc.yaml @@ -36,6 +36,7 @@ altPackages: - libgnutls-openssl-devel - libfuse-devel - perl-podlators +- tree packages: - libgmp libtpms openssl libjson-glib - libtasn1 @@ -78,6 +79,13 @@ shell: cd /src + # Limit optimisations to x86-64 level 2 microarchitecture. + # This prevent "invalid opcode" errors on CPUs without level v3 extensions + # AVX2, BMI2, etc.: Intel Ivy Bridge and older, AMD Steamroller and older. + export CFLAGS="-march=x86-64-v2" + export CPPFLAGS="-march=x86-64-v2" + export CXXFLAGS="-march=x86-64-v2" + ./autogen.sh \ --disable-tests \ --with-openssl \ @@ -98,3 +106,5 @@ shell: rm -rf $OUTDIR/usr/include rm -rf $OUTDIR/usr/share rm -rf $OUTDIR/usr/libexec/installed-tests + + tree -hp $OUTDIR diff --git a/images/virt-launcher/werf.inc.yaml b/images/virt-launcher/werf.inc.yaml index ae471237d1..c91eed764b 100644 --- a/images/virt-launcher/werf.inc.yaml +++ b/images/virt-launcher/werf.inc.yaml @@ -77,7 +77,7 @@ altLibs: - msulogin - strace binaries: - # Gnu utils (requared for swtpm) + # GNU utils (required to run swtpm). - /usr/bin/certtool - /usr/bin/gnutls-cli - /usr/bin/ocsptool @@ -210,7 +210,7 @@ import: {{- include "importPackageImages" (list . $builderDependencies.packages "install") -}} -# Statically builded +# Statically built. - image: {{ .ModuleNamePrefix }}packages/openssl add: /openssl to: /relocate