You are not logged in.

#1 2015-02-03 06:33:35

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

[SOLVED] Can't compile any kernels or modules

I can't compile the kernel, or any kernel modules. I tried the [core] kernel from ABS and the linux-ck kernel from AUR. I also tried to build vhba and nvidia modules.

I tried the standard cflags and many others.

All kernel compiles fail (immediately) with:

scripts/mod/empty.c:1:0: error: code model kernel does not support PIC mode
 /* empty file to figure out endianness / word size */
 ^

edward_81 had the same problem, with a default makepkg.conf and linux-mainline, which was never resolved.

I don't know why this file is being compiled in PIC mode. I have not explicitly enabled PIC anywhere I know of. I checked everywhere I know to look.

Last edited by quequotion (2015-02-04 15:46:10)

Offline

#2 2015-02-03 13:50:02

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: [SOLVED] Can't compile any kernels or modules

No idea.  Try building one of them in a clean chroot.  Use clean-chroot-manager if you don't know how.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2015-02-04 02:12:18

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: [SOLVED] Can't compile any kernels or modules

graysky wrote:

Try building one of them in a clean chroot.

Will try.
Finally got this working:

Please add V=1 to the make command on line 89 and rebuild with MAKEFLAGS="-j1" to get verbose output.

make -f ./scripts/Makefile.build obj=scripts/genksyms
[...snip...]
  gcc -Wp,-MD,scripts/mod/.empty.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/include -I./arch/x86/include -Iarch/x86/include/generated  -Iinclude -I./arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -m64 -mno-80387 -mno-fp-ret-in-387 -march=native -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-var-tracking-assignments -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(empty)"  -D"KBUILD_MODNAME=KBUILD_STR(empty)" -c -o scripts/mod/.tmp_empty.o scripts/mod/empty.c
scripts/mod/empty.c:1:0: error: code model kernel does not support PIC mode
 /* empty file to figure out endianness / word size */
 ^
scripts/Makefile.build:257: recipe for target 'scripts/mod/empty.o' failed

Last edited by quequotion (2015-02-04 13:40:15)

Offline

#4 2015-02-04 15:44:51

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: [SOLVED] Can't compile any kernels or modules

graysky wrote:

No idea.  Try building one of them in a clean chroot.  Use clean-chroot-manager if you don't know how.

This worked, so I deduced that it was a configuration problem after all.

The problem was not cflags; the problem was ccache.

I had enabled ccache; the setting cannot be left in place when unneeded.

::EDIT::

Nothing important follows, no need to read this nonsense.

This is just my opinion, but looking back on this and having experienced other problems with ccache I came to the conclusion that it is not of use for anything less than a virtualized build server. It's highly unlikely that an ordinary user or developer would be doing mutiple identical builds of the same package.  The only safe use case would be for rebuilding the same package with the same settings and flags over and over, as is done to update binary releases in a virtualized build server, and I would still expect ccache to cause problems on occasion.

Of course, I'd love to have a virtualized build server to make custom binary releases to upgrade my installations with, and have it save time with ccache, but I there are a number of other problems I have to (learn to) fix before I even learn how to do that.

Last edited by quequotion (2015-06-23 06:11:18)

Offline

Board footer

Powered by FluxBB