Bug 1642077 - devtoolset-7-gcc dangling symlinks break linking with g++ -m32
Summary: devtoolset-7-gcc dangling symlinks break linking with g++ -m32
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: softwarecollections.org
Classification: Community
Component: devtoolset-7
Version: 1.0
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Marek Polacek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-23 14:46 UTC by franz.sirl-kernel
Modified: 2018-11-08 17:16 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-08 16:58:37 UTC
Embargoed:


Attachments (Terms of Use)

Description franz.sirl-kernel 2018-10-23 14:46:44 UTC
Description of problem:
When trying to compile+link a C++ application with "g++ -m32", the linking step fails.

Version-Release number of selected component (if applicable):
devtoolset-7-7.1-4.el7.x86_64
devtoolset-7-binutils-2.28-11.el7.x86_64
devtoolset-7-gcc-7.3.1-5.13.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. create helloworld.cpp:
#include <iostream>

int main()
{
    std::cout << "Hello world!" << std::endl;
    return 0;
}

2. compile with: scl enable devtoolset-7 "g++ -m32 helloworld.cpp"

Actual results:
Doesn't link successfully


Expected results:
Successful link

Additional info:
<mock-chroot> sh-4.2# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core) 

<mock-chroot> sh-4.2# rpm -q devtoolset-7 devtoolset-7-binutils devtoolset-7-gcc
devtoolset-7-7.1-4.el7.x86_64
devtoolset-7-binutils-2.28-11.el7.x86_64
devtoolset-7-gcc-7.3.1-5.13.el7.x86_64

<mock-chroot> sh-4.2# scl enable devtoolset-7 "g++ -m32 helloworld.cpp"
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: skipping incompatible /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/libstdc++_nonshared.a when searching for -lstdc++_nonshared
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -lstdc++_nonshared
collect2: error: ld returned 1 exit status

<mock-chroot> sh-4.2# symlinks /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/
dangling: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/libstdc++.a -> ../../../i686-redhat-linux/7/libstdc++.a
dangling: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/libmpxwrappers.a -> ../../../i686-redhat-linux/7/libmpxwrappers.a
dangling: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/libstdc++_nonshared.a -> ../../../i686-redhat-linux/7/libstdc++_nonshared.a
dangling: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/libubsan.a -> ../../../i686-redhat-linux/7/libubsan.a
dangling: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/libatomic.a -> ../../../i686-redhat-linux/7/libatomic.a
dangling: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/libitm.a -> ../../../i686-redhat-linux/7/libitm.a
dangling: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/libasan.a -> ../../../i686-redhat-linux/7/libasan.a
dangling: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/libquadmath.a -> ../../../i686-redhat-linux/7/libquadmath.a
dangling: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/libstdc++fs.a -> ../../../i686-redhat-linux/7/libstdc++fs.a
dangling: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/libasan_preinit.o -> ../../../i686-redhat-linux/7/libasan_preinit.o
dangling: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/libcilkrts.a -> ../../../i686-redhat-linux/7/libcilkrts.a
dangling: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/32/libmpx.a -> ../../../i686-redhat-linux/7/libmpx.a

Comment 1 Marek Polacek 2018-11-08 16:58:37 UTC
Hi Franz,

please make sure that you have the following packages installed when using -m32:

glibc-devel.i686
libgcc.i686
libstdc++.i686
devtoolset-7-libstdc++-devel.i686

I suspect you're missing the last one.  With that:

# rpm -q devtoolset-7-libstdc++-devel
devtoolset-7-libstdc++-devel-7.3.1-5.13.el7.x86_64
devtoolset-7-libstdc++-devel-7.3.1-5.13.el7.i686
# scl enable devtoolset-7 "g++ -m32 x.C"
# ./a.out 
Hello world!

Comment 2 franz.sirl-kernel 2018-11-08 17:11:04 UTC
(In reply to Marek Polacek from comment #1)
> Hi Franz,
> 
> please make sure that you have the following packages installed when using
> -m32:
> 
> glibc-devel.i686
> libgcc.i686
> libstdc++.i686

These are installed.

> devtoolset-7-libstdc++-devel.i686

Where do I get this one? Seems it's not part of the CentOS SCL repository. Is this a distribution packaging bug?

Comment 3 Marek Polacek 2018-11-08 17:16:08 UTC
(In reply to franz.sirl-kernel from comment #2)
> > devtoolset-7-libstdc++-devel.i686
> 
> Where do I get this one? Seems it's not part of the CentOS SCL repository.
> Is this a distribution packaging bug?

Sorry, I don't know enough about the CentOS SCL repository.  But if that package isn't available, then that seems like a bug.


Note You need to log in before you can comment on or make changes to this bug.