Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
code model kernel does not support PIC mode
2018-10-29, 12:47
Post: #1
code model kernel does not support PIC mode
Hello,

When I'm building "make bin-x86_64-pcbios/ipxe.lkrn", I get this error:
Code:
cc1: error: code model kernel does not support PIC mode
Makefile.housekeeping:936: recipe for target 'bin-x86_64-pcbios/__umoddi3.o' failed
make: *** [bin-x86_64-pcbios/__umoddi3.o] Error 1
And when I build it in 32 bit, I get a different error:
Code:
util/zbin.c:7:10: fatal error: lzma.h: No such file or directory
#include <lzma.h>
          ^~~~~~~~
compilation terminated.
Makefile.housekeeping:1381: recipe for target 'util/zbin' failed
make: *** [util/zbin] Error 1
Find all posts by this user
Quote this message in a reply
2018-10-29, 16:31
Post: #2
RE: code model kernel does not support PIC mode
I found a way to solve the "kernel does not support PIC mode". You just add "-fno-pie" at the end of this line in Makefile.housekeeping. Apparently it's a bug with gcc v5+. link
Code:
CFLAGS          += $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS) -fno-pie

On both architecture, I get the lzma.h error. Does anybody have a clue?
Find all posts by this user
Quote this message in a reply
2018-10-29, 19:10
Post: #3
RE: code model kernel does not support PIC mode
Any particular reason you are building bin-x86_64-pcbios instead of bin-i386-pcbios ?
in regards to lzma, check the http://ipxe.org/download#source_code page, relevant prerequsit: "liblzma or xz header files"

Are you building from latest git master? or what is the git commit that you are using?

Read the FAQ before posting.
Did you include relevant ipxe.org error urls?
Visit this user's website Find all posts by this user
Quote this message in a reply
2018-10-31, 11:19
Post: #4
RE: code model kernel does not support PIC mode
Just needed to reinstall the liblzma package. Don't know why but now it works. Thanks!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)