Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#57916 - Failure to compile any kernel module after upgrading gcc from 7.3.0 to 7.3.1

Attached to Project: Arch Linux
Opened by Vincenzo Maffione (vmaffione) - Thursday, 22 March 2018, 14:31 GMT
Last edited by Doug Newgard (Scimmia) - Thursday, 22 March 2018, 17:38 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

I am not able to compile any out-of-tree kernel module anymore.
This happened right after upgrading gcc from 7.3.0 to 7.3.1.
Investigating a bit, I noticed that for some reason the kernel build system thinks that the gcc version is 7.3.0, while the right version is 7.3.1.

This is what I get when I run make on a kernel Makefile (in verbose mode)
>>>>>>>>>>>>>>>
make V=1 -C /lib/modules/4.15.11-1-ARCH/build M=/home/vmaffione/git/rlite/kernel PWD=/home/vmaffione/git/rlite/kernel \
WITH_SHIM_UDP4=y \
WITH_SHIM_TCP4=y \
modules
make[1]: Entering directory '/usr/lib/modules/4.15.11-1-ARCH/build'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo >&2; \
echo >&2 " ERROR: Kernel configuration is invalid."; \
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo >&2 ; \
/bin/false)
mkdir -p /home/vmaffione/git/rlite/kernel/.tmp_versions ; rm -f /home/vmaffione/git/rlite/kernel/.tmp_versions/*
make -f ./scripts/Makefile.build obj=/home/vmaffione/git/rlite/kernel
gcc -Wp,-MD,/home/vmaffione/git/rlite/kernel/.ctrl-dev.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include [...]
[...]
<<<<<<<<<<<<<<<<<<<<<<

Compilation fails because "/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include" does not exist.
I had to create a symbolic link /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0 --> /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.1 to fix it.

I see the -isystem compilation flag is generated by /lib/modules/4.15.11-1-ARCH/build/Makefile, at this line
>>>>>>>>>>>>>>
NOSTDINC_FLAGS += -nostdinc -isystem $(call shell-cached,$(CC) -print-file-name=include)
<<<<<<<<<<<<<

But I've no idea why 'gcc -print-file-name=include' resolves to /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0 instead of /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.1, at least
when run in the context of that makefile.
Running the same command in a shell yields the correct result.

Package version:
* gcc 7.3.1
* linux-headers 4.15.11-1

Steps to reproduce:
Compile any out of tree kernel module
This task depends upon

Closed by  Doug Newgard (Scimmia)
Thursday, 22 March 2018, 17:38 GMT
Reason for closing:  Not a bug
Comment by Doug Newgard (Scimmia) - Thursday, 22 March 2018, 16:32 GMT
What distro are you on? There's no gcc package with that version, and never has been in Arch.

It sounds like you've got some info cached somewhere, did you try a clean build?
Comment by Vincenzo Maffione (vmaffione) - Thursday, 22 March 2018, 17:18 GMT
Thanks for the quick reply.

I'm using plain Arch.
I do see gcc-7.3.1+20180312-1 installed on my machines.
And I see that 7.3.1 is the current version https://www.archlinux.org/packages/core/x86_64/gcc/
What do you mean by "clean build"? I'm not building from sources or using makepkg.
Comment by Doug Newgard (Scimmia) - Thursday, 22 March 2018, 17:27 GMT
7.3.1+20180312-1 != 7.3.1

What do you mean you're not building from sources? What do you think you're doing?
Comment by Vincenzo Maffione (vmaffione) - Thursday, 22 March 2018, 17:36 GMT
Sorry for the confusion, I meant I have 7.3.1+20180312-1 installed, and not 7.3.1.
Regarding the clean build, I misunderstood your words and thought you were talking about "building the gcc package" from sources.
Yes, I had tried a clean build of different/independent kernel modules, but nothing helped (except for the symlink fix ofc).
However, I did another 'pacman -Syu' 30 mins ago and luckily the problem went away (I've removed the symlink, obviously).
Sorry for the noise.

Thanks

Loading...