Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 170146 - dev-libs/gmp-4.2.1 with -mcpu=ev67 fails as gcc doesnt pass cpu info to assembler
Summary: dev-libs/gmp-4.2.1 with -mcpu=ev67 fails as gcc doesnt pass cpu info to assem...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: Alpha Linux
: High normal
Assignee: Gentoo Toolchain Maintainers
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Whiteboard:
Keywords:
: 169696 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-09 17:47 UTC by Ilya Volynets (RETIRED)
Modified: 2011-01-16 03:20 UTC (History)
2 users (show)

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


Attachments
Full compile output (gmp.log,38.34 KB, text/plain)
2007-03-09 17:48 UTC, Ilya Volynets (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Volynets (RETIRED) gentoo-dev 2007-03-09 17:47:55 UTC
I actually tried two combinations so far, all failing in exactly same way:

CHOST=alphaev6-unknown-linux-gnu/CFLAGS=-march=ev67 mtune=ev67
CHOST=alphaev67-unknown-linux-gnu/CFLAGS=-march=ev67 mtune=ev67

I think I tried others as well, but I don't remember for sure.

In both cases end result was that compile failed with following error
(full log attached as well):

 ../mpn/m4-ccas --m4=m4 gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_mode1o -mcpu=ev67 -mtune=ev67 -O2 -pipe -g mode1o.asm  -fPIC -DPIC -o .libs/mode1o.o
m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_mode1o -DPIC mode1o.asm >tmp-mode1o.s
 gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_mode1o -mcpu=ev67 -mtune=ev67 -O2 -pipe -g tmp-mode1o.s -fPIC -DPIC -o .libs/mode1o.o
tmp-mode1o.s: Assembler messages:
tmp-mode1o.s:117: Error: macro requires $at register while noat in effect



Reproducible: Always

Steps to Reproduce:
Comment 1 Ilya Volynets (RETIRED) gentoo-dev 2007-03-09 17:48:50 UTC
Created attachment 112729 [details]
Full compile output
Comment 2 Ilya Volynets (RETIRED) gentoo-dev 2007-04-30 14:43:58 UTC
Little additional info: compiling with default -mcpu/-mtune works.
Comment 3 SpanKY gentoo-dev 2007-05-19 07:38:04 UTC
-march is invalid on alpha ... i'm guessing you meant -mcpu ... in which case, using -mcpu=ev67 -mtune=ev67 is dumb when the cpus are the same ... but i digress

built fine for me:
CFLAGS="-mieee -pipe -O2 -mcpu=ev67"
CHOST="alpha-unknown-linux-gnu"

but i'll try bumping CHOST ... this will take some time :p
Comment 4 Jose Luis Rivero (yoswink) (RETIRED) gentoo-dev 2007-05-29 14:57:29 UTC
*** Bug 169696 has been marked as a duplicate of this bug. ***
Comment 5 Jose Luis Rivero (yoswink) (RETIRED) gentoo-dev 2007-05-29 15:03:25 UTC
In bug #169696 George is having the same problem using CHOST="alphaev56-unknown-linux-gnu".

The revision 4.2.1-r1 compiles and passes all the tests in alpha ev67 using CHOST="alpha-unknown-linux-gnu", so probably the problems appear when something different than alpha-unkown is set.
Comment 6 Mark Loeser (RETIRED) gentoo-dev 2008-07-06 02:51:06 UTC
alpha: is the normal chost set to anything other than alpha-*?  In other words, is there anything to fix here?
Comment 7 Tobias Klausmann (RETIRED) gentoo-dev 2008-12-14 19:48:28 UTC
Not really. CHOST different alpha-* is used mainly on Tru64 and some people have used it on Linux in the past. I'd rather not support it since it breaks all kinds of stuff if you do. As such I recommend closing this bugs as Inv.
Comment 8 Tobias Klausmann (RETIRED) gentoo-dev 2009-02-01 17:30:05 UTC
Closing as invalid since we don't support other CHOSTs than alpha-*
Comment 9 SpanKY gentoo-dev 2009-11-06 11:39:11 UTC
the problem here is that alpha gcc does not pass appropriate -m flag down to the assembler.  so even if you do `gcc -c -mcpu=ev67 foo.s`, the assembler does `as foo.s` which means the default assembler is still targetting ev4.

it can be worked around in gmp by adding -Wa,-m<cpu> to match the -mcpu
Comment 10 SpanKY gentoo-dev 2009-11-07 06:47:23 UTC
guess we just need to add %{mcpu=*:-m%*} to ASM_SPEC in gcc/config/alpha/elf.h
Comment 11 SpanKY gentoo-dev 2009-11-07 13:24:47 UTC
and that does indeed do the trick, so i'll try sending it upstream

# portageq envvar CHOST CFLAGS
alphaev68-unknown-linux-gnu
-mieee -pipe -O2 -mcpu=ev67

# gcc --version | head -n1
gcc (Gentoo 4.4.2 p1.0) 4.4.2

# emerge gmp
...
>>> Completed installing gmp-4.3.1 into /var/tmp/portage/dev-libs/gmp-4.3.1/image/

strip: alphaev68-unknown-linux-gnu-strip --strip-unneeded -R .comment
   usr/lib/libgmpxx.so.4.1.0
   usr/lib/libgmp.so.3.5.0
   usr/lib/libgmpxx.a
   usr/lib/libgmp.a
ecompressdir: bzip2 -9 /usr/share/info
removing executable bit: usr/lib/libgmp.la
removing executable bit: usr/lib/libgmpxx.la

>>> Installing dev-libs/gmp-4.3.1
...
Comment 12 SpanKY gentoo-dev 2009-11-13 18:31:07 UTC
upstream accepted the patch and ive queued it for gcc-4.*
Comment 13 Ryan Hill (RETIRED) gentoo-dev 2011-01-15 02:08:49 UTC
Did this ever get put upstream?
Comment 14 SpanKY gentoo-dev 2011-01-16 03:20:52 UTC
hrm, it should have been.  it was approved, but i guess people keep expecting me to make commits myself.  i'll try and find someone to get me write access and i'll take care of merging it.