diff --git a/images/packages/gnutls/werf.inc.yaml b/images/packages/gnutls/werf.inc.yaml index af30ab62c0..dfedd539d1 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,22 @@ shell: cd /src - # Fake distcheck-hook that checks bootstrap is called without --skip-po + # Workaround for --skip-po: bootstrap checks .reference to decide if it should download po files. mkdir -p po/.reference - ./bootstrap --skip-po + export CFLAGS="-march=x86-64-v2" + export CXXFLAGS="-march=x86-64-v2" + + ./bootstrap --skip-po --no-git --gnulib-srcdir=/src/gnulib + + ls -la /src/gnulib + + echo "GCC OPTIONS ==========" + gcc -c -Q -O2 --help=target + echo "GCC FLAGS ==========" + echo CFLAGS=$CFLAGS + echo CXXFLAGS=$CXXFLAGS + echo "GCC SCRIPTS ===========" ./configure \ --prefix=/usr \ @@ -122,4 +135,34 @@ shell: make -j$(nproc) - make DESTDIR=$OUTDIR install-strip + + echo MAKE INSTALL ======== + + make DESTDIR=$OUTDIR install + #make DESTDIR=$OUTDIR install-strip + + echo DONE MAKE =============== + + which readelf + which objdump + + tree /out + + echo ELF and AVX info ============== + + echo find certtool + find . -name certtool -type f | grep .libs + + echo find libgnutls.so + find . -name libgnutls.so\* -type f + + echo readelf --notes $(find . -name certtool -type f | grep .libs| head -n1) + readelf --notes $(find . -name certtool -type f | grep .libs| head -n1) + + echo objdump -d $(find . -name certtool -type f | grep .libs| head -n1) + objdump -d $(find . -name certtool -type f | grep .libs| head -n1) | grep "vpbroadcast|vinsert|vextract|vfmadd" || true + + echo readelf --notes $(find . -name libgnutls.so\* -type f | head -n1) + readelf --notes $(find . -name libgnutls.so\* -type f | head -n1) + echo objdump -d $(find . -name libgnutls.so\* -type f | head -n1) + objdump -d $(find . -name libgnutls.so\* -type f | head -n1) | grep "vpbroadcast|vinsert|vextract|vfmadd" || true diff --git a/images/packages/libcurl/werf.inc.yaml b/images/packages/libcurl/werf.inc.yaml index 0875d54ad2..a408670c7a 100644 --- a/images/packages/libcurl/werf.inc.yaml +++ b/images/packages/libcurl/werf.inc.yaml @@ -84,6 +84,7 @@ shell: OUTDIR=/out cd /src + autoreconf -f -i ./configure \ --prefix=/usr \ diff --git a/images/packages/libgmp/werf.inc.yaml b/images/packages/libgmp/werf.inc.yaml index 46dc63b87a..b481661ed5 100644 --- a/images/packages/libgmp/werf.inc.yaml +++ b/images/packages/libgmp/werf.inc.yaml @@ -57,9 +57,18 @@ shell: cd /src + 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/libgsasl/werf.inc.yaml b/images/packages/libgsasl/werf.inc.yaml index 2392c4d8a1..c039d4bd49 100644 --- a/images/packages/libgsasl/werf.inc.yaml +++ b/images/packages/libgsasl/werf.inc.yaml @@ -76,6 +76,7 @@ shell: OUTDIR=/out cd /src + export GNULIB_REVISION=$(. bootstrap.conf >&2; echo $GNULIB_REVISION) export GNULIB_SRCDIR=$(pwd)/gnulib 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..b90f14e0a3 100644 --- a/images/packages/swtpm/werf.inc.yaml +++ b/images/packages/swtpm/werf.inc.yaml @@ -78,6 +78,8 @@ shell: cd /src + export CFLAGS="-march=x86-64-v2" + ./autogen.sh \ --disable-tests \ --with-openssl \ diff --git a/images/virt-launcher/werf.inc.yaml b/images/virt-launcher/werf.inc.yaml index ae471237d1..179f5b66c7 100644 --- a/images/virt-launcher/werf.inc.yaml +++ b/images/virt-launcher/werf.inc.yaml @@ -76,8 +76,17 @@ altLibs: - psmisc - msulogin - strace + - binutils + - glibc-utils + - gdb binaries: - # Gnu utils (requared for swtpm) + # DEBUG + - /usr/bin/bash + - /usr/bin/strace + - /usr/bin/objdump + - /usr/bin/ldd + - /usr/bin/gdb + # GNU utils (required to run swtpm). - /usr/bin/certtool - /usr/bin/gnutls-cli - /usr/bin/ocsptool @@ -210,7 +219,7 @@ import: {{- include "importPackageImages" (list . $builderDependencies.packages "install") -}} -# Statically builded +# Statically built. - image: {{ .ModuleNamePrefix }}packages/openssl add: /openssl to: /relocate @@ -303,6 +312,11 @@ shell: echo "Copy binaries to /relocate" ./relocate_binaries.sh -i "{{ $builderDependencies.binaries | join " " }}" -o /relocate + echo "==========================" + echo "ls /relocate/usr/bin" + ls /relocate/usr/bin + echo "==========================" + echo "Copy additional config swtpm" cp -a /etc/{swtpm_setup.conf,swtpm-localca.conf,swtpm-localca.options} /relocate/etc/