From 72bd3cef90245c12c9a5779b1dcae7569669c591 Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Thu, 23 Nov 2023 09:57:00 -0300 Subject: [PATCH 1/2] Fix non-amd64 build --- snap/snapcraft.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 057b234..42c2d4e 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -62,7 +62,7 @@ parts: local-elements: plugin: dump source: src - organize: + organize: elements/*: usr/local/lib/elements/ octavia-elements: plugin: dump @@ -127,7 +127,7 @@ parts: rm -rf build && mkdir build && cd build ../configure \ --extra-cflags='-g -O2 -fdebug-prefix-map=/home/ubuntu/qemu-2.11+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DVENDOR_UBUNTU' \ - --extra-ldflags='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -Wl,-dynamic-linker=/snap/core22/current/lib64/ld-linux-x86-64.so.2 -Wl,-rpath=/snap/core22/current/lib/x86_64-linux-gnu' \ + --extra-ldflags='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -Wl,-rpath=/snap/core22/current/lib/$CRAFT_ARCH_TRIPLET' \ --prefix=/snap/$CRAFT_PROJECT_NAME/current/usr \ --bindir=bin \ --libdir=lib/$CRAFT_ARCH_TRIPLET \ From 78c8c1e3bb67f4fbc0a84c3b979bbf186e234ff8 Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Thu, 23 Nov 2023 09:57:18 -0300 Subject: [PATCH 2/2] Patchelf on qemu-img --- snap/snapcraft.yaml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 42c2d4e..61f791d 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -166,7 +166,23 @@ parts: --with-git-submodules=ignore make -j${CRAFT_PARALLEL_BUILD_COUNT} make install DESTDIR=${CRAFT_PART_INSTALL} + override-prime: | + patchelf \ + --force-rpath \ + --set-rpath '$ORIGIN/../lib/$SNAPCRAFT_ARCH_TRIPLET:$ORIGIN/../../lib/$SNAPCRAFT_ARCH_TRIPLET:/snap/core22/current/lib/$SNAPCRAFT_ARCH_TRIPLET' \ + $CRAFT_PART_INSTALL/usr/bin/qemu-img + + patchelf \ + --set-interpreter /snap/core22/current/lib/ld-linux-$(echo $SNAPCRAFT_ARCH_TRIPLET | cut -d'-' -f1 | sed s/_/-/g).so.1 \ + $CRAFT_PART_INSTALL/usr/bin/qemu-img + + # for ITEM in $(ls /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libpcre.so.3* /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libp11-kit.so.0* /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libidn2.so.0* /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libunistring.so.2* /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libtasn1.so.6* /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libnettle.so.8* /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libhogweed.so.6 libgmp.so.10* /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libffi.so.8*); do + # cp -P $ITEM usr/lib/$SNAPCRAFT_ARCH_TRIPLET/ + # done + craftctl default + build-packages: + - patchelf - libaio-dev - acpica-tools - libattr1-dev @@ -197,17 +213,22 @@ parts: - libdrm-dev - libepoxy-dev - libfdt-dev + - libffi-dev - libfuse3-dev - libgbm-dev - libglusterfs-dev + - libgmp-dev - libgtk-3-dev - libibumad-dev - libibverbs-dev + - libidn2-dev - libiscsi-dev - libjack-dev - libjpeg-dev - libncurses-dev - libnuma-dev + - libp11-kit-dev + - libpcre2-dev - libpixman-1-dev - libpng-dev - libpulse-dev @@ -220,6 +241,8 @@ parts: - libssh-dev - libudev-dev - liburing-dev + - libunistring-dev + - libtasn1-6-dev - libusb-1.0-0-dev - libusbredirparser-dev - libvirglrenderer-dev @@ -253,15 +276,24 @@ parts: - libaio1 - libcapstone4 - libfdt1 + - libffi8 + - libgmp10 + - libhogweed6 + - libidn2-0 + - libnettle8 - libpixman-1-0 - libslang2 + - libunistring2 - liburing2 + - libp11-kit0 + - libpcre3 - librdmacm1 - libpixman-1-0 - libcapstone4 - libfdt1 - libibverbs1 - libslirp0 + - libtasn1-6 - qemu-system-data - on amd64: - libpmem1 @@ -483,6 +515,14 @@ parts: - libfuse2 - libfuse3-3 - fuse3 + - libffi8 + - libgmp10 + - libhogweed6 + - libidn2-0 + - libnettle8 + - libunistring2 + - libp11-kit0 + - libtasn1-6 stage: - -lib64 guestfs-tools: @@ -565,3 +605,4 @@ parts: - libxml2 - libc-bin - lsb-release + - libpcre3