Bug 696199

Summary: gcc 64bit package has some extra files
Product: [Fedora] Fedora Reporter: Zdenek Kabelac <zkabelac>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jakub
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-13 16:29:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Zdenek Kabelac 2011-04-13 14:19:19 UTC
Description of problem:

Looks like some files in gcc package are dangling links:

/usr/lib/gcc/x86_64-redhat-linux/4.6.0/32
libgomp.so -> ../../../../libgomp.so.1.0.0
libmudflap.a -> ../../../i686-redhat-linux/4.6.0/libmudflap.a
libmudflapth.a -> ../../../i686-redhat-linux/4.6.0/libmudflapth.a
libquadmath.a -> ../../../i686-redhat-linux/4.6.0/libquadmath.a
libstdc++.a -> ../../../i686-redhat-linux/4.6.0/libstdc++.a
libsupc++.a -> ../../../i686-redhat-linux/4.6.0/libsupc++.a

I assume they should be a part of some 32bit devel package ?

i.e.:
rpm -ql gcc-4.6.0-3.fc15.x86_64 | grep libgomp
/usr/lib/gcc/x86_64-redhat-linux/4.6.0/32/libgomp.a
/usr/lib/gcc/x86_64-redhat-linux/4.6.0/32/libgomp.so
/usr/lib/gcc/x86_64-redhat-linux/4.6.0/libgomp.a
/usr/lib/gcc/x86_64-redhat-linux/4.6.0/libgomp.so
/usr/lib/gcc/x86_64-redhat-linux/4.6.0/libgomp.spec


Version-Release number of selected component (if applicable):
gcc-4.6.0-3.fc15.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Jakub Jelinek 2011-04-13 16:29:18 UTC
Those symlinks point to files from lib*devel.i686 packages, yes, and it is intentionally that way.

Comment 2 Zdenek Kabelac 2011-04-13 19:01:36 UTC
I don't understand - why the package for 64bit system contains dangling links to nonexistent files for i686 system - and even better - that it's intentional?

Links seems unusable -shouldn't they be installed with i686 devel packages?
Also - why there are in 'fact' i686  .a files?

Can I ask for some referencing links or some light explanation ?

Comment 3 Jakub Jelinek 2011-04-13 19:23:58 UTC
x86_64 gcc package supports compilation/linking of both 64-bit and 32-bit programs, but it is undesirable to Require the 32-bit lib*devel packages (which would bring in also 32-bit libraries), many people want 64-bit only installs.
Those that want to compile 32-bit programs can just
yum install glibc-devel.i686
(libgcc.i686, libstdc++-devel.i686, libmudflap-devel.i686, etc.).  All those packages are included in x86_64 distro.

Comment 4 Zdenek Kabelac 2011-04-13 19:57:50 UTC
Yep - that's exactly what I'd have expected - if I want to use -m32 - I need to install some i686 packages - so why placing completely unusable files into x86_64  packages when they should belong into i686 package.

Is 'gcc' scanning for the presence of these dangling links and refuse to start when they are not in the filesystem?

Is there any 'good' reason to NOT put those files into i686 devel packages?
(As this is exactly what every normal rpm does)

Comment 5 Jakub Jelinek 2011-04-13 20:08:55 UTC
gcc looks for those files in different places between gcc*.x86_64 and gcc*.i686 compilers.  gcc*.i686 it looks for them in /usr/lib/gcc/i686-redhat-linux/4.6.0/, while gcc*.x86_64 looks for them in /usr/lib/gcc/x86_64-redhat-linux/4.6.0/32/
when using -m32 option (and in /usr/lib/gcc/x86_64-redhat-linux/4.6.0/ when -m32 isn't used) (etc., the search is more complex than that).
So the symlinks ensure gcc*.x86_64 can actually find the files from i686 packages where they are actually present.  i686 packages certainly shouldn't be putting symlinks into x86_64-redhat-linux/32/ subdirectories.
On ppc/ppc64 and sparcv9/sparc64 things are even different, in i686/x86_64 world different triplets are used, but in ppc and sparc the same triplet is used, yet
depending on whether you e.g. install gcc*.ppc or gcc*.ppc64 compiler the default multilib is different and that affects where to search for files (either . for -m32 and 64/ for -m64, or . for -m64 and 32/ for -m32).
I just don't understand why are you fighting so hard against the symlinks, they have been there for many years already and it just works.

Comment 6 Zdenek Kabelac 2011-04-14 08:17:14 UTC
(In reply to comment #5)
> gcc looks for those files in different places between gcc*.x86_64 and gcc*.i686
> compilers.  gcc*.i686 it looks for them in
> /usr/lib/gcc/i686-redhat-linux/4.6.0/, while gcc*.x86_64 looks for them in
> /usr/lib/gcc/x86_64-redhat-linux/4.6.0/32/
> when using -m32 option (and in /usr/lib/gcc/x86_64-redhat-linux/4.6.0/ when
> -m32 isn't used) (etc., the search is more complex than that).
> So the symlinks ensure gcc*.x86_64 can actually find the files from i686
> packages where they are actually present.  i686 packages certainly shouldn't be
> putting symlinks into x86_64-redhat-linux/32/ subdirectories.

So it seems like there should be a new separate x86_64 package with i686 support for 64b gcc  - with full content of 
/usr/lib/gcc/x86_64-redhat-linux/4.6.0/32/
As those files have no use on 64bit Fedora (3.5MB) - unless you want to build 32bit binary.

> On ppc/ppc64 and sparcv9/sparc64 things are even different, in i686/x86_64
> world different triplets are used, but in ppc and sparc the same triplet is
> used, yet
> depending on whether you e.g. install gcc*.ppc or gcc*.ppc64 compiler the
> default multilib is different and that affects where to search for files
> (either . for -m32 and 64/ for -m64, or . for -m64 and 32/ for -m32).
> I just don't understand why are you fighting so hard against the symlinks, they
> have been there for many years already and it just works.

As I see the usage of 'dangling' symlinks is correctly installed distro as not the ideal solution - and just for curiosity - the problem shown to me - when I've been searching my disk drive for some type definition and noticed missing files.