1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-12 07:42:56 +00:00

meson: build everything with PIE

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>
This commit is contained in:
Pavel Hrdina 2020-06-24 13:20:40 +02:00
parent 8770571e4d
commit 179797ee05
12 changed files with 1 additions and 60 deletions

@ -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

@ -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])
])

@ -5,6 +5,7 @@ project(
meson_version: '>= 0.54.0',
default_options: [
'buildtype=debugoptimized',
'b_pie=true',
'c_std=gnu99',
],
)

@ -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)

@ -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 \

@ -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)

@ -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) \

@ -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

@ -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)

@ -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

@ -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

@ -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 \