I setup a chroot using the 2005.1 stage3 alpha tarball, emerge sync'd, updated the system with emerge -uD world, ran gcc-config pyton-updater etc-update etc., and then tried emerging xorg-x11. I got the compile error below... Reproducible: Always Steps to Reproduce: 1. emerge xorg-x11 Actual Results: alpha-unknown-linux-gnu-gcc -c -mieee -O2 -mcpu=ev56 -pipe -fno-strict-aliasing -ansi -pedantic -Wno-return-type -w -fno-merge-constants -I../../../../../../programs/Xserver/hw/xfree86/common -I../../../../../../programs/Xserver/hw/xfree86/os-support -I. -I../../../../../../programs/Xserver/include -I../../../../../../exports/include/X11 -I../../../../../../include/extensions -I../../../../../../programs/Xserver/hw/xfree86/os-support/shared -I../../../../../../programs/Xserver/hw/xfree86/os-support/bus -I../../../../../../extras/drm/shared -I../../../../../../programs/Xserver/mi -I../../../../../.. -I../../../../../../exports/include -Dlinux -D__alpha__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DSHAPE -DXINPUT -DXKB -DLBX -DXAPPGROUP -DXCSECURITY -DTOGCUP -DXF86BIGFONT -DDPMSExtension -DPANORAMIX -DRENDER -DRANDR -DXFIXES -DDAMAGE -DCOMPOSITE -DXEVIE -DGCCUSESGAS -DAVOID_GLYPHBLT -DPIXPRIV -DSINGLEDEPTH -DXFreeXDGA -DXvExtension -DXFree86LOADER -DXFree86Server -DXF86VIDMODE -DXvMCExtension -DSMART_SCHEDULE -DXResExtension -DX_BYTE_ORDER=X_LITTLE_ENDIAN -DXORG_VERSION_CURRENT="(((6) * 10000000) + ((8) * 100000) + ((2) * 1000) + 0)" -D_XSERVER64 -DJENSEN_SUPPORT -DNDEBUG -DFUNCPROTO=15 -DNARROWPROTO -DUSESTDRES -DHAVE_SYSV_IPC lnx_KbdMap.c In file included from /usr/include/linux/bitops.h:77, from /usr/include/linux/thread_info.h:20, from /usr/include/linux/spinlock.h:12, from /usr/include/linux/wait.h:23, from /usr/include/linux/keyboard.h:14, from lnx_KbdMap.c:108: /usr/include/asm/bitops.h:23: error: syntax error before "void" /usr/include/asm/bitops.h:44: error: syntax error before "void" /usr/include/asm/bitops.h:55: error: syntax error before "void" /usr/include/asm/bitops.h:84: error: syntax error before "void" /usr/include/asm/bitops.h:113: error: syntax error before "int" /usr/include/asm/bitops.h:143: error: syntax error before "int" /usr/include/asm/bitops.h:154: error: syntax error before "int" /usr/include/asm/bitops.h:184: error: syntax error before "int" /usr/include/asm/bitops.h:195: error: syntax error before "int" /usr/include/asm/bitops.h:234: error: syntax error before "int" /usr/include/asm/bitops.h:247: error: syntax error before "unsigned" /usr/include/asm/bitops.h:262: error: syntax error before "unsigned" /usr/include/asm/bitops.h:282: error: syntax error before "unsigned" /usr/include/asm/bitops.h:378: error: syntax error before "unsigned" /usr/include/asm/bitops.h:420: error: syntax error before "unsigned" In file included from /usr/include/linux/thread_info.h:20, from /usr/include/linux/spinlock.h:12, from /usr/include/linux/wait.h:23, from /usr/include/linux/keyboard.h:14, from lnx_KbdMap.c:108: /usr/include/linux/bitops.h:92: error: syntax error before "unsigned" /usr/include/linux/bitops.h:101: error: syntax error before "unsigned" /usr/include/linux/bitops.h:109: error: syntax error before "unsigned" /usr/include/linux/bitops.h:116: error: syntax error before "unsigned" /usr/include/linux/bitops.h:132: error: syntax error before "unsigned" In file included from /usr/include/linux/keyboard.h:14, from lnx_KbdMap.c:108: /usr/include/linux/wait.h:79: error: syntax error before "void" /usr/include/linux/wait.h:85: error: syntax error before "void" /usr/include/linux/wait.h:92: error: syntax error before "void" /usr/include/linux/wait.h:100: error: syntax error before "int" /usr/include/linux/wait.h:373: error: syntax error before "int" /usr/include/linux/wait.h:397: error: syntax error before "int" make[7]: *** [lnx_KbdMap.o] Error 1 make[7]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.2-r4/work/xc/programs/Xserver/hw/xfree86/os-support/linux' make[6]: *** [linux] Error 2 make[6]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.2-r4/work/xc/programs/Xserver/hw/xfree86/os-support' make[5]: *** [all] Error 2 make[5]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.2-r4/work/xc/programs/Xserver/hw/xfree86' make[4]: *** [hw/xfree86] Error 2 make[4]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.2-r4/work/xc/programs/Xserver' make[3]: *** [all] Error 2 make[3]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.2-r4/work/xc/programs' make[2]: *** [all] Error 2 make[2]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.2-r4/work/xc' make[1]: *** [World] Error 2 make[1]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.2-r4/work/xc' make: *** [World] Error 2 Expected Results: It should have emerged xorg-x11 Portage 2.0.51.22-r3 (default-linux/alpha/2005.0, gcc-3.4.4, glibc-2.3.5-r3, 2.6.15-rc5 alpha) ================================================================= System uname: 2.6.15-rc5 alpha EV56 Gentoo Base System version 1.6.13 ccache version 2.3 [enabled] dev-lang/python: 2.3.5, 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.20 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="alpha" AUTOCLEAN="yes" CBUILD="alpha-unknown-linux-gnu" CFLAGS="-mieee -O2 -mcpu=ev56 -pipe" CHOST="alpha-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-mieee -O2 -mcpu=ev56 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache collision-protect distlocks maketest nostrip sandbox sfperms strict test" GENTOO_MIRRORS="http://mirror.arcticnetwork.ca/pub/gentoo/ http://adelie.polymtl.ca/ http://gentoo.cites.uiuc.edu/pub/gentoo/ ftp://gentoo.arcticnetwork.ca/pub/gentoo/" LDFLAGS="-Wl,-O1" LINGUAS="en" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.ca.gentoo.org/gentoo-portage" USE="alpha X arts berkdb bitmap-fonts bzip2 crypt cups eds encode expat font-server foomaticdb fortran gdbm gif gnome gpm gstreamer gtk gtk2 imlib jpeg kde libg++ libwww mad mikmod motif mp3 mpeg ncurses nls ogg oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl spell ssl tcpd tiff truetype truetype-fonts type1-fonts udev vorbis xml2 xmms xv zlib linguas_en userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL
This looks like a linux-headers problem on alpha. Alpha team, have you seen this before?
All of the syntax errors in bitops.h are because linux-headers uses inline functions and xorg uses the -ansi CFLAG. "C++, C99, and GNU C each have support for inline functions, although 1990 ANSI C, the dialect of C most commonly used in practice, does not." [1] I created a simple program[2] with an inline function. It compiles without -ansi and gives that informative "error: syntax error" when I use -ansi. I tried xorg-x11-6.8.2-r6 and linux-headers-2.6.11-r3, and I got the same syntax errors. Anyone have ideas on a possible fix for this? [1] http://en.wikipedia.org/wiki/Inline_function#Language_support [2] http://cs.ubishops.ca/~tcort/inline.c
I looked into this further and found that the exact problem with linux-headers is asm-alpha/compiler.h. You see asm-alpha/bitops.h includes asm-alpha/compiler.h which includes linux/compiler.h which contains a macro that #define's inline as __inline__ if gcc >= 3.1. asm-alpha/compiler.h #undef's inline which causes the compile error on the inline functions. This is because gcc's -ansi flag (used by Xorg) works with __inline__ functions, not inline functions. This isn't a problem for i386 because inline is #undef'ed in asm-alpha/compiler.h. i386 doesn't have an asm-i386/compiler.h, it just includes linux/compiler.h. I hope that wasn't too confusing. I'll be e-mailing <a href="http://lkml.org/">LKML</a> to see if they can fix this header issue.
Before e-mailing the LKML I tried the latest headers from linux-2.6.15-rc5-git3 and they solved the problem.
Thank you for looking into that Thomas. This means we need to have sys-kernel/linux-headers bumped, correct?
> This means we need to have sys-kernel/linux-headers bumped, correct? Yes that is correct. linux-headers-2.6.11-r3, the latest linux-headers in portage, does not include the fix.
> sys-kernel/linux-headers bump I looked through the kernel changelogs and sources and I believe it should be fixed in 2.6.14.
You're handy ;) Plasmaroo, I believe this is your bag.
Please try sed -i -e 's/ inline / __inline__ /g' /usr/include/asm/bitops.h /usr/include/linux/bitops.h /usr/include/linux/wait.h - should hopefully fix the issue.
> Please try sed -i -e 's/ inline / __inline__ /g' /usr/include/asm/bitops.h > /usr/include/linux/bitops.h /usr/include/linux/wait.h - should hopefully fix > the issue. It worked, thanks!
Fixed in 2.6.11-r4; thanks!
*** Bug 117668 has been marked as a duplicate of this bug. ***