rombios: prevent building with PIC/PIE
PATCH v2 1/1 rombios: prevent building with PIC/PIE
If the default compiler silently defaults to to -fPIC/-fPIE building rombios fails:
ld -melf_i386 -s -r 32bitbios.o tcgbios/tcgbiosext.o util.o pmm.o -o 32bitbios_all.o There are undefined symbols in the BIOS:
U _GLOBAL_OFFSET_TABLE_
make[10]: *** [Makefile:26: 32bitbios_all.o] Error 11
Prevent the failure by enforcing non-PIC/PIE mode.
---
build tested with staging-4.9/staging.
PIE is the default now in openSUSE Tumbleweed:
https://lists.opensuse.org/opensuse-factory/2017-06/msg00403.html
tools/firmware/rombios/32bit/Makefile | 2 ++ tools/firmware/rombios/32bit/tcgbios/Makefile | 2 ++ 2 files changed, 4 insertions(+)
tools/firmware/rombios/32bit/Makefile +2 -0
@@ -4,6 +4,8 @@ include $(XEN_ROOT)/tools/firmware/Rules.mk TARGET = 32bitbios_flat.h CFLAGS += $(CFLAGS_xeninclude) -I.. -I../../../libacpi +$(call cc-option-add,CFLAGS,CC,-fno-pic) +$(call cc-option-add,CFLAGS,CC,-fno-PIE) SUBDIRS = tcgbios
tools/firmware/rombios/32bit/tcgbios/Makefile +2 -0
@@ -4,6 +4,8 @@ include $(XEN_ROOT)/tools/firmware/Rules.mk TARGET = tcgbiosext.o CFLAGS += $(CFLAGS_xeninclude) -I.. -I../.. -I../../../../libacpi +$(call cc-option-add,CFLAGS,CC,-fno-pic) +$(call cc-option-add,CFLAGS,CC,-fno-PIE) .PHONY: all all: $(TARGET)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 11 lines · Olaf Hering
If the default compiler silently defaults to to -fPIC/-fPIE building rombios fails:
ld -melf_i386 -s -r 32bitbios.o
tcgbios/tcgbiosext.outil.o pmm.o -o 32bitbios_all.o There are undefined symbols in the BIOS:
U _GLOBAL_OFFSET_TABLE_
make[10]: *** [Makefile:26: 32bitbios_all.o] Error 11Prevent the failure by enforcing non-PIC/PIE mode.
Signed-off-by Olaf Hering <[email protected]>
Quoted 29 lines
---
build tested with staging-4.9/staging.
PIE is the default now in openSUSE Tumbleweed:
https://lists.opensuse.org/opensuse-factory/2017-06/msg00403.htmltools/firmware/rombios/32bit/Makefile | 2 ++ tools/firmware/rombios/32bit/tcgbios/Makefile | 2 ++ 2 files changed, 4 insertions(+)tools/firmware/rombios/32bit/Makefile +2
-0@@ -4,6 +4,8 @@ include $(XEN_ROOT)/tools/firmware/Rules.mk TARGET = 32bitbios_flat.h CFLAGS += $(CFLAGS_xeninclude) -I.. -I../../../libacpi +$(call cc-option-add,CFLAGS,CC,-fno-pic) +$(call cc-option-add,CFLAGS,CC,-fno-PIE) SUBDIRS = tcgbiostools/firmware/rombios/32bit/tcgbios/Makefile +0
-0
tools/firmware/rombios/32bit/tcgbios/Makefile include $(XEN_ROOT)/tools/firmware/Rules.mk · line 11
Quoted 8 lines
tools/firmware/rombios/32bit/tcgbios/Makefile +2
-0@@ -4,6 +4,8 @@ include $(XEN_ROOT)/tools/firmware/Rules.mk TARGET = tcgbiosext.o CFLAGS += $(CFLAGS_xeninclude) -I.. -I../.. -I../../../../libacpi +$(call cc-option-add,CFLAGS,CC,-fno-pic) +$(call cc-option-add,CFLAGS,CC,-fno-PIE) .PHONY: all all: $(TARGET)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 9 lines · Andrew Cooper
Quoted 8 lines · Olaf Hering
If the default compiler silently defaults to to -fPIC/-fPIE building rombios fails:
ld -melf_i386 -s -r 32bitbios.o
tcgbios/tcgbiosext.outil.o pmm.o -o 32bitbios_all.o There are undefined symbols in the BIOS:
U _GLOBAL_OFFSET_TABLE_
make[10]: *** [Makefile:26: 32bitbios_all.o] Error 11
Quoted 4 lines
Quoted 3 lines
Prevent the failure by enforcing non-PIC/PIE mode.
Signed-off-by Olaf Hering <[email protected]>Acked-by Andrew Cooper <[email protected]>
Committed, thanks.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 10 lines · Andrew Cooper
Quoted 9 lines · Andrew Cooper
Quoted 8 lines · Olaf Hering
If the default compiler silently defaults to to -fPIC/-fPIE building rombios fails:
ld -melf_i386 -s -r 32bitbios.o
tcgbios/tcgbiosext.outil.o pmm.o -o 32bitbios_all.o There are undefined symbols in the BIOS:
U _GLOBAL_OFFSET_TABLE_
make[10]: *** [Makefile:26: 32bitbios_all.o] Error 11
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Prevent the failure by enforcing non-PIC/PIE mode.
Signed-off-by Olaf Hering <[email protected]>Acked-by Andrew Cooper <[email protected]>Committed, thanks.
This needs to be backported at least to 4.8 and 4.9; sounds like maybe all supported versions as well?
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel