[Pkg-virtualbox-commits] [virtualbox] 01/01: Upload on unstable, with patch from Frank Mehnert to fix -pie issue

Gianfranco Costamagna locutusofborg-guest at moszumanska.debian.org
Fri May 20 12:49:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

locutusofborg-guest pushed a commit to branch master
in repository virtualbox.

commit 14f6c85473c958324291849e939c10703ebb5490
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date:   Fri May 20 14:27:40 2016 +0200

    Upload on unstable, with patch from Frank Mehnert to fix -pie issue
---
 debian/changelog                 |   7 +-
 debian/patches/fix-gcc-pie.patch | 163 +++++++++++++++++++++++++++++++++++++++
 debian/patches/series            |   1 +
 debian/rules                     |   2 +
 4 files changed, 172 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 96879e4..5e384e3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,16 @@
-virtualbox (5.0.20-dfsg-2) UNRELEASED; urgency=medium
+virtualbox (5.0.20-dfsg-2) unstable; urgency=medium
 
   [ Guillem Jover ]
   * make LSB init script have more consistent output (Closes: #823086).
 
+  [ Frank Mehnert ]
+  * Pass -fno-pie, to avoid build failures with gcc and default pie enabled.
+    (LP: #1578424)
+
   [ Gianfranco Costamagna ]
   * Remove in pdf manual the update section (Closes: #823343)
     - thanks qazwsxedc for the bug report!
+  * debian/patches/patch_vbox_5.patch: [DESCRIBE CHANGES HERE]
 
  -- Gianfranco Costamagna <locutusofborg at debian.org>  Sun, 01 May 2016 20:28:45 +0200
 
diff --git a/debian/patches/fix-gcc-pie.patch b/debian/patches/fix-gcc-pie.patch
new file mode 100644
index 0000000..9860906
--- /dev/null
+++ b/debian/patches/fix-gcc-pie.patch
@@ -0,0 +1,163 @@
+Author: Frank Mehnert
+Description: add no-pie for gcc built with explicit pie support.
+
+--- virtualbox-5.0.20-dfsg.orig/Config.kmk
++++ virtualbox-5.0.20-dfsg/Config.kmk
+@@ -2460,6 +2460,7 @@ $(PATH_OUT)/DynamicConfig.kmk: \
+ 	$(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-overlength-strings?= $(call VBOX_GCC_CHECK_CC,-Wno-overlength-strings,)'
+ 	$(QUIET)$(APPEND) '$@' 'VBOX_GCC_fno-stack-protector   ?= $(call VBOX_GCC_CHECK_CC,-fno-stack-protector,)'
+ 	$(QUIET)$(APPEND) '$@' 'VBOX_GCC_fno-dwarf2-cfi-asm    ?= $(call VBOX_GCC_CHECK_CC,-fno-dwarf2-cfi-asm,)'
++	$(QUIET)$(APPEND) '$@' 'VBOX_GCC_no-pie                ?= $(call VBOX_GCC_CHECK_CC,-no-pie,)'
+ 	$(QUIET)$(APPEND) '$@' 'VBOX_GCC_fdiagnostics-show-option ?= $(call VBOX_GCC_CHECK_CC,-fdiagnostics-show-option,)'
+ # Produce code optimized for the most common IA32/AMD64/EM64T processors. Introduced with gcc version 4.2.
+ 	$(QUIET)$(APPEND) '$@' 'VBOX_GCC_mtune-generic         ?= $(call VBOX_GCC_CHECK_CC,-mtune=generic,)'
+@@ -3525,8 +3526,8 @@ ifdef VBOX_WITH_RAW_MODE
+ 
+  ifeq ($(VBOX_LDR_FMT32),elf)
+  TEMPLATE_VBoxRc_TOOL                = $(VBOX_GCC32_TOOL)
+- TEMPLATE_VBoxRc_CXXFLAGS            = -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
+- TEMPLATE_VBoxRc_CFLAGS              = -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C)   $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_IPRT_FMT_CHECK)
++ TEMPLATE_VBoxRc_CXXFLAGS            = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
++ TEMPLATE_VBoxRc_CFLAGS              = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C)   $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_IPRT_FMT_CHECK)
+   ifeq ($(KBUILD_TARGET),solaris)
+    TEMPLATE_VBoxRc_LDFLAGS           = -r
+   else
+@@ -3665,8 +3666,8 @@ endif # pe
+ 
+ ifeq ($(VBOX_LDR_FMT),elf)
+ TEMPLATE_VBoxR0_TOOL                = $(VBOX_GCC_TOOL)
+-TEMPLATE_VBoxR0_CFLAGS              = -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C)   $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK)
+-TEMPLATE_VBoxR0_CXXFLAGS            = -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
++TEMPLATE_VBoxR0_CFLAGS              = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C)   $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK)
++TEMPLATE_VBoxR0_CXXFLAGS            = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
+ TEMPLATE_VBoxR0_CFLAGS.amd64        = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding
+ TEMPLATE_VBoxR0_CXXFLAGS.amd64      = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables
+ ifeq ($(KBUILD_TARGET),solaris)
+@@ -3770,7 +3771,7 @@ TEMPLATE_VBOXR0DRV_TOOL                =
+ TEMPLATE_VBOXR0DRV_INSTTYPE.linux      = none
+ TEMPLATE_VBOXR0DRV_DEFS               += __KERNEL__ MODULE
+ TEMPLATE_VBOXR0DRV_INCS                = $(VBOX_LINUX_INCS)
+-TEMPLATE_VBOXR0DRV_CFLAGS              = -nostdinc -iwithprefix include $(VBOX_LINUX_INCLUDE) \
++TEMPLATE_VBOXR0DRV_CFLAGS              = -fno-pie -nostdinc -iwithprefix include $(VBOX_LINUX_INCLUDE) \
+ 	$(VBOX_GCC_WARN) -Wstrict-prototypes $(VBOX_GCC_Wno-pointer-sign) -Wno-sign-compare $(VBOX_GCC_fdiagnostics-show-option) \
+ 	$(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
+ 	-fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
+@@ -5839,8 +5840,8 @@ if1of ($(KBUILD_TARGET), dragonfly freeb
+  TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.x86     = -m elf_i386
+  TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.amd64   = -m elf_x86_64
+ endif
+-TEMPLATE_VBOXGUESTR3XF86MOD_CFLAGS  = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS)   -fno-merge-constants -std=c99 -ffreestanding
+-TEMPLATE_VBOXGUESTR3XF86MOD_CXXFLAGS= $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fno-merge-constants -ffreestanding
++TEMPLATE_VBOXGUESTR3XF86MOD_CFLAGS  = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS) -fno-pie -fno-merge-constants -std=c99 -ffreestanding
++TEMPLATE_VBOXGUESTR3XF86MOD_CXXFLAGS= $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fno-pie -fno-merge-constants -ffreestanding
+ ifeq ($(VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE),)
+  TEMPLATE_VBOXGUESTR3XF86MOD_CFLAGS   += $(VBOX_GCC_fno-stack-protector)
+  TEMPLATE_VBOXGUESTR3XF86MOD_CXXFLAGS += $(VBOX_GCC_fno-stack-protector)
+--- virtualbox-5.0.20-dfsg.orig/src/VBox/Additions/common/VBoxGuest/linux/Makefile
++++ virtualbox-5.0.20-dfsg/src/VBox/Additions/common/VBoxGuest/linux/Makefile
+@@ -129,7 +129,7 @@ ifeq ($(KERN_VERSION),24)
+  ## @todo move to MOD_DEFS when we have finished refactoring
+  MOD_CFLAGS = -DEXPORT_SYMTAB
+ else
+- MOD_CFLAGS = -Wno-declaration-after-statement -include $(MANGLING)
++ MOD_CFLAGS = -Wno-declaration-after-statement -include $(MANGLING) -fno-pie
+ endif
+ 
+ MOD_CLEAN = . linux r0drv generic r0drv/linux r0drv/generic VBox \
+--- virtualbox-5.0.20-dfsg.orig/src/VBox/Additions/linux/drm/Makefile.module.kms
++++ virtualbox-5.0.20-dfsg/src/VBox/Additions/linux/drm/Makefile.module.kms
+@@ -37,7 +37,7 @@ ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxv
+ else
+  MANGLING := $(KBUILD_EXTMOD)/include/VBox/VBoxGuestMangling.h
+ endif
+-MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -include $(MANGLING)
++MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -include $(MANGLING) -fno-pie
+ MOD_INCL   = $(addprefix -I$(KBUILD_EXTMOD),/ /include)
+ # What on earth is this?
+ MOD_INCL  += $(addprefix -I$(KBUILD_EXTMOD)/vboxvideo,/ /include)
+--- virtualbox-5.0.20-dfsg.orig/src/VBox/Additions/linux/sharedfolders/Makefile.module
++++ virtualbox-5.0.20-dfsg/src/VBox/Additions/linux/sharedfolders/Makefile.module
+@@ -65,7 +65,7 @@ endif
+ ifeq ($(KERN_VERSION), 24)
+  MOD_CFLAGS =
+ else
+- MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -include $(MANGLING)
++ MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -include $(MANGLING) -fno-pie
+ 
+ # special hack for Fedora Core 6 2.6.18 (fc6), rhel5 2.6.18 (el5),
+ # ClarkConnect 4.3 (cc4) and ClarkConnect 5 (v5)
+--- virtualbox-5.0.20-dfsg.orig/src/VBox/Devices/PC/ipxe/Makefile.kmk
++++ virtualbox-5.0.20-dfsg/src/VBox/Devices/PC/ipxe/Makefile.kmk
+@@ -110,6 +110,7 @@ else
+ endif
+  TEMPLATE_iPxe_LNK_DEPS = $(VBOX_PATH_IPXE_SRC)/src/arch/i386/scripts/i386.lds
+  TEMPLATE_iPxe_CFLAGS  = \
++	-fno-pie \
+ 	-ffreestanding \
+ 	-ffunction-sections \
+ 	-march=i386 \
+--- virtualbox-5.0.20-dfsg.orig/src/VBox/HostDrivers/Support/linux/Makefile
++++ virtualbox-5.0.20-dfsg/src/VBox/HostDrivers/Support/linux/Makefile
+@@ -299,7 +299,7 @@ MODULE_EXT    := ko
+ $(MODULE)-y   := $(OBJS)
+ 
+ # build defs
+-EXTRA_CFLAGS  += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG)
++EXTRA_CFLAGS  += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG) -fno-pie
+ 
+ all: $(MODULE)
+ 
+--- virtualbox-5.0.20-dfsg.orig/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile
++++ virtualbox-5.0.20-dfsg/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile
+@@ -202,7 +202,7 @@ MODULE_EXT    := ko
+ $(MODULE)-y   := $(OBJS)
+ 
+ # build defs
+-EXTRA_CFLAGS  += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG)
++EXTRA_CFLAGS  += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG) -fno-pie
+ 
+ all: $(MODULE)
+ 
+--- virtualbox-5.0.20-dfsg.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/Makefile
++++ virtualbox-5.0.20-dfsg/src/VBox/HostDrivers/VBoxNetFlt/linux/Makefile
+@@ -206,7 +206,7 @@ MODULE_EXT    := ko
+ $(MODULE)-y   := $(OBJS)
+ 
+ # build defs
+-EXTRA_CFLAGS  += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG)
++EXTRA_CFLAGS  += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG) -fno-pie
+ 
+ all: $(MODULE)
+ 
+--- virtualbox-5.0.20-dfsg.orig/src/VBox/HostDrivers/VBoxPci/linux/Makefile
++++ virtualbox-5.0.20-dfsg/src/VBox/HostDrivers/VBoxPci/linux/Makefile
+@@ -205,7 +205,7 @@ MODULE_EXT    := ko
+ $(MODULE)-y   := $(OBJS)
+ 
+ # build defs
+-EXTRA_CFLAGS  += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG)
++EXTRA_CFLAGS  += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG) -fno-pie
+ 
+ all: $(MODULE)
+ 
+--- virtualbox-5.0.20-dfsg.orig/src/VBox/Runtime/Makefile.kmk
++++ virtualbox-5.0.20-dfsg/src/VBox/Runtime/Makefile.kmk
+@@ -2893,6 +2893,8 @@ if1of ($(LIBRARIES),RuntimeR3 RuntimeR0
+ 			-e '/^g_Logger/d' \
+ 			-e '/^g_RelLogger/d' \
+ 			-e '/^g_VM/d',) \
++			$(if-expr "$(KBUILD_TARGET)" == "linux", \
++			-e '/^g_kLdrRdrFileOps/d',) \
+ 			\
+ 			-e '/^RTDBusLoadLib/d' \
+ 			\
+--- virtualbox-5.0.20-dfsg.orig/src/VBox/VMM/testcase/Makefile.kmk
++++ virtualbox-5.0.20-dfsg/src/VBox/VMM/testcase/Makefile.kmk
+@@ -344,6 +344,7 @@ tstAnimate_LIBS         = $(LIB_VMM) $(L
+ tstX86-1_TEMPLATE       = VBOXR3TSTEXE
+ tstX86-1_SOURCES        = tstX86-1.cpp tstX86-1A.asm
+ tstX86-1_LIBS           = $(LIB_RUNTIME)
++tstX86-1_LDFLAGS.linux  = $(VBOX_GCC_no-pie)
+ 
+ tstX86-FpuSaveRestore_TEMPLATE = VBOXR3TSTEXE
+ tstX86-FpuSaveRestore_SOURCES  = tstX86-FpuSaveRestore.cpp tstX86-FpuSaveRestoreA.asm
diff --git a/debian/patches/series b/debian/patches/series
index 5b32c83..90bc7be 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -14,3 +14,4 @@
 32-disable-guest-version-check.patch
 35-libvdeplug-soname.patch
 36-fix-vnc-version-string.patch
+fix-gcc-pie.patch
diff --git a/debian/rules b/debian/rules
index b410d9c..7c71243 100755
--- a/debian/rules
+++ b/debian/rules
@@ -30,6 +30,8 @@ export DEB_BUILD_HARDENING_PIE=0
 export DEB_BUILD_HARDENING_FORMAT=0
 export DEB_BUILD_HARDENING_BINDNOW=0
 
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie,-format,-bindnow
+
 %:
 	dh $@ --with python2,dkms,systemd
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-virtualbox/virtualbox.git



More information about the Pkg-virtualbox-commits mailing list