]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: build everything with PIE
authorPavel Hrdina <phrdina@redhat.com>
Wed, 24 Jun 2020 11:20:40 +0000 (13:20 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:26:39 +0000 (09:26 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
12 files changed:
configure.ac
m4/virt-compile-pie.m4 [deleted file]
meson.build
src/Makefile.am
src/locking/Makefile.inc.am
src/logging/Makefile.inc.am
src/lxc/Makefile.inc.am
src/network/Makefile.inc.am
src/remote/Makefile.inc.am
src/security/Makefile.inc.am
src/storage/Makefile.inc.am
tools/Makefile.am

index 64725b6af70ed6e3c1971997bb1e1d10a06f5696..cda488308e998c87e4ee3c447a2e34decbbe1586 100644 (file)
@@ -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 (file)
index da5cdf5..0000000
+++ /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])
-])
index ea2590ac8f37bff9e218f3963a4242d6a7298595..54e6c1732eb3018abcfc4d2b83119aeffd58f01d 100644 (file)
@@ -5,6 +5,7 @@ project(
     meson_version: '>= 0.54.0',
     default_options: [
         'buildtype=debugoptimized',
+        'b_pie=true',
         'c_std=gnu99',
     ],
 )
index 390e784c67f2fa0582583b540400d742458edac3..c3738c87fef5f720b1a4bf0e465b54effcbfe48c 100644 (file)
@@ -617,7 +617,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 \
@@ -629,7 +628,6 @@ endif WITH_DTRACE_PROBES
 
 libvirt_iohelper_CFLAGS = \
                $(AM_CFLAGS) \
-               $(PIE_CFLAGS) \
                $(NULL)
 
 
index c8247508ebaaf1a347490c7343161047771d115b..476a8521c0ddf9d38ebcece196d141614326a75d 100644 (file)
@@ -135,12 +135,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)
@@ -187,11 +185,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 \
index 2194b8cac53ba11efdac340bbcabf70d1adaf96f..133b52f3a9713ec18ca51436dbde7821c56d0ff4 100644 (file)
@@ -81,12 +81,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)
index ad4c779c15bec1c4af2ab6f55cab437d23031cd9..1154999ae5ad0f2b9f5c6e664beaec0c4c89e16a 100644 (file)
@@ -198,7 +198,6 @@ nodist_libvirt_lxc_SOURCES = \
        $(NULL)
 libvirt_lxc_LDFLAGS = \
        $(AM_LDFLAGS) \
-       $(PIE_LDFLAGS) \
        $(CAPNG_LIBS) \
        $(LIBXML_LIBS) \
        $(GLIB_LIBS) \
@@ -218,7 +217,6 @@ libvirt_lxc_CFLAGS = \
        -I$(builddir)/rpc \
        -I$(srcdir)/hypervisor \
        $(AM_CFLAGS) \
-       $(PIE_CFLAGS) \
        $(CAPNG_CFLAGS) \
        $(LIBXML_CFLAGS) \
        $(GLIB_CFLAGS) \
index 9a1a3717073e31dd8ebbad852856f65a20eeb15a..5a5d1630a087fd1656067ea27fe1943f42cfdacb 100644 (file)
@@ -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
index 572f16be05e0cfb12d1c5845eeeac26f0a087257..631b974463f951c601ea96fbf987f33389b23250 100644 (file)
@@ -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)
 
index 02b67dc70f654021ea0dcf6210114bc7981fdd1c..ec0bb5f569bc5daad5dd937d02a1690c682f250b 100644 (file)
@@ -76,7 +76,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 \
@@ -91,7 +90,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
index 43010ee9664fb529868a617c3c80eec0727d7c6e..e201b9938d9b6d32bada07ff01b82ccbeb10707c 100644 (file)
@@ -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
index d6eedbe9d501fedb2d04cd656d1de71fd405b247..34046817bd2c3340fef71ca0f0100c5a73607576 100644 (file)
@@ -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 \