After enabled wireguard module in kernel 5.4.80-r1 (CONFIG_WIREGUARD=m), compiling fails with errors: gcc: error: ":: No such file or directory gcc: error: ": No such file or directory gcc: error: fmt: No such file or directory make[3]: *** [scripts/Makefile.build:266: drivers/net/wireguard/main.o] Error 1 make[2]: *** [scripts/Makefile.build:500: drivers/net/wireguard] Error 2 make[1]: *** [scripts/Makefile.build:500: drivers/net] Error 2 make: *** [Makefile:1729: drivers] Error 2 Reproducible: Always Steps to Reproduce: 1. Enable wireguard as kernel module: CONFIG_WIREGUARD=m in .config 2. root@/usr/src/linux # make drivers/net/wireguard/wireguard.o 3. gcc stops with error Actual Results: Compiling the kernel fails Expected Results: Compiling the kernel succeed with wireguard built as module Portage 3.0.9 (python 3.8.6-final-0, default/linux/amd64/17.1/developer, gcc-9.3.0, glibc-2.32-r2, 5.4.80-gentoo-r1 x86_64) ================================================================= System uname: Linux-5.4.80-gentoo-r1-x86_64-Intel-R-_Core-TM-_i7-5820K_CPU_@_3.30GHz-with-glibc2.2.5 KiB Mem: 16363296 total, 8138208 free KiB Swap: 6291452 total, 6291452 free Timestamp of repository gentoo: Mon, 07 Dec 2020 00:45:01 +0000 Head commit of repository haskell: 874ec58ba195b2b6b29f99d66daa629ec2a58e0e Head commit of repository java: 86341105e8c226d75145cbf59b4e8b8855c3c7d4 Head commit of repository sublime-text: d61099e92623c91152106c07a33a97beaad49efe sh bash 5.0_p18 ld GNU ld (Gentoo 2.32 p2) 2.32.0 ccache version 3.7.12 [enabled] app-shells/bash: 5.0_p18::gentoo dev-java/java-config: 2.3.1::gentoo dev-lang/perl: 5.30.3-r1::gentoo dev-lang/python: 2.7.18-r4::gentoo, 3.6.12::gentoo, 3.7.9::gentoo, 3.8.6::gentoo, 3.9.0::gentoo dev-util/ccache: 3.7.12::gentoo dev-util/cmake: 3.17.4-r1::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.7::gentoo sys-apps/openrc: 0.42.1::gentoo sys-apps/sandbox: 2.20::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r5::gentoo sys-devel/automake: 1.11.6-r3::gentoo, 1.16.2-r1::gentoo sys-devel/binutils: 2.32-r1::gentoo, 2.33.1-r1::gentoo, 2.34-r2::gentoo sys-devel/gcc: 8.4.0-r1::gentoo, 9.3.0-r1::gentoo sys-devel/gcc-config: 2.3.2-r1::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.2.1-r4::gentoo sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers) sys-libs/glibc: 2.32-r2::gentoo Repositories: gentoo location: /subsys/usr/portage sync-type: webrsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-webrsync-verify-signature: yes haskell location: /var/lib/layman/haskell sync-type: git sync-uri: git://github.com/gentoo-haskell/gentoo-haskell.git masters: gentoo priority: 50 java location: /var/lib/layman/java sync-type: git sync-uri: git://anongit.gentoo.org/proj/java.git masters: gentoo priority: 50 sublime-text location: /var/lib/layman/sublime-text sync-type: git sync-uri: git://github.com/DamnWidget/sublime-text.git masters: gentoo priority: 50 ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -mtune=native -O2 -pipe " CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.0/conf /usr/share/maven-bin-3.3/conf /usr/share/maven-bin-3.6/conf" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.3/ext-active/ /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.3/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=native -mtune=native -O2 -pipe " DISTDIR="/usr/portage/distfiles" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs ccache cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles ipc-sandbox merge-sync mount-sandbox multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms sign splitdebug strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ rsync://ftp.jaist.ac.jp/pub/Linux/Gentoo/ ftp://ftp.jaist.ac.jp/pub/Linux/Gentoo/ ftp://gentoo.imj.fr/pub/gentoo/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo" LANG="it_IT.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0" LINGUAS="it en" MAKEOPTS="-j6 --load-average 6" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/tmp" USE="X a52 aac acl acpi aes aio alsa amd64 avx avx2 bash-completion berkdb blueray bluetooth bzip2 cairo cdda cddb cdparanoia cdr cli corefonts crypt css cups dbus dirac dri dts dv dvb dvd dvdr elogind emboss encode exif fbcon ffmpeg flac fma3 fontconfig foomaticdb fortran freetds gdbm gif gimp git gnutls gpm gtk gui gzip hddtemp hoogle hscolour i3 iconv icu imagemagick imap ipv6 jabber java jpeg jpeg2k kvm lame latex lcms libcaca libffi libglvnd libnotify libtirpc live lm_sensors lzma lzo mad matroska mime mmx mmxext mng modules mozilla mp3 mp4 mpeg multilib mysql ncurses nls nptl nvenc odbc ogg opengl openmp optimization pam pango pcre pdf php png policykit popcnt postscript ppds qemu qt5 quicktime raw rdesktop readline rss ruby samba sasl scanner schroendiger sdl seccomp smartcard smp snmp sockets socks5 sound spell split-usr sqlite sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 startup-notification strong-optimization svg symlink syslog tcpd theora threads tiff truetype udev udisks unicode upnp upnp-av upower usb v4l vdpau vhost vim-syntax vorbis webkit wmf wxwidgets x264 x265 xattr xcb xcomposite xft xml xmpp xpm xscreensaver xv xvid xvmc zlib zsh-completion" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev wacom" KERNEL="linux" L10N="it en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" NGINX_MODULES_HTTP="fastcgi fancyindex echo dav gzip gzip_static memcached access auth_basic auth_pam perl rewrite upload upload_progress userid uwsgi xslt memc passenger scgi ssi auth_request cache_purge gunzip headers_more sub" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8 python3_7 python3_6 python2_7" QEMU_SOFTMMU_TARGETS="i386 ppc ppc64 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby25 ruby26" SANE_BACKENDS="mustek_usb" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 677314 [details, diff] Patch to fix wireguard Makefile Just remove the line: ccflags-y += -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt' and gcc will run smoothly
No problem here on amd64. Can you attach your.config ?
Created attachment 677335 [details] .config kernel 5.4.80-gentoo-r1 My .config after wireguard module was built with the submitted patch.
I'm having trouble replicating. I built 5.4.82 with your .config using both gcc 9.3.0-r1 and 10.2.0-r3 without issue. Can I see your emerge --info, please ?
Created attachment 677560 [details] emerge --info Thanx a lot Mr. Pagano, for all your awesome work on the kernel :)
Do you have coreutils installed? gcc: error: fmt: No such file or directory /usr/bin/fmt is part of that package.
Yes, I've installed the last version of coreutils: > eix -s coreutils > [I] sys-apps/coreutils > Available versions: 8.30^t 8.31-r1^t 8.32-r1^t {acl caps gmp hostname kill multicall nls selinux +split-usr static test vanilla xattr USERLAND="BSD"} > Installed versions: 8.32-r1^t(09:12:25 17/08/2020)(acl nls split-usr xattr -caps -gmp -hostname -kill -multicall -selinux -static -test -vanilla) > Homepage: https://www.gnu.org/software/coreutils/ > Description: Standard GNU utilities (chmod, cp, dd, ls, sort, tr, head, wc, who,...) > ls -lh /usr/bin/fmt > -rwxr-xr-x 1 root root 43K 17 ago 09.12 /usr/bin/fmt Compiling with verbose=1, I have the error on the command: gcc -Wp,-MD,drivers/net/wireguard/.main.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=core2 -mno-red-zone -mcmodel=kernel -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -DCONFIG_AS_ADX=1 -Wno-sign-compare -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector -Wno-unused-but-set-variable -Wimplicit-fallthrough -Wno-unused-const-variable -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix- map=./= -Wno-packed-not-aligned -O3 -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt' # <== error here -DKBUILD_BASENAME='"main"' -DKBUILD_MODNAME='"wireguard"' -c -o drivers/net/wireguard/main.o drivers/net/wireguard/main.c IMHO, in: > -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt' for some reason whitespaces in single quotes are tokenized, so gcc search for '":', '"' and 'fmt' as files, giving the error: > gcc: error: ": : No such file or directory > gcc: error: " : No such file or directory > gcc: error: fmt : No such file or directory
can you test this with 5.4.108?