While upgrading an existing sparc64 linux-headers-2.4.21-r1 fails to compile check_asm.c during 'make dep'. Reproducible: Always Steps to Reproduce: 1. emerge linux-headers 2. 3. Actual Results: >>> make oldconfig complete gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/mkdep scripts/mkdep.c make -C arch/sparc64/kernel check_asm make[1]: Entering directory `/tmp/portage/linux-headers-2.4.21-r1/work/linux-2.4.21/arch/sparc64/kernel' sparc64-linux-gcc -E -D__KERNEL__ -I/tmp/portage/linux-headers-2.4.21-r1/work/linux-2.4.21/include -P tmp.c -o tmp.i /bin/sh ./check_asm.sh -data task tmp.i check_asm_data.c /bin/sh ./check_asm.sh -data mm tmp.i check_asm_data.c /bin/sh ./check_asm.sh -data thread tmp.i check_asm_data.c sparc64-linux-gcc -D__KERNEL__ -I/tmp/portage/linux-headers-2.4.21-r1/work/linux-2.4.21/include -m64 -mcmodel=medlow -ffixed-g4 -S -o check_asm_data.s check_asm_data.c /bin/sh ./check_asm.sh -ints check_asm_data.s check_asm.c /bin/sh ./check_asm.sh -printf task tmp.i check_asm.c /bin/sh ./check_asm.sh -printf mm tmp.i check_asm.c /bin/sh ./check_asm.sh -printf thread tmp.i check_asm.c gcc -o check_asm check_asm.c check_asm.c:312: field name not in record or union initializer check_asm.c:312: (near initialization for `check_asm_data') check_asm.c:313: warning: initialization makes integer from pointer without a cast make[1]: *** [check_asm] Error 1 make[1]: Leaving directory `/tmp/portage/linux-headers-2.4.21-r1/work/linux-2.4.21/arch/sparc64/kernel' make: *** [check_asm] Error 2 !!! ERROR: sys-kernel/linux-headers-2.4.21-r1 failed. !!! Function src_compile, Line 76, Exitcode 2 !!! Failed to run 'make dep' gcc --version gcc (GCC) 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r2, propolice) sparc64-linux-gcc --version sparc64-linux-gcc (GCC) 3.3.3 20040217 (Gentoo Linux 3.3.3) Portage 2.0.49-r15 (default-sparc64-1.4, gcc-3.2.3, glibc-2.3.2-r3, 2.4.22-sparc) ================================================================= System uname: 2.4.22-sparc sparc64 sun4u Gentoo Base System version 1.4.3.10 distcc 2.11.1 sparc-unknown-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ACCEPT_KEYWORDS="sparc ~sparc" AUTOCLEAN="yes" CFLAGS="-mcpu=ultrasparc -O3 -pipe" CHOST="sparc-unknown-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-mcpu=ultrasparc -O3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="sandbox ccache" GENTOO_MIRRORS="ftp://sunsite.ualberta.ca/pub/Mirror/Linux/gentoo http://gentoo.oregonstate.edu/ http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j10" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync4.ca.gentoo.org/gentoo-portage" USE="sparc arts avi crypt encode esd fbcon foomaticdb gif gnome imlib jpeg kde libwww mad mikmod mpeg ncurses nls oggvorbis oss png pdflib qt sdl spell truetype xv xml2 xmms zlib gdbm berkdb slang readline mysql X tcpd pam ssl perl python gtk motif opengl java mbox mozcalendar mozilla mozsvg tiff Xaw3d -cups"
This isn't totally a gcc-porting issue, more a sparc one. It's a bug in the kernel that breaks with gcc-3.2.3. I believe it was fixed in 2.4.23. I looked in 2.4.23, and found a patch that tweaks check_asm.sh, which looks to generate check_asm.c. I've attached it here, give it a run with linux-headers-2.4.21-r1 and see if it resolves the issue.
Created attachment 26543 [details, diff] Patch from 2.4.23 to 2.4.21 for check_asm.sh
Created attachment 26548 [details, diff] check_asm.sh patch for linux-headers-2.4.21-r1 sparc64 Allows 'make dep' completion for linux-headers-2.4.21-r1 on sparc64 with gcc-3.2.3
The patch you attached looks very similar to the one I attached. Can you try the one I attached to see if it works (or if it applies)? It's what wound up being in the 2.4.23 kernel.
The patch you supplied failed to apply against 2.4.21. My patch is an edit of your patch to successfully apply against 2.4.21. All I changed was the original line and duplicated the changed line. Mine also applies against the sparc64 side, where as yours was sparc only. It probablly does need to be applied against sparc as well, but I don't currently have a sparc32 box to test against. Your patch appears to be a diff between 2.4.22 and 2.4.23.
Just made linux-headers-2.4.23 available on sparc. Give it a couple hours to reach the mirrors and then try building this. Let us know how you make out.
Thank you. linux-headers-2.4.23 installed successfully. Also 2.4.22 failed to install same as 2.4.21.
Glad to hear it :) If you have any problems related to linux-headers-2.4.23, feel free open a new bug.