Compile of openmotif-2.1.30-r3 fails because parameter "-march=1" is given to gcc. More details in my bugreport to openmotif in URL above. Reproducible: Always Steps to Reproduce: 1. CFLAGS set to "-march=i686 [...]" 2. gcc must report the computer as being an i686: gcc -x c - -E -dM </dev/null: [...] #define i686 1 [...] 3. emerge openmotif Actual Results: make[2]: Entering directory `/var/tmp/portage/openmotif-2.1.30-r3/work/motif/config/imake' ...skipping... gcc -march=1 -O3 -pipe -I../../include -I../../imports/x11/include/X11 -I../.. -I../../exports/include -I../../imports/x11/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOU RCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DNO_MESSAGE_CATALOG -DFUNCPROTO=15 -DNARROWPROTO -DCPP_PROGRAM="\"/lib/cpp\"" -c -o imake.o imake.c cc1: bad value (1) for -march= switch make[2]: *** [imake.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/openmotif-2.1.30-r3/work/motif/config/imake' make[1]: *** [imake.bootstrap] Error 2 make[1]: Leaving directory `/var/tmp/portage/openmotif-2.1.30-r3/work/motif' make: *** [World] Error 2 !!! ERROR: x11-libs/openmotif-2.1.30-r3 failed. !!! Function src_compile, Line 59, Exitcode 2 !!! (no error message) Expected Results: Should have been "gcc -march=i686 [...]". Suggested quick solution until openmotif gets fixed: openmotif-2.1.30-r3.ebuild: ********************************************************************** echo >>$cfg echo >>$cfg "#undef i686" echo >>$cfg "#undef OptimizedCDebugFlags" echo >>$cfg "#define OptimizedCDebugFlags ${CFLAGS}" echo >>$cfg "#undef OptimizedCplusplusDebugFlags" echo >>$cfg "#define OptimizedCplusplusDebugFlags ${CXXFLAGS}" ********************************************************************** I added the second line. Should be done for other architectures too. Worked for me. emerge info: ********************************************************************** Portage 2.0.49-r21 (default-1.0, gcc-2.95.3, glibc-2.2.5-r2,2.2.5-r9, 2.4.20-gentoo-r9) ================================================================= System uname: 2.4.20-gentoo-r9 i686 AMD Athlon(tm) XP 1700+ Gentoo Base System version 1.4.3.10p1 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=i686 -O3 -pipe" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-march=i686 -O3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS=" ftp://sunsite.uio.no/linux/Gentoo/ ftp://gentoo.linux.no/pub/gentoo/ http://gentoo.linux.no/ http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow X aalib alsa apm arts avi berkdb bonobo cdr crypt directfb dvd encode esd gdbm gif gnome gnome-libs gpm gtk gtk2 gtkhtml guile imlib java jpeg kde ldap libg++ libwww matrox mikmod mmx motif mozilla mozsvg mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline ruby scanner sdl slang spell ssl svga tcltk tcpd tetex tiff truetype x86 xml2 xmms xv" **********************************************************************
For lanius
gcc should never predefine `i686' (i386, yes, but that gets undefined early in the process. All other processor and optimization dependent symbols should only appear with 2 leading underscores). Are you using a non-standard specs file? Could you attach /usr/lib/gcc-lib/i?86-pc-linux-gnu/2.95.3/specs please?
Created attachment 23775 [details] Requested by #2 /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/specs
Created attachment 23776 [details] Requested by #2 /usr/lib/gcc-lib/i486-pc-linux-gnu/2.95.3/specs
/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/specs is intact: > qpkg -f -v /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/specs sys-devel/gcc-2.95.3-r7 * sys-devel/gcc-2.95.3-r8 * > qpkg -c -v gcc-2.95.3-r8 sys-devel/gcc-2.95.3-r8 * /usr/bin/cc !md5! !mtime! /lib/cpp !md5! !mtime! 2/396 "-ansi" seems to remove the i386/i686 defines: > gcc -x c - -E -dM </dev/null #define __linux__ 1 #define linux 1 #define __i386__ 1 #define __i386 1 #define __i686 1 #define __GNUC_MINOR__ 95 #define pentiumpro 1 #define __pentiumpro 1 #define i386 1 #define i686 1 #define __pentiumpro__ 1 #define __unix 1 #define __unix__ 1 #define __i686__ 1 #define __GNUC__ 2 #define __linux 1 #define __ELF__ 1 #define unix 1 > gcc -ansi -x c - -E -dM </dev/null #define __linux__ 1 #define __STRICT_ANSI__ 1 #define __i386__ 1 #define __i386 1 #define __i686 1 #define __GNUC_MINOR__ 95 #define __pentiumpro 1 #define __pentiumpro__ 1 #define __unix 1 #define __unix__ 1 #define __i686__ 1 #define __GNUC__ 2 #define __linux 1 #define __ELF__ 1
Hm...the offending lines are: *cpp_cpu_default: %(cpp_686) which pulls in *cpp_686: %{!ansi:-Di686 -Dpentiumpro} -D__i686 -D__i686__ -D__pentiumpro \ -D__pentiumpro__ ----------->^^^^ Gcc-3 defines those, and only the underscored versions, only if -march is given. On the other hand, since XFree undefs i686 (and i586, k6, etc...), it does not hurt to do the same thing for Motif... after all the included .cf file is only used at build time. (are non-ix86 arches affected by this too?)
> (are non-ix86 arches affected by this too?) >uname -a SunOS foo.bar 5.8 Generic_108528-21 sun4u sparc >gcc -x c - -E -dM </dev/null #define __GCC_NEW_VARARGS__ 1 #define __sparc 1 #define __svr4__ 1 #define __GNUC_MINOR__ 7 #define __sun 1 #define sparc 1 #define __sun__ 1 #define __unix 1 #define __unix__ 1 #define __SVR4 1 #define sun 1 #define __GNUC__ 2 #define __sparc__ 1 #define unix 1 I guess so. Don't know much about sparc gcc flags, though. Others have experienced the problem, too: http://groups.google.com/groups?selm=bfAMb.217749%24Vu5.16272322%40twister.southeast.rr.com
what about just adding -ansi to cflags, it's easier but seems to have the same effect
i added -ansi to cflags
Did that fix work on your system? On mine, I have the following output; cd ./config/imake && make -f Makefile.proto all make[2]: Entering directory `/var/tmp/portage/openmotif-2.1.30-r3/work/motif/config/imake' gcc -march=1 -O2 -pipe -ansi -ansi -I../../include -I../../imports/x11/include/X11 -I../.. -I../../exports/include -I../../imports/x11/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DNO_MESSAGE_CATALOG -DFUNCPROTO=15 -DNARROWPROTO -DCPP_PROGRAM="\"/lib/cpp\"" -c -o imake.o imake.c cc1: bad value (1) for -march= switch make[2]: *** [imake.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/openmotif-2.1.30-r3/work/motif/config/imake' make[1]: *** [imake.bootstrap] Error 2 make[1]: Leaving directory `/var/tmp/portage/openmotif-2.1.30-r3/work/motif' make: *** [World] Error 2 Note that "-ansi" is in cflags twice, yet -march is still set to 1. Current march value configured in make.conf is i686. Please re-open and consider looking for upstream fixes?
gcc -march=1 -O3 -pipe -funroll-loops -ansi -ansi -I../../include -I../../imports/x11/include/X11 -I../.. -I../../exports/include -I../../imports/x11/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DNO_MESSAGE_CATALOG -DFUNCPROTO=15 -DNARROWPROTO -DCPP_PROGRAM="\"/lib/cpp\"" -c -o imake.o imake.c cc1: bad value (1) for -march= switch make[2]: *** [imake.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/openmotif-2.1.30-r3/work/motif/config/imake' make[1]: *** [imake.bootstrap] Error 2 make[1]: Leaving directory `/var/tmp/portage/openmotif-2.1.30-r3/work/motif' make: *** [World] Error 2 Please fix and submit patches upstream
The question is: Does Imake get the CFLAGS, and does it pass them on to cpp?
BOOTSTRAPCFLAGS Technically, imake should append to its own cpp args what it gets passed in `BOOTSTRAPCFLAGS', but this particular imake doesn't even seem to do that. Question still is though if the non-ansi syms should be defined by default...can we assume cpp only does that in gcc-2.95.x and only if CHOST is something bigger than i386-*? Are there gcc-3 versions in circulation that are affected too? In both cases, I think the more universal solution is, as noted above, to undefine them in Imake.cf the same way as xfree does.
Created attachment 24057 [details, diff] Imake.cf.diff (test) Diff against xfree Imake.cf with non-relevant sections stripped to keep it small (since they both come with a MIT licence, it should be ok to do that). Introduces a new (harmless) warning about a redefined symbol -- please don't put it into stable yet.
patch applied on -r4, please test
openmotif-2.1.30-r4 compiles fine on my machine now. For "emerge info", see above.
bartron: are you confident with that patch so i can close that bug?
The patch worked for me; OpenMotif compiled sucessfully on my systems.
fine, marked -r4 stable :)