[libvirt PATCH 011/351] meson: build everything with PIE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 configure.ac                 |  1 -
 m4/virt-compile-pie.m4       | 35 -----------------------------------
 meson.build                  |  1 +
 src/Makefile.am              |  2 --
 src/locking/Makefile.inc.am  |  4 ----
 src/logging/Makefile.inc.am  |  2 --
 src/lxc/Makefile.inc.am      |  2 --
 src/network/Makefile.inc.am  |  2 --
 src/remote/Makefile.inc.am   |  2 --
 src/security/Makefile.inc.am |  2 --
 src/storage/Makefile.inc.am  |  2 --
 tools/Makefile.am            |  6 ------
 12 files changed, 1 insertion(+), 60 deletions(-)
 delete mode 100644 m4/virt-compile-pie.m4

diff --git a/configure.ac b/configure.ac
index a91ed590edd..84e63063e43 100644
--- a/configure.ac
+++ b/configure.ac
@@ -180,7 +180,6 @@ fi
 # Check for compiler and library settings.
 
 LIBVIRT_COMPILE_WARNINGS
-LIBVIRT_COMPILE_PIE
 LIBVIRT_LINKER_RELRO
 LIBVIRT_LINKER_NO_INDIRECT
 LIBVIRT_LINKER_NO_UNDEFINED
diff --git a/m4/virt-compile-pie.m4 b/m4/virt-compile-pie.m4
deleted file mode 100644
index da5cdf57b75..00000000000
--- a/m4/virt-compile-pie.m4
+++ /dev/null
@@ -1,35 +0,0 @@
-dnl
-dnl Check for support for position independent executables
-dnl
-dnl Copyright (C) 2013 Red Hat, Inc.
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library.  If not, see
-dnl <http://www.gnu.org/licenses/>.
-dnl
-
-AC_DEFUN([LIBVIRT_COMPILE_PIE],[
-    PIE_CFLAGS=
-    PIE_LDFLAGS=
-    case "$host" in
-      *-*-mingw* )
-         ;; dnl All code is position independent on Win32 target
-      *)
-      gl_COMPILER_OPTION_IF([-fPIE -DPIE -pie], [
-        PIE_CFLAGS="-fPIE -DPIE"
-        PIE_LDFLAGS="-pie"
-      ])
-    esac
-    AC_SUBST([PIE_CFLAGS])
-    AC_SUBST([PIE_LDFLAGS])
-])
diff --git a/meson.build b/meson.build
index 12a6a14ee58..88a163e2ee6 100644
--- a/meson.build
+++ b/meson.build
@@ -5,6 +5,7 @@ project(
     meson_version: '>= 0.54.0',
     default_options: [
         'buildtype=debugoptimized',
+        'b_pie=true',
         'c_std=gnu99',
     ],
 )
diff --git a/src/Makefile.am b/src/Makefile.am
index c2bb7d0083b..6cf23bb0bdf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -603,7 +603,6 @@ libexec_PROGRAMS += libvirt_iohelper
 libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
 libvirt_iohelper_LDFLAGS = \
 		$(AM_LDFLAGS) \
-		$(PIE_LDFLAGS) \
 		$(NULL)
 libvirt_iohelper_LDADD = \
 		libvirt.la \
@@ -615,7 +614,6 @@ endif WITH_DTRACE_PROBES
 
 libvirt_iohelper_CFLAGS = \
 		$(AM_CFLAGS) \
-		$(PIE_CFLAGS) \
 		$(NULL)
 
 
diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am
index ab0822dda35..b75588f9fce 100644
--- a/src/locking/Makefile.inc.am
+++ b/src/locking/Makefile.inc.am
@@ -130,12 +130,10 @@ virtlockd_CFLAGS = \
 	-I$(builddir)/locking \
 	-I$(builddir)/rpc \
 	$(AM_CFLAGS) \
-	$(PIE_CFLAGS) \
 	$(XDR_CFLAGS) \
 	$(NULL)
 virtlockd_LDFLAGS = \
 	$(AM_LDFLAGS) \
