Gentoo Archives: gentoo-sparc

From: Alex McWhirter <alexmcwhirter@×××××××.us>
To: gentoo-sparc@l.g.o
Subject: Re: [gentoo-sparc] GLIBC Issues
Date: Wed, 20 Jan 2016 07:40:22
Message-Id: 569F39DF.8060805@triadic.us
In Reply to: Re: [gentoo-sparc] GLIBC Issues by Alex McWhirter
1 On 01/19/2016 10:15 PM, Alex McWhirter wrote:
2 > On 01/19/2016 05:18 PM, Mike Frysinger wrote:
3 >> On 19 Jan 2016 16:23, Alex McWhirter wrote:
4 >>> On 01/19/2016 04:05 PM, Mike Frysinger wrote:
5 >>>> if you delete that CHOST override, do the *_OPT values end up being
6 >>>> sparc-* ? if not, put `set -x` at the top of setup_env and `set +x` at
7 >>>> the bottom of setup_env and send that log over. sparc is the only one
8 >>>> that sets CTARGET_OPT in this sub-case, so there might be a bug in
9 >>>> there. unfortunately we can't get away from overriding the tuple for
10 >>>> glibc since user's can't really change it and glibc itself does no
11 >>>> probing :(. my preference otherwise would be to delete this block of
12 >>>> code entirely. -mike
13 >>> No it doesn't seem to make any difference. multilib_env doesn't set
14 >>> CTARGET or CHOST, it just sets the _$ABI variants. It seems to be a
15 >>> backup in case they aren't set in the profile.
16 >>>
17 >>> In my profile ABI and DEFAULT_ABI are set to sparc64 and glibc changes
18 >>> that to sparc32 when building multilib which is correct. The question i
19 >>> have is, where is CTARGET set? glibc's ebuild doesn't seem to do it and
20 >>> my profile doesn't either. multlib_env only sets CTARGET_$ABI which
21 >>> isn't use here.
22 >> CTARGET is set to CHOST by default by glibc itself. we might only be
23 >> doing that at a higher level though, so we might have to reset it in
24 >> there.
25 >>
26 >>> For what it's worth glibc will probe for which assembly to use based on
27 >>> the value of -mpcu. I've built enough LFS builds on sparc to know what
28 >>> happens when you pass glibc -mpcu=v9 and it need something more
29 >>> specific. But if you use -mcpu=ultrasparc,ultrasparc3,etc... glibc will
30 >>> pick the right assembly on it's own. At least the current version does
31 >>> anyways. So getting rid of *_OPT vars should be fine as long as people
32 >>> are something more specific than -mcpu=v9
33 >> i'm like 99% sure you're not looking at the right thing :). the issue
34 >> isn't multiarch/ifunc (which works), or for some feature testing (which
35 >> works), or for code generation by gcc itself (which works), but for
36 >> selection of subdirs which host different files. example:
37 >>
38 >> $ ../configure CC=sparc-unknown-linux-gnu-gcc \
39 >> CFLAGS='-O2 -mcpu=niagara -pipe' \
40 >> --prefix=/usr --host=sparcv9v-unknown-linux-gnu
41 >> $ grep ^config-sysdirs config.make
42 >> config-sysdirs = sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/fpu/multiarch sysdeps/sparc/sparc32/sparcv9/fpu/multiarch sysdeps/sparc/sparc32/sparcv9/fpu sysdeps/sparc/sparc32/fpu sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/fpu sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9 sysdeps/unix/sysv/linux/sparc/sparc32/fpu sysdeps/unix/sysv/linux/sparc/sparc32 sysdeps/ieee754/ldbl-64-128 sysdeps/ieee754/ldbl-opt sysdeps/unix/sysv/linux/sparc sysdeps/sparc/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix sysdeps/posix sysdeps/sparc/sparc32/sparcv9/multiarch sysdeps/sparc/sparc32/sparcv9 sysdeps/sparc/sparc32 sysdeps/wordsize-32 sysdeps/ieee754/ldbl-128 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/sparc/sparc32/soft-fp sysdeps/sparc/fpu sysdeps/sparc sysdeps/ieee754 sysdeps/generic
43 >>
44 >> $ ../configure CC=sparc-unknown-linux-gnu-gcc \
45 >> CFLAGS='-O2 -mcpu=niagara -pipe' \
46 >> --prefix=/usr --host=sparc-unknown-linux-gnu
47 >> $ grep ^config-sysdirs config.make
48 >> config-sysdirs = sysdeps/unix/sysv/linux/sparc/sparc32/fpu sysdeps/sparc/sparc32/fpu sysdeps/unix/sysv/linux/sparc/sparc32 sysdeps/ieee754/ldbl-64-128 sysdeps/ieee754/ldbl-opt sysdeps/unix/sysv/linux/sparc sysdeps/sparc/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix sysdeps/posix sysdeps/sparc/sparc32 sysdeps/wordsize-32 sysdeps/ieee754/ldbl-128 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/sparc/sparc32/soft-fp sysdeps/sparc/fpu sysdeps/sparc sysdeps/ieee754 sysdeps/generic
49 >>
50 >> see how there is significant difference here ?
51 >> -mike
52 > Oh... yea that is a very significant difference. It seems incredibly
53 > ulgy that glibc can't work this out on it's own. I wondering if we're
54 > missing a check here. It seems to work fine on sparc with a 64bit
55 > multilib env, but not sparc64 with a 32bit multilib env.
56 >
57
58 So 32bit libc is going to need a 32bit gcc, gcc is capable of -m32 but
59 it's libs are ELF 64 only. So we need to compile gcc with multilib as well.
60
61 gcc depends on libc, so we have a chicken and egg problem here. I am
62 trying to pass --without-headers and --with-newlib to gcc, but it still
63 looks for stubs-32.h which isn't there.
64
65 Trying now with --disable-shared but i don't see how that will make a
66 difference.

Replies

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