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

Paul Menzel paulepanter at users.sourceforge.net
Sun Oct 23 20:57:28 CEST 2016


Date: Sun, 23 Oct 2016 18:56:28 +0200

Debian enables PIE hardening flags by default since package gcc-6
6.2.0-7 [1].

With that change, SeaBIOS fails to build with the error below [2][3].

```
$ make
  Build Kconfig config file
  Compile checking out/src/misc.o
  Compile checking out/src/stacks.o
src/stacks.c: Assembler messages:
src/stacks.c:567: Error: found '(', expected: ')'
src/stacks.c:567: Error: junk `(%ebp))' after expression
src/stacks.c:568: Warning: indirect call without `*'
Makefile:133: die Regel für Ziel „out/src/stacks.o“ scheiterte
make: *** [out/src/stacks.o] Fehler 1
```

Passing `no-pic` to the compiler fixes this issue.

[1] https://bugs.debian.org/835148
[2] https://bugs.debian.org/841546
[3] https://www.seabios.org/pipermail/seabios/2016-October/010980.html
    "Build failure with GCC 6 from Debian Sid/unstable"

Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 41bfcf4..4a20631 100644
--- a/Makefile
+++ b/Makefile
@@ -61,7 +61,8 @@ COMMONCFLAGS := -I$(OUT) -Isrc -Os -MD -g \
     -m32 -march=i386 -mregparm=3 -mpreferred-stack-boundary=2 \
     -minline-all-stringops -fomit-frame-pointer \
     -freg-struct-return -ffreestanding -fno-delete-null-pointer-checks \
-    -ffunction-sections -fdata-sections -fno-common -fno-merge-constants
+    -ffunction-sections -fdata-sections -fno-common -fno-merge-constants \
+		-fno-pic
 COMMONCFLAGS += $(call cc-option,$(CC),-nopie,)
 COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
 COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
-- 
2.9.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: This is a digitally signed message part
URL: <http://www.coreboot.org/pipermail/seabios/attachments/20161023/1b1eb616/attachment.asc>


More information about the SeaBIOS mailing list