-	$(PIE_LDFLAGS) \
 	$(XDR_LIBS) \
 	$(NO_UNDEFINED_LDFLAGS) \
 	$(NULL)
@@ -182,11 +180,9 @@ libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
 libvirt_sanlock_helper_CFLAGS = \
 	-I$(srcdir)/conf \
 	$(AM_CFLAGS) \
-	$(PIE_CFLAGS) \
 	$(NULL)
 libvirt_sanlock_helper_LDFLAGS = \
 	$(AM_LDFLAGS) \
-	$(PIE_LDFLAGS) \
 	$(NULL)
 libvirt_sanlock_helper_LDADD = \
 	libvirt.la \
diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am
index 74987c63845..9aa634b126b 100644
--- a/src/logging/Makefile.inc.am
+++ b/src/logging/Makefile.inc.am
@@ -76,12 +76,10 @@ virtlogd_CFLAGS = \
 		-I$(builddir)/logging \
 		-I$(builddir)/rpc \
 		$(AM_CFLAGS) \
-		$(PIE_CFLAGS) \
 		$(XDR_CFLAGS) \
 		$(NULL)
 virtlogd_LDFLAGS = \
 		$(AM_LDFLAGS) \
-		$(PIE_LDFLAGS) \
 		$(XDR_LIBS) \
 		$(NO_UNDEFINED_LDFLAGS) \
 		$(NULL)
diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am
index c9201110071..031aed14203 100644
--- a/src/lxc/Makefile.inc.am
+++ b/src/lxc/Makefile.inc.am
@@ -197,7 +197,6 @@ nodist_libvirt_lxc_SOURCES = \
 	$(NULL)
 libvirt_lxc_LDFLAGS = \
 	$(AM_LDFLAGS) \
-	$(PIE_LDFLAGS) \
 	$(CAPNG_LIBS) \
 	$(LIBXML_LIBS) \
 	$(GLIB_LIBS) \
@@ -217,7 +216,6 @@ libvirt_lxc_CFLAGS = \
 	-I$(builddir)/rpc \
 	-I$(srcdir)/hypervisor \
 	$(AM_CFLAGS) \
-	$(PIE_CFLAGS) \
 	$(CAPNG_CFLAGS) \
 	$(LIBXML_CFLAGS) \
 	$(GLIB_CFLAGS) \
diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am
index 9a1a3717073..5a5d1630a08 100644
--- a/src/network/Makefile.inc.am
+++ b/src/network/Makefile.inc.am
@@ -126,7 +126,6 @@ libexec_PROGRAMS += libvirt_leaseshelper
 libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
 libvirt_leaseshelper_LDFLAGS = \
 	$(AM_LDFLAGS) \
-	$(PIE_LDFLAGS) \
 	$(NULL)
 libvirt_leaseshelper_LDADD = \
 	libvirt.la \
@@ -138,7 +137,6 @@ endif WITH_DTRACE_PROBES
 
 libvirt_leaseshelper_CFLAGS = \
 	$(AM_CFLAGS) \
-	$(PIE_CFLAGS) \
 	$(NULL)
 
 INSTALL_DATA_DIRS += network
diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am
index 165a7cced60..341f429b773 100644
--- a/src/remote/Makefile.inc.am
+++ b/src/remote/Makefile.inc.am
@@ -41,7 +41,6 @@ REMOTE_DAEMON_CFLAGS = \
 	$(XDR_CFLAGS) \
 	$(DBUS_CFLAGS) \
 	$(LIBNL_CFLAGS) \
-	$(PIE_CFLAGS) \
 	-I$(srcdir)/access \
 	-I$(builddir)/access \
 	-I$(srcdir)/conf \
@@ -52,7 +51,6 @@ REMOTE_DAEMON_CFLAGS = \
 
 REMOTE_DAEMON_LD_FLAGS = \
 	$(AM_LDFLAGS) \
-	$(PIE_LDFLAGS) \
 	$(NO_UNDEFINED_LDFLAGS) \
 	$(NULL)
 
