Subject: [alpine-devel] Probably a bug, maybe a feature in gcc-6.2.1-r0 in edge

From: Cág <[email-masked]>
Date: Tue, 25 Oct 2016 12:23:03 +0100

Hi,

After trying to compile a new kernel (4.4.27), I received an error from 
gcc-6.2.1:

-----------------
kernel/bounds.c:1:0: error: code model kernel does not support PIC mode
-----------------

I've found this:
https://mail-archive.com/[email-masked]/msg1463141.html
TL;DR gcc-6.2.0-7 does the same thing in Debian

I pulled gcc-5.3.0-r0 from 3.4 and it does its job fine.
Any ideas?

Thanks,
Cág

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Tue, 25 Oct 2016 14:03:51 +0200

On Tue, 25 Oct 2016 12:23:03 +0100

> After trying to compile a new kernel (4.4.27), I received an error from 

We compile gcc with --enable-default-pie since gcc 6. This means that
kernel need to be built with -fno-pie:

  make KCFLAGS=-fno-pie ....

-nc

---

---

From: Cág <[email-masked]>
Date: Tue, 25 Oct 2016 14:28:35 +0100

>   make KCFLAGS=-fno-pie ....

Thanks.

Slightly inconvenient but okay. It skips through that error, chokes on
some warnings and notes and ends with (with no other flags applied):

--------------------------
init/built-in.o: In function `do_one_initcall':
(.text+0x21b): undefined reference to `__stack_chk_fail'
init/built-in.o: In function `name_to_dev_t':
(.text+0x6a9): undefined reference to `__stack_chk_fail'
init/built-in.o: In function `calibrate_delay':
(.text+0xc82): undefined reference to `__stack_chk_fail'
init/built-in.o: In function `loglevel':
main.c:(.init.text+0x149): undefined reference to `__stack_chk_fail'
init/built-in.o: In function `start_kernel':
(.init.text+0x7d5): undefined reference to `__stack_chk_fail'
init/built-in.o:(.init.text+0xc2a): more undefined references to 
`__stack_chk_fail'
follow
make: *** [Makefile:945: vmlinux] Error 1
--------------------------

Cág

---