Bug 1779597

Summary: After installation of gcc-c++ broken symlinks under /usr/lib/gcc/x86_64-redhat-linux/8/32
Product: Red Hat Enterprise Linux 8 Reporter: Michele Casaburo <mcasabur>
Component: gccAssignee: Marek Polacek <mpolacek>
gcc sub component: system-version QA Contact: Alexandra Petlanová Hájková <ahajkova>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: ahajkova, fweimer, jakub, mcermak, ohudlick, sipoyare, swachira, vmukhame
Version: 8.1Keywords: Bugfix, Triaged
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-8.4.1-1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 13:28:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1894575    

Description Michele Casaburo 2019-12-04 10:43:04 UTC
Description of problem:

After installation of package gcc-c++ under /usr/lib/gcc/x86_64-redhat-linux/8/32 there are broken symlinks

Version-Release number of selected component (if applicable):

gcc-c++-8.3.1-4.5.el8.x86_64

How reproducible:

Steps to Reproduce:
1. Install a RHEL 8.1 machine
2. Install gcc-c++
3. list content of /usr/lib/gcc/x86_64-redhat-linux/8/32

Actual results:
The symlinks are all broken:


# ls -l /usr/lib/gcc/x86_64-redhat-linux/8/32
total 3832
-rw-r--r--. 1 root root    2552 Jul 16 22:31 crtbegin.o
-rw-r--r--. 1 root root    2684 Jul 16 22:31 crtbeginS.o
-rw-r--r--. 1 root root    2932 Jul 16 22:31 crtbeginT.o
-rw-r--r--. 1 root root    1124 Jul 16 22:31 crtend.o
-rw-r--r--. 1 root root    1124 Jul 16 22:31 crtendS.o
-rw-r--r--. 1 root root    6440 Jul 16 22:31 crtfastmath.o
-rw-r--r--. 1 root root    1152 Jul 16 22:31 crtoffloadbegin.o
-rw-r--r--. 1 root root    1148 Jul 16 22:31 crtoffloadend.o
-rw-r--r--. 1 root root    1268 Jul 16 22:31 crtoffloadtable.o
-rw-r--r--. 1 root root    2972 Jul 16 22:31 crtprec32.o
-rw-r--r--. 1 root root    2980 Jul 16 22:31 crtprec64.o
-rw-r--r--. 1 root root    2972 Jul 16 22:31 crtprec80.o
lrwxrwxrwx. 1 root root      38 Jul 16 22:31 libasan.a -> ../../../i686-redhat-linux/8/libasan.a
-rw-r--r--. 1 root root   13420 Jul 16 22:31 libasan_preinit.o
-rw-r--r--. 1 root root      36 Jul 16 22:31 libasan.so
lrwxrwxrwx. 1 root root      40 Jul 16 22:31 libatomic.a -> ../../../i686-redhat-linux/8/libatomic.a
-rw-r--r--. 1 root root      38 Jul 16 22:31 libatomic.so
-rw-r--r--. 1 root root 3324634 Jul 16 22:34 libgcc.a
-rw-r--r--. 1 root root   49396 Jul 16 22:34 libgcc_eh.a
-rw-r--r--. 1 root root     191 Jul 16 22:31 libgcc_s.so
-rw-r--r--. 1 root root   67306 Jul 16 22:34 libgcov.a
-rw-r--r--. 1 root root  379162 Jul 16 22:34 libgomp.a
lrwxrwxrwx. 1 root root      28 Jul 16 22:31 libgomp.so -> ../../../../libgomp.so.1.0.0
lrwxrwxrwx. 1 root root      37 Jul 16 22:31 libitm.a -> ../../../i686-redhat-linux/8/libitm.a
-rw-r--r--. 1 root root      35 Jul 16 22:31 libitm.so
lrwxrwxrwx. 1 root root      42 Jul 16 22:31 libquadmath.a -> ../../../i686-redhat-linux/8/libquadmath.a
-rw-r--r--. 1 root root      40 Jul 16 22:31 libquadmath.so
lrwxrwxrwx. 1 root root      40 Jul 16 22:31 libstdc++.a -> ../../../i686-redhat-linux/8/libstdc++.a
lrwxrwxrwx. 1 root root      42 Jul 16 22:31 libstdc++fs.a -> ../../../i686-redhat-linux/8/libstdc++fs.a
lrwxrwxrwx. 1 root root      31 Jul 16 22:31 libstdc++.so -> ../../../../libstdc++.so.6.0.25
lrwxrwxrwx. 1 root root      40 Jul 16 22:31 libsupc++.a -> ../../../i686-redhat-linux/8/libsupc++.a
lrwxrwxrwx. 1 root root      39 Jul 16 22:31 libubsan.a -> ../../../i686-redhat-linux/8/libubsan.a
-rw-r--r--. 1 root root      37 Jul 16 22:31 libubsan.so


