* [PATCH kvm-unit-tests 0/5] Makefile changes/cleanups
@ 2017-01-16 13:38 Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 1/5] Makefile: Disable PIE as GCC enables it by default from 6.2.0-7 Andrew Jones
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Andrew Jones @ 2017-01-16 13:38 UTC (permalink / raw)
To: kvm; +Cc: pbonzini
Pick up Gavin's patch for building on Ubuntu Yakkety/Zesty and
add a couple cleanups to ARM's and POWER's makefiles.
Andrew Jones (4):
arm/Makefile.common cleanup
powerpc/Makefile.common cleanup
arm/Makefile.common: generated files dep cleanup
powerpc/Makefile.common: generated files dep cleanup
Gavin Guo (1):
Makefile: Disable PIE as GCC enables it by default from 6.2.0-7
Makefile | 3 +++
arm/Makefile.common | 13 ++++---------
powerpc/Makefile.common | 13 ++++---------
3 files changed, 11 insertions(+), 18 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH kvm-unit-tests 1/5] Makefile: Disable PIE as GCC enables it by default from 6.2.0-7
2017-01-16 13:38 [PATCH kvm-unit-tests 0/5] Makefile changes/cleanups Andrew Jones
@ 2017-01-16 13:38 ` Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 2/5] arm/Makefile.common cleanup Andrew Jones
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Andrew Jones @ 2017-01-16 13:38 UTC (permalink / raw)
To: kvm; +Cc: pbonzini, Gavin Guo, Hsiangkai Wang, Cole Wang
From: Gavin Guo <gavin.guo@canonical.com>
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@canonical.com>
Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com>
Signed-off-by: Cole Wang <cole945@gmail.com>
Tested-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Makefile b/Makefile
index af4e3fdfc212..16ce2970d171 100644
--- a/Makefile
+++ b/Makefile
@@ -51,11 +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 += $(if $(U32_LONG_FMT),-D__U32_LONG_FMT__,)
+CFLAGS += $(fno_pic) $(no_pie)
CXXFLAGS += $(CFLAGS)
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH kvm-unit-tests 2/5] arm/Makefile.common cleanup
2017-01-16 13:38 [PATCH kvm-unit-tests 0/5] Makefile changes/cleanups Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 1/5] Makefile: Disable PIE as GCC enables it by default from 6.2.0-7 Andrew Jones
@ 2017-01-16 13:38 ` Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 3/5] powerpc/Makefile.common cleanup Andrew Jones
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Andrew Jones @ 2017-01-16 13:38 UTC (permalink / raw)
To: kvm; +Cc: pbonzini
We no longer need to add -fno-pic in the arm makefile. It's now
added at the top-level.
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
arm/Makefile.common | 1 -
1 file changed, 1 deletion(-)
diff --git a/arm/Makefile.common b/arm/Makefile.common
index 5b7d57e77aab..6142c3d219dd 100644
--- a/arm/Makefile.common
+++ b/arm/Makefile.common
@@ -22,7 +22,6 @@ phys_base = $(LOADADDR)
CFLAGS += -std=gnu99
CFLAGS += -ffreestanding
-CFLAGS += -fno-pic
CFLAGS += -Wextra
CFLAGS += -O2
CFLAGS += -I lib -I lib/libfdt
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH kvm-unit-tests 3/5] powerpc/Makefile.common cleanup
2017-01-16 13:38 [PATCH kvm-unit-tests 0/5] Makefile changes/cleanups Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 1/5] Makefile: Disable PIE as GCC enables it by default from 6.2.0-7 Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 2/5] arm/Makefile.common cleanup Andrew Jones
@ 2017-01-16 13:38 ` Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 4/5] arm/Makefile.common: generated files dep cleanup Andrew Jones
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Andrew Jones @ 2017-01-16 13:38 UTC (permalink / raw)
To: kvm; +Cc: pbonzini
Remove -fpie from CFLAGS, which is unnecessary, and now, with the
addition of -no-pie to the common Makefile, even confusing.
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
powerpc/Makefile.common | 1 -
1 file changed, 1 deletion(-)
diff --git a/powerpc/Makefile.common b/powerpc/Makefile.common
index 93e4f66c8dbf..1bcf0412fcf5 100644
--- a/powerpc/Makefile.common
+++ b/powerpc/Makefile.common
@@ -21,7 +21,6 @@ CFLAGS += -Wextra
CFLAGS += -O2
CFLAGS += -I lib -I lib/libfdt
CFLAGS += -Wa,-mregnames
-CFLAGS += -fpie
# We want to keep intermediate files
.PRECIOUS: %.o
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH kvm-unit-tests 4/5] arm/Makefile.common: generated files dep cleanup
2017-01-16 13:38 [PATCH kvm-unit-tests 0/5] Makefile changes/cleanups Andrew Jones
` (2 preceding siblings ...)
2017-01-16 13:38 ` [PATCH kvm-unit-tests 3/5] powerpc/Makefile.common cleanup Andrew Jones
@ 2017-01-16 13:38 ` Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 5/5] powerpc/Makefile.common: " Andrew Jones
2017-01-20 17:37 ` [PATCH kvm-unit-tests 0/5] Makefile changes/cleanups Radim Krčmář
5 siblings, 0 replies; 7+ messages in thread
From: Andrew Jones @ 2017-01-16 13:38 UTC (permalink / raw)
To: kvm; +Cc: pbonzini
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
arm/Makefile.common | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/arm/Makefile.common b/arm/Makefile.common
index 6142c3d219dd..f7193c3e6d64 100644
--- a/arm/Makefile.common
+++ b/arm/Makefile.common
@@ -15,7 +15,8 @@ tests-common += $(TEST_DIR)/pci-test.flat
tests-common += $(TEST_DIR)/pmu.flat
tests-common += $(TEST_DIR)/gic.flat
-all: test_cases
+tests-all = $(tests-common) $(tests)
+all: $(tests-all)
##################################################################
phys_base = $(LOADADDR)
@@ -74,10 +75,5 @@ arm_clean: libfdt_clean asm_offsets_clean
$(RM) $(TEST_DIR)/*.{o,flat,elf} $(libeabi) $(eabiobjs) \
$(TEST_DIR)/.*.d lib/arm/.*.d
-##################################################################
-
-generated_files = $(asm-offsets)
-
-test_cases: $(generated_files) $(tests-common) $(tests)
-
-$(TEST_DIR)/selftest.o $(cstart.o): $(asm-offsets)
+generated-files = $(asm-offsets)
+$(tests-all:.flat=.o) $(cstart.o) $(cflatobjs): $(generated-files)
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH kvm-unit-tests 5/5] powerpc/Makefile.common: generated files dep cleanup
2017-01-16 13:38 [PATCH kvm-unit-tests 0/5] Makefile changes/cleanups Andrew Jones
` (3 preceding siblings ...)
2017-01-16 13:38 ` [PATCH kvm-unit-tests 4/5] arm/Makefile.common: generated files dep cleanup Andrew Jones
@ 2017-01-16 13:38 ` Andrew Jones
2017-01-20 17:37 ` [PATCH kvm-unit-tests 0/5] Makefile changes/cleanups Radim Krčmář
5 siblings, 0 replies; 7+ messages in thread
From: Andrew Jones @ 2017-01-16 13:38 UTC (permalink / raw)
To: kvm; +Cc: pbonzini
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
powerpc/Makefile.common | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/powerpc/Makefile.common b/powerpc/Makefile.common
index 1bcf0412fcf5..37f8caa720b7 100644
--- a/powerpc/Makefile.common
+++ b/powerpc/Makefile.common
@@ -11,7 +11,8 @@ tests-common = \
$(TEST_DIR)/emulator.elf \
$(TEST_DIR)/tm.elf
-all: $(TEST_DIR)/boot_rom.bin test_cases
+tests-all = $(tests-common) $(tests)
+all: $(TEST_DIR)/boot_rom.bin $(tests-all)
##################################################################
@@ -69,10 +70,5 @@ powerpc_clean: libfdt_clean asm_offsets_clean
$(RM) $(TEST_DIR)/*.{o,elf} $(TEST_DIR)/boot_rom.bin \
$(TEST_DIR)/.*.d lib/powerpc/.*.d
-##################################################################
-
-generated_files = $(asm-offsets)
-
-test_cases: $(generated_files) $(tests-common) $(tests)
-
-$(cstart.o): $(asm-offsets)
+generated-files = $(asm-offsets)
+$(tests-all:.elf=.o) $(cstart.o) $(cflatobjs): $(generated-files)
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH kvm-unit-tests 0/5] Makefile changes/cleanups
2017-01-16 13:38 [PATCH kvm-unit-tests 0/5] Makefile changes/cleanups Andrew Jones
` (4 preceding siblings ...)
2017-01-16 13:38 ` [PATCH kvm-unit-tests 5/5] powerpc/Makefile.common: " Andrew Jones
@ 2017-01-20 17:37 ` Radim Krčmář
5 siblings, 0 replies; 7+ messages in thread
From: Radim Krčmář @ 2017-01-20 17:37 UTC (permalink / raw)
To: Andrew Jones; +Cc: kvm, pbonzini
2017-01-16 14:38+0100, Andrew Jones:
> Pick up Gavin's patch for building on Ubuntu Yakkety/Zesty and
> add a couple cleanups to ARM's and POWER's makefiles.
Applied, thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-01-20 17:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-16 13:38 [PATCH kvm-unit-tests 0/5] Makefile changes/cleanups Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 1/5] Makefile: Disable PIE as GCC enables it by default from 6.2.0-7 Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 2/5] arm/Makefile.common cleanup Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 3/5] powerpc/Makefile.common cleanup Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 4/5] arm/Makefile.common: generated files dep cleanup Andrew Jones
2017-01-16 13:38 ` [PATCH kvm-unit-tests 5/5] powerpc/Makefile.common: " Andrew Jones
2017-01-20 17:37 ` [PATCH kvm-unit-tests 0/5] Makefile changes/cleanups Radim Krčmář
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).