Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38013 - openmotif-2.1.30-r3: "-march=i686" replaced with "-march=1" => compile error
Summary: openmotif-2.1.30-r3: "-march=i686" replaced with "-march=1" => compile error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Heinrich Wendel (RETIRED)
URL: http://bugs.motifzone.net/show_bug.cg...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-12 16:23 UTC by Håkon A. Hjortland
Modified: 2004-01-27 12:48 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Requested by #2 (specs,2.13 KB, text/plain)
2004-01-13 19:15 UTC, Håkon A. Hjortland
Details
Requested by #2 (specs,2.13 KB, text/plain)
2004-01-13 19:17 UTC, Håkon A. Hjortland
Details
Imake.cf.diff (test) (Imake.cf.diff,6.40 KB, patch)
2004-01-18 17:28 UTC, bartron
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Håkon A. Hjortland 2004-01-12 16:23:02 UTC
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"
**********************************************************************
Comment 1 Donnie Berkholz (RETIRED) gentoo-dev 2004-01-12 21:47:15 UTC
For lanius
Comment 2 bartron 2004-01-13 17:30:47 UTC
  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?
Comment 3 Håkon A. Hjortland 2004-01-13 19:15:36 UTC
Created attachment 23775 [details]
Requested by #2

/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/specs
Comment 4 Håkon A. Hjortland 2004-01-13 19:17:33 UTC
Created attachment 23776 [details]
Requested by #2

/usr/lib/gcc-lib/i486-pc-linux-gnu/2.95.3/specs
Comment 5 Håkon A. Hjortland 2004-01-13 19:29:46 UTC
/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 
Comment 6 bartron 2004-01-13 20:50:13 UTC
  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?)
Comment 7 Håkon A. Hjortland 2004-01-14 13:04:41 UTC
> (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
Comment 8 Heinrich Wendel (RETIRED) gentoo-dev 2004-01-15 12:42:39 UTC
what about just adding -ansi to cflags, it's easier but seems to have the same effect
Comment 9 Heinrich Wendel (RETIRED) gentoo-dev 2004-01-17 11:39:53 UTC
i added -ansi to cflags
Comment 10 Stewart (RETIRED) gentoo-dev 2004-01-18 10:47:22 UTC
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?
Comment 11 Brad Laue (RETIRED) gentoo-dev 2004-01-18 11:11:10 UTC
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
Comment 12 Håkon A. Hjortland 2004-01-18 15:39:12 UTC
The question is: Does Imake get the CFLAGS, and does it pass them on to cpp?
Comment 13 bartron 2004-01-18 17:27:03 UTC
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.
Comment 14 bartron 2004-01-18 17:28:38 UTC
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.
Comment 15 Heinrich Wendel (RETIRED) gentoo-dev 2004-01-19 03:20:43 UTC
patch applied on -r4, please test
Comment 16 Håkon A. Hjortland 2004-01-19 07:21:28 UTC
openmotif-2.1.30-r4 compiles fine on my machine now.
For "emerge info", see above.
Comment 17 Heinrich Wendel (RETIRED) gentoo-dev 2004-01-21 04:51:37 UTC
bartron: are you confident with that patch so i can close that bug?
Comment 18 Stewart (RETIRED) gentoo-dev 2004-01-22 10:33:33 UTC
The patch worked for me; OpenMotif compiled sucessfully on my systems.
Comment 19 Heinrich Wendel (RETIRED) gentoo-dev 2004-01-27 12:48:53 UTC
fine, marked -r4 stable :)