lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sun, 25 Dec 2016 15:39:31 +0800
From:   Gavin Guo <gavin.guo@...onical.com>
To:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Cc:     Gavin Guo <gavin.guo@...onical.com>,
        Hsiangkai Wang <hsiangkai@...il.com>,
        Cole Wang <cole945@...il.com>
Subject: [kvm-unit-tests PATCH] Makefile: Disable PIE as GCC enables it by default from 6.2.0-7

Build fail can be observed while the kvm-unit-tests builds on Ubuntu
Yakkety/Zesty release:

/usr/bin/ld: x86/cstart64.o: relocation R_X86_64_32 against `.data'
can not be used when making a shared object; recompile with -fPIC

and can be fixed by adding "-fno-pic" and "-no-pie" option.

There are other discussions:
- gcc-6 6.2.0-7 breaks kernel build if stack protection is enabled
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841368
- [yakkety,RFC,v1] disable -pie when gcc has it enabled by default
https://patchwork.ozlabs.org/patch/616621/
- https://wiki.ubuntu.com/YakketyYak/ReleaseNotes#GCC

Signed-off-by: Gavin Guo <gavin.guo@...onical.com>
Signed-off-by: Hsiangkai Wang <hsiangkai@...il.com>
Signed-off-by: Cole Wang <cole945@...il.com>
Tested-by: Po-Hsu Lin <po-hsu.lin@...onical.com>
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index a32333b0928e..4c9fbfbb6714 100644
--- a/Makefile
+++ b/Makefile
@@ -51,10 +51,14 @@ fomit_frame_pointer := $(call cc-option, $(frame-pointer-flag), "")
 fnostack_protector := $(call cc-option, -fno-stack-protector, "")
 fnostack_protector_all := $(call cc-option, -fno-stack-protector-all, "")
 wno_frame_address := $(call cc-option, -Wno-frame-address, "")
+fno_pic := $(call cc-option, -fno-pic, "")
+no_pie := $(call cc-option, -no-pie, "")
 CFLAGS += $(fomit_frame_pointer)
 CFLAGS += $(fno_stack_protector)
 CFLAGS += $(fno_stack_protector_all)
 CFLAGS += $(wno_frame_address)
+CFLAGS += $(fno_pic)
+CFLAGS += $(no_pie)
 
 CXXFLAGS += $(CFLAGS)
 
-- 
2.7.4

Powered by blists - more mailing lists