Expected results:

no broken symlinks on installation of gcc-c++

Additional info:

several of those symlinks can be satisfied installing further packages:

- libstdc++-devel.i686 (repo rhel-8-for-x86_64-appstream-rpms)
- libstdc++-static.i686 (repo codeready-builder-for-rhel-8-x86_64-rpms)
- libatomic-static.i686 (repo rhel-8-for-x86_64-appstream-rpms)
- libgomp.i686 (repo rhel-8-for-x86_64-appstream-rpms)

but the following links remains broken:
lrwxrwxrwx. 1 root root   38 Jul 16 22:31 libasan.a -> ../../../i686-redhat-linux/8/libasan.a
lrwxrwxrwx. 1 root root   37 Jul 16 22:31 libitm.a -> ../../../i686-redhat-linux/8/libitm.a
lrwxrwxrwx. 1 root root   42 Jul 16 22:31 libquadmath.a -> ../../../i686-redhat-linux/8/libquadmath.a
lrwxrwxrwx. 1 root root   39 Jul 16 22:31 libubsan.a -> ../../../i686-redhat-linux/8/libubsan.a

Comment 1 Jakub Jelinek 2019-12-04 10:51:26 UTC
This is completely intentional, the gcc.x86_64 etc. packages must not force installation of *.i686 packages, and the symlinks will be satisfied if the corresponding *.i686 packages are installed, if not, the compiler will simply support -m64 only or -m32 only for compilation that doesn't need those.
For libasan.a, you can install libasan-static.i686, for libitm.a libitm-static.i686, for libquadmath.a libquadmath-static.i686, for libubsan.a libubsan-static.i686.

Comment 2 Florian Weimer 2019-12-04 11:01:24 UTC
With weak and rich dependencies we could perhaps improve the situation somewhat, e.g. recommend installation of the i686 packages if glibc-devel.i686 or glibc.i686 is installed.  Recommends: instead of Requires: means that the user can remove the packages again, and they will only get them if there are already some 32-bit multilibs.

It looks like something that could we try in Fedora.

Comment 3 Michele Casaburo 2019-12-04 11:20:23 UTC
(In reply to Jakub Jelinek from comment #1)
> This is completely intentional, the gcc.x86_64 etc. packages must not force
> installation of *.i686 packages, and the symlinks will be satisfied if the
> corresponding *.i686 packages are installed, if not, the compiler will
> simply support -m64 only or -m32 only for compilation that doesn't need
> those.

I understand, and I definitely agree that forcing  i686 packages installation would be a bad idea.
Just my 2c here, as I might miss apiece, but wouldn't be cleaner if the symlinks were created upon installation of the relevant i686 packages ?

My customer, who is indeed building 32bits applications, noticing the broken links did not have a good impression.

> For libasan.a, you can install libasan-static.i686, for libitm.a
> libitm-static.i686, for libquadmath.a libquadmath-static.i686, for
> libubsan.a libubsan-static.i686.

I had a quick check again, but I could not find those packages in any RHEL8 related repository.

These are available for RHEL7 
libasan-static.i686
libitm-static.i686
libquadmath-static.i686

while I could not find libubsan-static.i686 anywhere

Comment 4 Sam Wachira 2020-02-17 09:56:04 UTC
> wouldn't be cleaner if the symlinks were created upon installation of the relevant i686 packages ?
Can we get a response on this?

Some i686 packages are missing from RHEL 8 repositories for which there are still broken links. Should this not be addressed?

Comment 5 Marek Polacek 2020-02-25 18:10:43 UTC
libubsan-static is provided via devtoolset-9-libubsan-devel on RHEL 7.

We build 

libasan-static.i686
libitm-static.i686
libquadmath-static.i686
libubsan-static.i686

for RHEL 8 too, they just are not available in BaseOS or AppStream or CRB for some reason.

Comment 6 Sam Wachira 2020-02-25 18:59:42 UTC
Thanks Marek. I have raised a request for these packages to be added to RHEL 8 repos.

Comment 28 errata-xmlrpc 2021-05-18 13:28:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (gcc bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1571