Gentoo Archives: gentoo-sparc

From: Alex McWhirter <alexmcwhirter@×××××××.us>
To: Mike Frysinger <vapier@g.o>
Cc: gentoo-sparc@l.g.o
Subject: Re: [gentoo-sparc] GLIBC Issues
Date: Tue, 19 Jan 2016 19:16:55
Message-Id: 569E8B9B.20304@triadic.us
In Reply to: [gentoo-sparc] GLIBC Issues by Alex McWhirter
1 On 01/19/2016 01:47 PM, Alex McWhirter wrote:
2 > In many places im seeing LD output this in the configure script of a
3 > multilib glibc ebuild. This is configuring 32bit glibc on a 64bit host.
4 >
5 > sparc:v9 architecture of input file `somefile' is incompatible with
6 > sparc output
7 >
8 >
9 >
10 > So it looks like LD is working right, but GCC is still compiling 64bit.
11 > Or it could be G++ compiling 64bit as i don't see a -m32 flag set for
12 > it? I seem some references to G++.
13 >
14
15 I found the issue here, but i'm not sure how to handle it. The logic in
16 common.eblit is wrong for sparc64. See below
17
18 <snip>
19 local cpu
20 case ${CTARGET} in
21 sparc64-*)
22 case $(get-flag mcpu) in
23 niagara[234])
24 if version_is_at_least 2.8 ; then
25 cpu="sparc64v2"
26 elif version_is_at_least 2.4 ; then
27 cpu="sparc64v"
28 elif version_is_at_least 2.2.3 ;
29 then
30 cpu="sparc64b"
31 fi
32 ;;
33 niagara)
34 if version_is_at_least 2.4 ; then
35 cpu="sparc64v"
36 elif version_is_at_least 2.2.3 ;
37 then
38 cpu="sparc64b"
39 fi
40 ;;
41 ultrasparc3)
42 cpu="sparc64b"
43 ;;
44 *)
45 # We need to force at least v9a
46 because the base build doesn't
47 # work with just v9.
48 #
49 https://sourceware.org/bugzilla/show_bug.cgi?id=19477
50 [[ -z ${cpu} ]] && append-flags
51 "-Wa,-xarch=v9a"
52 ;;
53 esac
54 ;;
55 </snip>
56
57 Pulling from CHOST and basing CTARGET off of that is probably not the
58 best idea for sparc64 because the result will always be 64 bit. Hence
59 why we have build errors when attempting 32bit multi lib.
60
61 Also, mcpu=ultrasparc will set the target to v9a and all sparv9 boxes
62 are backwards compatible to v9a. Ultrasparc being the lowest common
63 denominator for 64 bit means we can clean up the wild card a bit. That's
64 not a big deal really, forcing v9a should have a similar effect.
65
66 I need to research the specific targets a bit and maybe i can come up
67 with an answer. Do we have {$ABI} here?

Replies

Subject Author
Re: [gentoo-sparc] GLIBC Issues Mike Frysinger <vapier@g.o>