Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 12775 - Compilation of XFree-4.2.1-r2 fails with -march=k6-2 -Os
Summary: Compilation of XFree-4.2.1-r2 fails with -march=k6-2 -Os
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
: 41443 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-12-27 03:24 UTC by Meinolf Sander
Modified: 2004-11-21 15:16 UTC (History)
5 users (show)

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


Attachments
Error log (errlog.bz2,210.41 KB, text/bz2)
2002-12-28 07:24 UTC, Meinolf Sander
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Meinolf Sander 2002-12-27 03:24:24 UTC
I tried several times to emerge xfree4.2.1-r2.ebuild (and
similar ebuilds), but it reproducibly breaks at this point:

installing in lib/GL/mesa/src/OSmesa...
make[4]: Entering directory `/var/tmp/portage/xfree-4.2.1-r2/
work/xc/lib/GL/mesa/src/OSmesa'
make[4]: *** No rule to make target `../../../../../lib/GL/mesa/
src/unshared/vertices.o', needed by `libOSMesa.a'.  Stop.
make[4]: Leaving directory `/var/tmp/portage/xfree-4.2.1-r2/
work/xc/lib/GL/mesa/src/OSmesa'
make[3]: *** [install] Error 2
make[3]: Leaving directory `/var/tmp/portage/xfree-4.2.1-r2/
work/xc/lib/GL'
make{2]: *** [install] Error 2
make[2]: Leaving directory `/var/tmp/portage/xfree-4.2.1-r2/
work/xc/lib'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/var/tmp/portage/xfree-4.2.1-r2/
work/xc'
make: *** [install] Error 2

!!! ERROR: x11-base/xfree-4.2.1-r2 failed.
!!! Function src_install, Line 206, Exitcode 2
!!! (no error message)


I'm using gcc 3.2.1, portage 2.0.46-r2, CFLAGS="-march=k6-2
-Os -pipe" and haven't set any USE parameters in /etc/make.conf.
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-27 12:33:14 UTC
Please include a more extensive log, thanks.
Comment 2 Meinolf Sander 2002-12-28 06:08:31 UTC
I logged the whole emerging process. The log comprises ~50000 lines
and there are a number of error messages in it, so I don't know
how much to quote. Would it be okay to send the compressed log file
(~200 KB) to you?
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-28 06:32:34 UTC
Just bzip2 it and attatch here, thanks.
Comment 4 Meinolf Sander 2002-12-28 07:24:27 UTC
Created attachment 6802 [details]
Error log
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-28 12:06:59 UTC
Ok, here are the real problem:

--------------------------------------------------------------------------------
gcc -c -march=k6-2 -Os -pipe  -ansi -pedantic -Wall -Wpointer-arith 
-I../../../../../../exports/include/X11 -I../../../../../../include/extensions
-I../../../../../../extras/Mesa/src
-I../../../../../../lib/GL/mesa/src/drv/gamma -I../../../../../../lib/GL/dri
-I../../../../../../lib/GL/glx             -I../../../../../../exports/include
-I../../../../../../exports/include/GL             
-I../../../../../../lib/GL/mesa/dri            
-I../../../../../../programs/Xserver/GL/dri            
-I../../../../../../programs/Xserver/hw/xfree86/drivers/glint          
-I../../../../../../programs/Xserver/hw/xfree86/os-support  -I../../../../../..
-I../../../../../../exports/include   -Dlinux -D__i386__
-D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE
-D_SVID_SOURCE  -D_GNU_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO -DXTHREADS 
-D_REENTRANT -DXUSE_MTSAFE_API    -DMALLOC_0_RETURNS_NULL -DGLXEXT -DXF86DRI
-DGLX_DIRECT_RENDERING -DGLX_USE_DLOPEN -DGLX_USE_MESA -DUSE_X86_ASM
-DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM     -fPIC
../../../../../../lib/GL/mesa/src/vertices.c
{standard input}: Assembler messages:
{standard input}:70: Error: value of ffffffffffffff7f too large for field of 1
bytes at 000000000000009c
make[6]: *** [../../../../../../lib/GL/mesa/src/vertices.o] Error 1
make[6]: Target `all' not remade because of errors.
make[6]: Target `all' not remade because of errors.
make[6]: Leaving directory
`/var/tmp/portage/xfree-4.2.1-r2/work/xc/lib/GL/mesa/src/drv/gamma'
--------------------------------------------------------------------------------

Usually this is caused by buggy gcc/binutils.  Either:

1)  Try to merge with CFLAGS="-march=k6-2 -O2 -pipe"

2)  Try to merge with CFLAGS="-march=i586 -O2 -pipe"

3)  Remerge binutils with CFLAGS="-march=i586 -O2 -pipe",
    and then xfree.

Let me know, thanks.
Comment 6 Meinolf Sander 2002-12-29 02:55:02 UTC
Now I tried to merge with CFLAGS="-march=k6-2 -O2 -pipe", and that worked.

Thanks a lot for your help.
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-29 04:20:21 UTC
Ok, thanks, I will update the ebuild to look for -Os.
Comment 8 Bret Towe 2003-05-29 01:52:13 UTC
i did some testing with -Os with gcc 3.2.2 and 3.2.3 both seem to not have this problem on athlon-xp, k6-2, and pentium2
Comment 9 Steve 2003-10-03 12:06:29 UTC
My experience corroborates comment #8:  gcc 3.2.3 with -Os compiles xfree86
fine(ebuild xfree-4.3.0-r2) and as far as I can tell so far, the result runs
without problems too.