diff --git a/src/security/Makefile.inc.am b/src/security/Makefile.inc.am
index 871245a035f..ec24931a80a 100644
--- a/src/security/Makefile.inc.am
+++ b/src/security/Makefile.inc.am
@@ -74,7 +74,6 @@ virt_aa_helper_SOURCES = $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)
 
 virt_aa_helper_LDFLAGS = \
 	$(AM_LDFLAGS) \
-	$(PIE_LDFLAGS) \
 	$(NULL)
 virt_aa_helper_LDADD = \
 	libvirt.la \
@@ -89,7 +88,6 @@ virt_aa_helper_CFLAGS = \
 	-I$(top_srcdir)/src/hypervisor \
 	-I$(srcdir)/security \
 	$(AM_CFLAGS) \
-	$(PIE_CFLAGS) \
 	$(NULL)
 endif WITH_LIBVIRTD
 endif WITH_SECDRIVER_APPARMOR
diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am
index 43010ee9664..e201b9938d9 100644
--- a/src/storage/Makefile.inc.am
+++ b/src/storage/Makefile.inc.am
@@ -437,7 +437,6 @@ libexec_PROGRAMS += libvirt_parthelper
 libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
 libvirt_parthelper_LDFLAGS = \
 	$(AM_LDFLAGS) \
-	$(PIE_LDFLAGS) \
 	$(NULL)
 libvirt_parthelper_LDADD = \
 	$(LIBPARTED_LIBS) \
@@ -451,6 +450,5 @@ endif WITH_DTRACE_PROBES
 libvirt_parthelper_CFLAGS = \
 	$(LIBPARTED_CFLAGS) \
 	$(AM_CFLAGS) \
-	$(PIE_CFLAGS) \
 	$(NULL)
 endif WITH_STORAGE_DISK
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 0530e439a8b..19c3b88777c 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -31,7 +31,6 @@ STANDALONE_CPPFLAGS = -I$(top_srcdir)
 AM_CFLAGS = \
 	$(WARN_CFLAGS) \
 	$(COVERAGE_CFLAGS) \
-	$(PIE_CFLAGS) \
 	$(LIBXML_CFLAGS) \
 	$(GLIB_CFLAGS) \
 	$(NULL)
@@ -92,7 +91,6 @@ libvirt_shell_la_CFLAGS = \
 		$(NULL)
 libvirt_shell_la_LDFLAGS = \
 		$(AM_LDFLAGS) \
-		$(PIE_LDFLAGS) \
 		$(COVERAGE_LDFLAGS) \
 		$(NULL)
 libvirt_shell_la_LIBADD = \
@@ -132,7 +130,6 @@ endif ! WITH_BHYVE
 
 virt_host_validate_LDFLAGS = \
 		$(AM_LDFLAGS) \
-		$(PIE_LDFLAGS) \
 		$(COVERAGE_LDFLAGS) \
 		$(NULL)
 
@@ -158,7 +155,6 @@ virt_login_shell_helper_SOURCES = \
 
 virt_login_shell_helper_LDFLAGS = \
 		$(AM_LDFLAGS) \
-		$(PIE_LDFLAGS) \
 		$(COVERAGE_LDFLAGS) \
 		$(NULL)
 virt_login_shell_helper_LDADD = \
@@ -204,7 +200,6 @@ virsh_SOURCES = \
 
 virsh_LDFLAGS = \
 		$(AM_LDFLAGS) \
-		$(PIE_LDFLAGS) \
 		$(COVERAGE_LDFLAGS) \
 		$(NULL)
 virsh_LDADD = \
@@ -225,7 +220,6 @@ virt_admin_LDFLAGS = \
 		$(AM_LDFLAGS) \
 		$(COVERAGE_LDFLAGS) \
 		$(STATIC_BINARIES) \
-		$(PIE_LDFLAGS) \
 		$(NULL)
 virt_admin_LDADD = \
 		../src/libvirt-admin.la \
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux