* [PATCH v2] rombios: prevent building with PIC/PIE
@ 2017-06-26 12:55 Olaf Hering
2017-06-26 13:00 ` Andrew Cooper
0 siblings, 1 reply; 4+ messages in thread
From: Olaf Hering @ 2017-06-26 12:55 UTC (permalink / raw)
To: Jan Beulich, Andrew Cooper, Ian Jackson, Wei Liu, xen-devel; +Cc: Olaf Hering
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.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
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(+)
diff --git a/tools/firmware/rombios/32bit/Makefile b/tools/firmware/rombios/32bit/Makefile
index b0583c93df..28c15444ae 100644
--- a/tools/firmware/rombios/32bit/Makefile
+++ b/tools/firmware/rombios/32bit/Makefile
@@ -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
diff --git a/tools/firmware/rombios/32bit/tcgbios/Makefile b/tools/firmware/rombios/32bit/tcgbios/Makefile
index f87d13020f..5cff4efc60 100644
--- a/tools/firmware/rombios/32bit/tcgbios/Makefile
+++ b/tools/firmware/rombios/32bit/tcgbios/Makefile
@@ -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
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] rombios: prevent building with PIC/PIE
2017-06-26 12:55 [PATCH v2] rombios: prevent building with PIC/PIE Olaf Hering
@ 2017-06-26 13:00 ` Andrew Cooper
2017-06-26 14:37 ` Andrew Cooper
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cooper @ 2017-06-26 13:00 UTC (permalink / raw)
To: Olaf Hering, Jan Beulich, Ian Jackson, Wei Liu, xen-devel
On 26/06/17 13:55, Olaf Hering wrote:
> 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.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
>
> 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(+)
>
> diff --git a/tools/firmware/rombios/32bit/Makefile b/tools/firmware/rombios/32bit/Makefile
> index b0583c93df..28c15444ae 100644
> --- a/tools/firmware/rombios/32bit/Makefile
> +++ b/tools/firmware/rombios/32bit/Makefile
> @@ -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
>
> diff --git a/tools/firmware/rombios/32bit/tcgbios/Makefile b/tools/firmware/rombios/32bit/tcgbios/Makefile
> index f87d13020f..5cff4efc60 100644
> --- a/tools/firmware/rombios/32bit/tcgbios/Makefile
> +++ b/tools/firmware/rombios/32bit/tcgbios/Makefile
> @@ -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
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] rombios: prevent building with PIC/PIE
2017-06-26 13:00 ` Andrew Cooper
@ 2017-06-26 14:37 ` Andrew Cooper
2017-08-02 9:24 ` George Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cooper @ 2017-06-26 14:37 UTC (permalink / raw)
To: Olaf Hering, Jan Beulich, Ian Jackson, Wei Liu, xen-devel
On 26/06/17 14:00, Andrew Cooper wrote:
> On 26/06/17 13:55, Olaf Hering wrote:
>> 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.
>>
>> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed, thanks.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] rombios: prevent building with PIC/PIE
2017-06-26 14:37 ` Andrew Cooper
@ 2017-08-02 9:24 ` George Dunlap
0 siblings, 0 replies; 4+ messages in thread
From: George Dunlap @ 2017-08-02 9:24 UTC (permalink / raw)
To: Andrew Cooper
Cc: Wei Liu, Olaf Hering, Ian Jackson, Jan Beulich,
xen-devel@lists.xen.org
On Mon, Jun 26, 2017 at 3:37 PM, Andrew Cooper
<andrew.cooper3@citrix.com> wrote:
> On 26/06/17 14:00, Andrew Cooper wrote:
>> On 26/06/17 13:55, Olaf Hering wrote:
>>> 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.
>>>
>>> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> 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
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-08-02 9:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-26 12:55 [PATCH v2] rombios: prevent building with PIC/PIE Olaf Hering
2017-06-26 13:00 ` Andrew Cooper
2017-06-26 14:37 ` Andrew Cooper
2017-08-02 9:24 ` George Dunlap
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).