[SeaBIOS] [PATCH] Makefile: Explicitly pass `no-pic` to compiler

Kevin O'Connor kevin at koconnor.net
Tue Oct 25 18:14:43 CEST 2016


On Tue, Oct 25, 2016 at 06:08:08PM +0200, Paul Menzel wrote:
> On 10/25/16 17:27, Paul Menzel wrote:
> > On 10/25/16 17:21, Kevin O'Connor wrote:
> > > Does adding '-fno-pie' help?
> > 
> > Isn’t that already used due to `COMMONCFLAGS += $(call
> > cc-option,$(CC),-nopie,)` in the `Makefile`?
> > 
> > I’ll try it anyway.
> 
> That also worked. Should I sent an updated patch?

Does the patch below work?

-Kevin


commit 589fe2803b110014a84dee2056f1e2fec744d2e6
Author: Kevin O'Connor <kevin at koconnor.net>
Date:   Tue Oct 25 12:09:41 2016 -0400

    build: Add -fno-pie to the gcc flags when available
    
    Signed-off-by: Kevin O'Connor <kevin at koconnor.net>

diff --git a/Makefile b/Makefile
index 1916ecf..3b94ee0 100644
--- a/Makefile
+++ b/Makefile
@@ -63,6 +63,7 @@ COMMONCFLAGS := -I$(OUT) -Isrc -Os -MD -g \
     -freg-struct-return -ffreestanding -fno-delete-null-pointer-checks \
     -ffunction-sections -fdata-sections -fno-common -fno-merge-constants
 COMMONCFLAGS += $(call cc-option,$(CC),-nopie,)
+COMMONCFLAGS += $(call cc-option,$(CC),-fno-pie,)
 COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
 COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
 COMMONCFLAGS += $(call cc-option,$(CC),-fstack-check=no,)



More information about the SeaBIOS mailing list