* [PATCH] rombios: prevent building with PIC
@ 2017-06-23 17:26 Olaf Hering
2017-06-23 17:28 ` Wei Liu
2017-06-26 6:30 ` Jan Beulich
0 siblings, 2 replies; 10+ messages in thread
From: Olaf Hering @ 2017-06-23 17:26 UTC (permalink / raw)
To: 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 mode.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
build tested with staging-4.9.
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, 2 insertions(+), 2 deletions(-)
diff --git a/tools/firmware/rombios/32bit/Makefile b/tools/firmware/rombios/32bit/Makefile
index b0583c93df..97657ae7b1 100644
--- a/tools/firmware/rombios/32bit/Makefile
+++ b/tools/firmware/rombios/32bit/Makefile
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/firmware/Rules.mk
TARGET = 32bitbios_flat.h
-CFLAGS += $(CFLAGS_xeninclude) -I.. -I../../../libacpi
+CFLAGS += $(CFLAGS_xeninclude) -I.. -I../../../libacpi -fno-pic
SUBDIRS = tcgbios
diff --git a/tools/firmware/rombios/32bit/tcgbios/Makefile b/tools/firmware/rombios/32bit/tcgbios/Makefile
index f87d13020f..2e3729910f 100644
--- a/tools/firmware/rombios/32bit/tcgbios/Makefile
+++ b/tools/firmware/rombios/32bit/tcgbios/Makefile
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/firmware/Rules.mk
TARGET = tcgbiosext.o
-CFLAGS += $(CFLAGS_xeninclude) -I.. -I../.. -I../../../../libacpi
+CFLAGS += $(CFLAGS_xeninclude) -I.. -I../.. -I../../../../libacpi -fno-pic
.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] 10+ messages in thread
* Re: [PATCH] rombios: prevent building with PIC
2017-06-23 17:26 [PATCH] rombios: prevent building with PIC Olaf Hering
@ 2017-06-23 17:28 ` Wei Liu
2017-06-23 17:40 ` Olaf Hering
2017-06-26 6:30 ` Jan Beulich
1 sibling, 1 reply; 10+ messages in thread
From: Wei Liu @ 2017-06-23 17:28 UTC (permalink / raw)
To: Olaf Hering; +Cc: Wei Liu, Ian Jackson, xen-devel
On Fri, Jun 23, 2017 at 07:26:01PM +0200, 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 mode.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
Do you need to check if the compiler supports -fno-pic?
I know not every version of gcc support -fno-pie, but I'm not sure about
-fno-pic. In any case, there is already something in our build system to
deal with testing gcc options, which would be useful to you.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rombios: prevent building with PIC
2017-06-23 17:28 ` Wei Liu
@ 2017-06-23 17:40 ` Olaf Hering
2017-06-23 17:43 ` Wei Liu
0 siblings, 1 reply; 10+ messages in thread
From: Olaf Hering @ 2017-06-23 17:40 UTC (permalink / raw)
To: Wei Liu; +Cc: Ian Jackson, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 151 bytes --]
On Fri, Jun 23, Wei Liu wrote:
> Do you need to check if the compiler supports -fno-pic?
In my testing gcc-4.3 and 4.5 know about this option.
Olaf
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rombios: prevent building with PIC
2017-06-23 17:40 ` Olaf Hering
@ 2017-06-23 17:43 ` Wei Liu
2017-06-23 17:53 ` Olaf Hering
2017-06-23 18:01 ` Olaf Hering
0 siblings, 2 replies; 10+ messages in thread
From: Wei Liu @ 2017-06-23 17:43 UTC (permalink / raw)
To: Olaf Hering; +Cc: Ian Jackson, Wei Liu, xen-devel
On Fri, Jun 23, 2017 at 07:40:36PM +0200, Olaf Hering wrote:
> On Fri, Jun 23, Wei Liu wrote:
>
> > Do you need to check if the compiler supports -fno-pic?
>
> In my testing gcc-4.3 and 4.5 know about this option.
>
We support >=4.1. Please check those as well.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rombios: prevent building with PIC
2017-06-23 17:43 ` Wei Liu
@ 2017-06-23 17:53 ` Olaf Hering
2017-06-23 18:01 ` Olaf Hering
1 sibling, 0 replies; 10+ messages in thread
From: Olaf Hering @ 2017-06-23 17:53 UTC (permalink / raw)
To: Wei Liu; +Cc: Ian Jackson, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 273 bytes --]
On Fri, Jun 23, Wei Liu wrote:
> We support >=4.1. Please check those as well.
According to the PDF manuals at https://gcc.gnu.org/onlinedocs/ a
"-fno-foo" is mentioned, so I think -fno-pic is recognized. I will see
if I find a copy of SLE10 to verify with 4.1.2.
Olaf
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rombios: prevent building with PIC
2017-06-23 17:43 ` Wei Liu
2017-06-23 17:53 ` Olaf Hering
@ 2017-06-23 18:01 ` Olaf Hering
1 sibling, 0 replies; 10+ messages in thread
From: Olaf Hering @ 2017-06-23 18:01 UTC (permalink / raw)
To: Wei Liu; +Cc: Ian Jackson, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 113 bytes --]
On Fri, Jun 23, Wei Liu wrote:
> We support >=4.1. Please check those as well.
Yes, 4.1.2 works as well.
Olaf
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rombios: prevent building with PIC
2017-06-23 17:26 [PATCH] rombios: prevent building with PIC Olaf Hering
2017-06-23 17:28 ` Wei Liu
@ 2017-06-26 6:30 ` Jan Beulich
2017-06-26 6:46 ` Olaf Hering
1 sibling, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2017-06-26 6:30 UTC (permalink / raw)
To: olaf; +Cc: ian.jackson, wei.liu2, xen-devel
>>> Olaf Hering <olaf@aepfle.de> 06/23/17 7:27 PM >>>
>--- a/tools/firmware/rombios/32bit/Makefile
>+++ b/tools/firmware/rombios/32bit/Makefile
>@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/firmware/Rules.mk
>
>TARGET = 32bitbios_flat.h
>
>-CFLAGS += $(CFLAGS_xeninclude) -I.. -I../../../libacpi
>+CFLAGS += $(CFLAGS_xeninclude) -I.. -I../../../libacpi -fno-pic
In the description you also talk about PIE, but you deal with PIC only here. Is
that intentional? If so, please say why in the description.
Also, as to the Cc list - maintainership of rombios/ has recently changed.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rombios: prevent building with PIC
2017-06-26 6:30 ` Jan Beulich
@ 2017-06-26 6:46 ` Olaf Hering
2017-06-26 11:55 ` Jan Beulich
0 siblings, 1 reply; 10+ messages in thread
From: Olaf Hering @ 2017-06-26 6:46 UTC (permalink / raw)
To: Jan Beulich; +Cc: ian.jackson, wei.liu2, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 459 bytes --]
Am Mon, 26 Jun 2017 00:30:50 -0600
schrieb "Jan Beulich" <jbeulich@suse.com>:
> In the description you also talk about PIE, but you deal with PIC only here. Is that intentional? If so, please say why in the description.
Thats what the URL says. Unclear what the connection between -fpic and -fPIE (?) is.
> Also, as to the Cc list - maintainership of rombios/ has recently changed.
Thats what --to-cmd=scripts/getmaintainer.pl gives me.
Olaf
[-- Attachment #1.2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rombios: prevent building with PIC
2017-06-26 6:46 ` Olaf Hering
@ 2017-06-26 11:55 ` Jan Beulich
2017-06-26 12:57 ` Olaf Hering
0 siblings, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2017-06-26 11:55 UTC (permalink / raw)
To: olaf; +Cc: ian.jackson, wei.liu2, xen-devel
>>> Olaf Hering <olaf@aepfle.de> 06/26/17 8:47 AM >>>
>Am Mon, 26 Jun 2017 00:30:50 -0600
>schrieb "Jan Beulich" <jbeulich@suse.com>:
>
>> In the description you also talk about PIE, but you deal with PIC only here. Is that intentional? If so, please say why in the description.
>
>Thats what the URL says. Unclear what the connection between -fpic and -fPIE (?) is.
Unlike PIC, PIE was introduced later, yet might still be defaulted to. Hence it may
be necessary to also deal with that, instead of just addressing one half. Yet it
would mean detecting PIE support in the compiler, other than PIC, which - as
you've verified - is available everywhere we care about.
>> Also, as to the Cc list - maintainership of rombios/ has recently changed.
>
>Thats what --to-cmd=scripts/getmaintainer.pl gives me.
In the unstable staging tree? That would seem wrong.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rombios: prevent building with PIC
2017-06-26 11:55 ` Jan Beulich
@ 2017-06-26 12:57 ` Olaf Hering
0 siblings, 0 replies; 10+ messages in thread
From: Olaf Hering @ 2017-06-26 12:57 UTC (permalink / raw)
To: Jan Beulich; +Cc: ian.jackson, wei.liu2, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 487 bytes --]
Am Mon, 26 Jun 2017 05:55:17 -0600
schrieb "Jan Beulich" <jbeulich@suse.com>:
> Unlike PIC, PIE was introduced later, yet might still be defaulted to. Hence it may be necessary to also deal with that, instead of just addressing one half.
There is now v2 which uses cc-option-add
> In the unstable staging tree? That would seem wrong.
I ran git send-email from staging-4.9. Sorry for that.
Perhaps MAINTAINER changes should be merged unconditional into staging-x.y
Olaf
[-- Attachment #1.2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-06-26 12:57 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-23 17:26 [PATCH] rombios: prevent building with PIC Olaf Hering
2017-06-23 17:28 ` Wei Liu
2017-06-23 17:40 ` Olaf Hering
2017-06-23 17:43 ` Wei Liu
2017-06-23 17:53 ` Olaf Hering
2017-06-23 18:01 ` Olaf Hering
2017-06-26 6:30 ` Jan Beulich
2017-06-26 6:46 ` Olaf Hering
2017-06-26 11:55 ` Jan Beulich
2017-06-26 12:57 ` Olaf Hering
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.