Commit c637c4d6 authored by Natanael Copa's avatar Natanael Copa

main/libvirt: fix fortify build and libudev underlinking

parent 0838d20c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
pkgname=libvirt pkgname=libvirt
pkgver=1.2.13 pkgver=1.2.13
_ver="${pkgver/_rc/-rc}" _ver="${pkgver/_rc/-rc}"
pkgrel=0 pkgrel=1
pkgdesc="A virtualization API for several hypervisor and container systems" pkgdesc="A virtualization API for several hypervisor and container systems"
url="http://libvirt.org/" url="http://libvirt.org/"
arch="all" arch="all"
...@@ -18,6 +18,7 @@ makedepends="augeas-dev bridge-utils cyrus-sasl-dev device-mapper ...@@ -18,6 +18,7 @@ makedepends="augeas-dev bridge-utils cyrus-sasl-dev device-mapper
udev-dev zlib-dev yajl-dev libpcap-dev curl-dev libpciaccess-dev udev-dev zlib-dev yajl-dev libpcap-dev curl-dev libpciaccess-dev
polkit-dev readline-dev dnsmasq linux-headers $depends_dev polkit-dev readline-dev dnsmasq linux-headers $depends_dev
$_daemon_deps $_client_deps $_daemon_deps $_client_deps
automake autoconf libtool
" "
install="$pkgname.post-install" install="$pkgname.post-install"
subpackages="$pkgname-dev $pkgname-doc $pkgname-client $pkgname-daemon subpackages="$pkgname-dev $pkgname-doc $pkgname-client $pkgname-daemon
...@@ -26,6 +27,8 @@ source="http://libvirt.org/sources/$pkgname-$pkgver.tar.gz ...@@ -26,6 +27,8 @@ source="http://libvirt.org/sources/$pkgname-$pkgver.tar.gz
libvirt.confd libvirt.confd
libvirt.initd libvirt.initd
musl-fix-includes.patch musl-fix-includes.patch
fix-fortify-virnetlink.patch
fix-libudev-underlinking.patch
" "
if [ "$CARCH" = "x86_64" ]; then if [ "$CARCH" = "x86_64" ]; then
...@@ -54,6 +57,7 @@ prepare() { ...@@ -54,6 +57,7 @@ prepare() {
;; ;;
esac esac
done done
autoreconf -vif || return 1
} }
build() { build() {
...@@ -169,12 +173,18 @@ _common_drivers() { ...@@ -169,12 +173,18 @@ _common_drivers() {
md5sums="237e0d9c7f8a31ec3cf0df9a41da2137 libvirt-1.2.13.tar.gz md5sums="237e0d9c7f8a31ec3cf0df9a41da2137 libvirt-1.2.13.tar.gz
1c84a7baeafe0a7f4e9d7ae5180311b7 libvirt.confd 1c84a7baeafe0a7f4e9d7ae5180311b7 libvirt.confd
d897df38c7e7fa1a297aa551108633c9 libvirt.initd d897df38c7e7fa1a297aa551108633c9 libvirt.initd
9da7723b114b2d87558e92828366fbcb musl-fix-includes.patch" 9da7723b114b2d87558e92828366fbcb musl-fix-includes.patch
bc6ed2ce739dcc40542bb4e6bc94c0d3 fix-fortify-virnetlink.patch
9b6664c687341a0609154764fe9a9205 fix-libudev-underlinking.patch"
sha256sums="944163d93949db61f49eace85838b1bd55ce855e88b014df16c50fd2102bdaf6 libvirt-1.2.13.tar.gz sha256sums="944163d93949db61f49eace85838b1bd55ce855e88b014df16c50fd2102bdaf6 libvirt-1.2.13.tar.gz
851ab3f9678f0fa9c3ee03f7fc7bd00c4ee86d5f0777eecf9eb1ffe3243adfd1 libvirt.confd 851ab3f9678f0fa9c3ee03f7fc7bd00c4ee86d5f0777eecf9eb1ffe3243adfd1 libvirt.confd
e9fad203434ffaa6afe524e42a9fb6594edad61cb02b1ca60a68d1a7fe0c31ab libvirt.initd e9fad203434ffaa6afe524e42a9fb6594edad61cb02b1ca60a68d1a7fe0c31ab libvirt.initd
8dfa9dbe71ee21dc53e44bd7cc0127adde1bf3371d6b393657b386bb83f8139b musl-fix-includes.patch" 8dfa9dbe71ee21dc53e44bd7cc0127adde1bf3371d6b393657b386bb83f8139b musl-fix-includes.patch
84132508aeb5a5946e07426337d6fbb0208b1181d51d3c4927ef9601562ce3d3 fix-fortify-virnetlink.patch
336ec39eba50ef49669e004ef462d225534f0ca2df5a20ec67db312d18de1aec fix-libudev-underlinking.patch"
sha512sums="f590cd4ad55fb8f09980ba2dfd05eb6b978c602c2eecc1188acc6536ae2d4ffb8ad70756a39c95b2b69688981e950cce3e7f232bf96b50fdb01d60b05ecf990d libvirt-1.2.13.tar.gz sha512sums="f590cd4ad55fb8f09980ba2dfd05eb6b978c602c2eecc1188acc6536ae2d4ffb8ad70756a39c95b2b69688981e950cce3e7f232bf96b50fdb01d60b05ecf990d libvirt-1.2.13.tar.gz
9aba6ab73219a635c64a340ee8887356e644445c9128734cbce73f5d54778378da2f10a190365ad88a7db8bc95b1fb17f0c6ca41fc41bb786c09e1afe84d65dc libvirt.confd 9aba6ab73219a635c64a340ee8887356e644445c9128734cbce73f5d54778378da2f10a190365ad88a7db8bc95b1fb17f0c6ca41fc41bb786c09e1afe84d65dc libvirt.confd
f48c97f93ef4509a86eda6200b3aae5b2c0c6263403bde933b770fd62240dca27bc439bd29b440ea6a47c8337f8b4511230ed915cb5ff54d9a1cf311863f6fa1 libvirt.initd f48c97f93ef4509a86eda6200b3aae5b2c0c6263403bde933b770fd62240dca27bc439bd29b440ea6a47c8337f8b4511230ed915cb5ff54d9a1cf311863f6fa1 libvirt.initd
b6142256bf2700b9e5335c60fe5628e4095a24689c31d54afcab46f46a06b9c0ae676f87f77a487377eafbec11fb7afa9b994aef48a10a39e82f47c45df008ba musl-fix-includes.patch" b6142256bf2700b9e5335c60fe5628e4095a24689c31d54afcab46f46a06b9c0ae676f87f77a487377eafbec11fb7afa9b994aef48a10a39e82f47c45df008ba musl-fix-includes.patch
0ef74be8c8f0e6c6ae6e3dcf6e83dc76c1371e1eaab123589f634c22f221cc26a8f0b0de6a9f5d36510b270d4a06fae42b51b749311f3e57953e65fbfc241911 fix-fortify-virnetlink.patch
86a1d7b010b5776985b562dfbc09e3c8c4192b6e3c0768efa4f233b266954a92b29ec323a1deabb84294112a730a87a7ebecbf7f4d3c4f8d8adb93cd95af6a6e fix-libudev-underlinking.patch"
avoid working around old and broken libnl-1.
http://www.redhat.com/archives/libvir-list/2012-August/msg01699.html
http://www.redhat.com/archives/libvir-list/2012-August/msg01699.html
The workaround breaks fortify:
... -c util/virnetdev.c -fPIC -DPIC -o util/.libs/libvirt_util_la-virnetdev.o
In file included from ../gnulib/lib/stdio.h:43:0,
from /usr/include/netlink/netlink.h:16,
from /usr/include/netlink/msg.h:15,
from util/virnetlink.h:33,
from util/virnetdev.h:29,
from util/virnetdev.c:25:
/usr/include/fortify/stdio.h: In function 'snprintf':
/usr/include/fortify/stdio.h:93:2: error: invalid use of '__builtin_va_arg_pack ()'
return __snprintf_orig(s, n, fmt, __builtin_va_arg_pack());
^
Remove the workaround and require fixed libnl.
--- ./src/util/virnetlink.h.orig
+++ ./src/util/virnetlink.h
@@ -24,17 +24,7 @@
# include "virmacaddr.h"
# if defined(__linux__) && defined(HAVE_LIBNL)
-
-/* Work around a bug where older libnl-1 headers expected older gcc
- * semantics of 'extern inline' that conflict with C99 semantics. */
-# ifdef HAVE_LIBNL1
-# define inline
-# endif
# include <netlink/msg.h>
-# ifdef HAVE_LIBNL1
-# undef inline
-# endif
-
# else
struct nl_msg;
--- ./src/Makefile.am.orig
+++ ./src/Makefile.am
@@ -1456,12 +1456,11 @@
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
-else ! WITH_NETCF
+endif WITH_NETCF
if WITH_UDEV
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
endif WITH_UDEV
-endif ! WITH_NETCF
if WITH_DRIVER_MODULES
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment