render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
43fe83
From a3d46832cc5a6e2eae8daf86df26747f0ebb49a6 Mon Sep 17 00:00:00 2001
43fe83
Message-Id: <a3d46832cc5a6e2eae8daf86df26747f0ebb49a6.1383321464.git.jdenemar@redhat.com>
43fe83
From: Jim Fehlig <jfehlig@suse.com>
43fe83
Date: Wed, 30 Oct 2013 17:01:45 +0000
43fe83
Subject: [PATCH] build: fix linking virt-login-shell
43fe83
43fe83
For
43fe83
43fe83
  https://bugzilla.redhat.com/show_bug.cgi?id=1015247
43fe83
43fe83
After commit 3e2f27e1, I've noticed build failures of virt-login-shell
43fe83
when libapparmor-devel is installed on the build host
43fe83
43fe83
CCLD     virt-login-shell
43fe83
../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o):
43fe83
In function `virExec':
43fe83
/home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined
43fe83
reference to `aa_change_profile'
43fe83
collect2: error: ld returned 1 exit status
43fe83
43fe83
I was about to commit an easy fix under the build-breaker rule
43fe83
(build-fix-1.patch), but thought to extend the notion of SECDRIVER_LIBS
43fe83
to SECDRIVER_CFLAGS, and use both throughout src/Makefile.am where it
43fe83
makes sense (build-fix-2.patch).
43fe83
43fe83
Should I just stick with the simple fix, or is something along the lines
43fe83
of patch 2 preferred?
43fe83
43fe83
Regards,
43fe83
Jim
43fe83
43fe83
>From a0f35945f3127ab70d051101037e821b1759b4bb Mon Sep 17 00:00:00 2001
43fe83
From: Jim Fehlig <jfehlig@suse.com>
43fe83
Date: Mon, 21 Oct 2013 15:30:02 -0600
43fe83
Subject: [PATCH] build: fix virt-login-shell build with apparmor
43fe83
43fe83
With libapparmor-devel installed, virt-login-shell fails to link
43fe83
43fe83
CCLD     virt-login-shell
43fe83
../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In function `virExec':
43fe83
/home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined reference to `aa_change_profile'
43fe83
collect2: error: ld returned 1 exit status
43fe83
43fe83
Fix by linking libvirt_setuid_rpc_client with previously determined
43fe83
SECDRIVER_LIBS in src/Makefile.am.  While at it, introduce SECDRIVER_CFLAGS
43fe83
and use both throughout src/Makefile.am where it makes sense.
43fe83
43fe83
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
43fe83
(cherry picked from commit 5a0ea4b7b9af2231ed161b94f9af65375c6ee9c2)
43fe83
43fe83
Conflicts:
43fe83
	src/Makefile.am: Context
43fe83
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
43fe83
---
43fe83
 src/Makefile.am | 20 +++++++++-----------
43fe83
 1 file changed, 9 insertions(+), 11 deletions(-)
43fe83
43fe83
diff --git a/src/Makefile.am b/src/Makefile.am
43fe83
index 969d09b..2dddf15 100644
43fe83
--- a/src/Makefile.am
43fe83
+++ b/src/Makefile.am
43fe83
@@ -46,11 +46,14 @@ nodist_conf_DATA =
43fe83
 
43fe83
 THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)
43fe83
 
43fe83
+SECDRIVER_CFLAGS =
43fe83
 SECDRIVER_LIBS =
43fe83
 if WITH_SECDRIVER_SELINUX
43fe83
+SECDRIVER_CFLAGS += $(SELINUX_CFLAGS)
43fe83
 SECDRIVER_LIBS += $(SELINUX_LIBS)
43fe83
 endif
43fe83
 if WITH_SECDRIVER_APPARMOR
43fe83
+SECDRIVER_CFLAGS += $(APPARMOR_CFLAGS)
43fe83
 SECDRIVER_LIBS += $(APPARMOR_LIBS)
43fe83
 endif
43fe83
 
43fe83
@@ -1975,14 +1978,14 @@ libvirt_setuid_rpc_client_la_SOURCES = 		\
43fe83
 libvirt_setuid_rpc_client_la_LDFLAGS =		\
43fe83
 		$(AM_LDFLAGS)			\
43fe83
 		$(LIBXML_LIBS)			\
43fe83
-		$(SELINUX_LIBS)			\
43fe83
+		$(SECDRIVER_LIBS)		\
43fe83
 		$(NULL)
43fe83
 libvirt_setuid_rpc_client_la_CFLAGS =		\
43fe83
 		-DLIBVIRT_SETUID_RPC_CLIENT	\
43fe83
 		-I$(top_srcdir)/src/conf	\
43fe83
 		-I$(top_srcdir)/src/rpc		\
43fe83
 		$(AM_CFLAGS)			\
43fe83
-		$(SELINUX_CFLAGS)		\
43fe83
+		$(SECDRIVER_CFLAGS)		\
43fe83
 		$(NULL)
43fe83
 endif WITH_LXC
43fe83
 
43fe83
@@ -2410,15 +2413,10 @@ libvirt_lxc_CFLAGS =				\
43fe83
 if WITH_BLKID
43fe83
 libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
43fe83
 libvirt_lxc_LDADD += $(BLKID_LIBS)
43fe83
-endif
43fe83
-if WITH_SECDRIVER_SELINUX
43fe83
-libvirt_lxc_CFLAGS += $(SELINUX_CFLAGS)
43fe83
-endif
43fe83
-if WITH_SECDRIVER_APPARMOR
43fe83
-libvirt_lxc_CFLAGS += $(APPARMOR_CFLAGS)
43fe83
-endif
43fe83
-endif
43fe83
-endif
43fe83
+endif WITH_BLKID
43fe83
+libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
43fe83
+endif WITH_LIBVIRTD
43fe83
+endif WITH_LXC
43fe83
 EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)
43fe83
 
43fe83
 if WITH_SECDRIVER_APPARMOR
43fe83
-- 
43fe83
1.8.4.2
43fe83