Can we make the replace-flags command in the ebuild conditional on the gcc
version being one that's known to cause the compile failure?
Comment 10 Donnie Berkholz (RETIRED) gentoo-dev 2004-02-13 12:08:00 UTC
*** Bug 41443 has been marked as a duplicate of this bug. ***
Comment 11 Cesar Crusius 2004-02-24 14:16:05 UTC
Is this bug really fixed? The ebuild still can't cope with -Os even tough comments #8 and #9 indicate that it is possible to do so.
Comment 12 Cesar Crusius 2004-02-24 14:22:02 UTC
By the way, I'm trying to compile XFree-4.3.0r5 but the problem is the same (-Os gets replaced by -O2 unconditionally).
Comment 13 Heinrich Wendel (RETIRED) gentoo-dev 2004-04-13 11:04:26 UTC
works fine here with -Os, maybe we can include it again?
Comment 14 Andrew Bevitt 2004-04-13 18:07:18 UTC
-Os will be filtered by strip-flags unless you are running on ~${ARCH} (ie ~x86)

However if you are running on ~x86 then -Os is perfectly legal, but xfree-4.3.0-r6 is the only 4.3.0 or earlier version we have in portage that uses ~x86. So if you are using 4.2.1 or 4.3.0-r5 then -Os will be striped from strip-flags not the actual ebuild itself.

In other words if you want to run in the stable profile you cant have -Os (among others).

Lanius when you said it works fine with -Os which versions of xfree and gcc were you refering to?
Comment 15 Donnie Berkholz (RETIRED) gentoo-dev 2004-04-13 20:30:10 UTC
My impression was that it doesn't matter what the keyword on the ebuild is, it matters what the person's ACCEPT_KEYWORDS setting is. For example, ACCEPT_KEYWORDS=~x86 emerge =xfree-4.3.0-r5 would allow -Os. But I haven't read the code and don't have access to it now.
Comment 16 Heinrich Wendel (RETIRED) gentoo-dev 2004-04-14 10:16:36 UTC
i successfully compile xorg-x11 with -march=athlon-xp -Os

There currently is the following line in all xfree and xorg-x11 ebuilds:

replace-flags "-Os" "-O2"

so i think it is always replaced
Comment 17 Donnie Berkholz (RETIRED) gentoo-dev 2004-04-14 10:47:23 UTC
Ah yes, forgot about that. I was just thinking of the strip-flags.
Comment 18 Andrew Bevitt 2004-04-14 17:30:26 UTC
Yes I was only thinking of strip-flags aswell.

So what do we want to do?
1) Filter -march=k6* and replace it with -march=i586
2) Replace -Os with -O2 only on k6*?

The first one is probably more simple and we could then get rid of the replace-flags "-Os" "-O2" all together...

Oppinions?
Comment 19 Heinrich Wendel (RETIRED) gentoo-dev 2004-04-15 07:27:18 UTC
comment #8 says, that recent versions compile with -march=k6-2 -Os as well
Comment 20 Stan Harle 2004-06-25 05:07:04 UTC
I was getting the same error on a Pentium 4.  I tried rebuilding binutils and gcc to no avail, and finally ended up bootstrapping.
  I started with stage2. Previously, I built this system from scratch (stage1) and had gotten no errors at all, and had gnome and xfree working just fine.
  I didn't leave enough space on my hard drive and was trying to save a little time on the rebuild by starting with stage2. Isn't that always the way?
  After bootstrapping, the system and xfree have compiled quite happily.

Comment 21 Heinrich Wendel (RETIRED) gentoo-dev 2004-08-02 01:34:19 UTC
so can you finally remove it donnie?
Comment 22 Collins Richey 2004-08-08 14:41:28 UTC
fyi. I have just altered the ebuild and compiled xorg-x11-6.7.0-r2 with -Os. The compiles were successful and X runs just fine. Using cflags -Os -pipe -march=pentium4 -fomit-frame-pointer. I'm on glibc-2.3.4.20040619-r1 (nptl) and gcc-3.3.4-r1. Running kernel gentoo-dev-sources-2.6.7-r12. So this is looking more and more like a K6 only problem.
Comment 23 Heinrich Wendel (RETIRED) gentoo-dev 2004-09-25 08:49:39 UTC
spyderous: i know you are busy, but this one is quite easy to fix ;)
Comment 24 Donnie Berkholz (RETIRED) gentoo-dev 2004-09-25 17:49:28 UTC
Let me get this straight:

The combination of k6* and -Os is broken with earlier gcc versions than 3.2.2. So we'll check for >=3.2.2 || strip -Os. Sound good?
Comment 25 Heinrich Wendel (RETIRED) gentoo-dev 2004-09-26 02:16:23 UTC
sounds really good ;)
Comment 26 Donnie Berkholz (RETIRED) gentoo-dev 2004-11-03 19:02:10 UTC
Added to 6.8.0-r2.
Comment 27 David Guembel (RETIRED) gentoo-dev 2004-11-21 15:11:55 UTC
I think the same fix should be applied to xfree just as well. However, the ebuild still replaces all -Os with -O2:

grep '\-Os' /usr/portage/x11-base/xfree/xfree-4.3.0-r8.ebuild
        # Bug #12775 .. fails with -Os.
        replace-flags "-Os" "-O2


Moreover, -Os is not in ALLOWED_FLAGS, I think that should also be changed.

[Additional verification note: I have successfully compiled (and am using ;) the above mentioned ebuild with the appropriate changes to allow -Os. (I also allowed -march=pentium4; just mentioning for the sake of completeness ;)  ]
Comment 28 Donnie Berkholz (RETIRED) gentoo-dev 2004-11-21 15:16:39 UTC
xfree is deprecated and will not be getting anything even resembling a new feature, sorry.

By the way, your grep can screw things up pretty easily because it won't catch whether something's inside an `if;then` construct.