Bug 1070905

Summary: glibc: Fail to build shared objects that use libmvec.so functions.
Product: [openSUSE] openSUSE Distribution Reporter: Martin Hauke <mardnh>
Component: BasesystemAssignee: Andreas Schwab <schwab>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: edera, forgotten_QhvvLugYbd, hsk17
Version: Leap 42.3   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Martin Hauke 2017-12-03 13:27:06 UTC
With gcc6 or gcc7 you can build shared objects which are optimized to call libmvec.so functions. When such calls go through the _finite aliases the linker is unable to assemble the final user shared object because the calls contain non-PIC relocs against shared object symbols.

The build failures being seen on Leap systems are:
$ gcc-6 ./log.c -O3 -fopenmp -ffast-math -I/usr/include -fPIC -shared -lm -o log.so
/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/libmvec_nonshared.a(svml_finite_alias.o_X86_64_PC32 against symbol `_ZGVbN2v_log@@GLIBC_2.22' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

The bug seems known fixed upstream:
https://sourceware.org/bugzilla/show_bug.cgi?id=19590
https://lists.debian.org/debian-glibc/2016/03/msg00125.html
Comment 1 Andreas Stieger 2017-12-03 13:35:18 UTC
*** Bug 1070906 has been marked as a duplicate of this bug. ***
Comment 2 Andreas Stieger 2017-12-03 17:39:36 UTC
Assign to SLE maintainer
Comment 3 Friedrich Haubensak 2017-12-05 09:08:29 UTC
was also hit by this bug.  please, would it be possible to implement the solution outlined in sourceware.org/bugzilla/show_bug.cgi?id=19590 into leap-42.3 glibc and release a patch?
Comment 4 ede rag 2017-12-11 12:21:17 UTC
Same bug on leap-42.2. 
This prevents sage-8.0 from being built:
ld: /usr/lib64/libmvec_nonshared.a(svml_finite_alias.oS): relocation R_X86_64_PC32 against symbol `_ZGVbN2v_log@@GLIBC_2.22' can not be used when making a shared object; recompile with -fPIC
Comment 5 ede rag 2017-12-18 13:06:59 UTC
The sage 8.1 build is indeed fixed by the upstream patch,
once incorporated in the glibc.spec:
https://build.opensuse.org/package/rdiff/home:ederag:branches:openSUSE:Leap:42.2:Update/glibc?linkrev=base&rev=2
and
sudo zypper install --oldpackage /var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/glibc-devel-2.22-0.x86_64.rpm

Unfortunately, no pull request seems possible at this point.
Comment 6 ede rag 2017-12-20 10:48:53 UTC
The process to be followed to emit a pull request is more involved because this package is inherited from SLE.
https://en.opensuse.org/openSUSE:Package_maintenance
https://en.opensuse.org/openSUSE:Maintenance_update_process
I'm ready to do this, but only after a pre-validation by the SLE maintainer.
Comment 8 Swamp Workflow Management 2018-01-12 14:11:12 UTC
SUSE-SU-2018:0074-1: An update that solves 7 vulnerabilities and has three fixes is now available.

Category: security (important)
Bug References: 1051042,1053188,1063675,1064569,1064580,1064583,1070905,1071319,1073231,1074293
CVE References: CVE-2017-1000408,CVE-2017-1000409,CVE-2017-15670,CVE-2017-15671,CVE-2017-15804,CVE-2017-16997,CVE-2018-1000001
Sources used:
SUSE Linux Enterprise Software Development Kit 12-SP3 (src):    glibc-2.22-62.3.4
SUSE Linux Enterprise Software Development Kit 12-SP2 (src):    glibc-2.22-62.3.4
SUSE Linux Enterprise Server for Raspberry Pi 12-SP2 (src):    glibc-2.22-62.3.4
SUSE Linux Enterprise Server 12-SP3 (src):    glibc-2.22-62.3.4
SUSE Linux Enterprise Server 12-SP2 (src):    glibc-2.22-62.3.4
SUSE Linux Enterprise Desktop 12-SP3 (src):    glibc-2.22-62.3.4
SUSE Linux Enterprise Desktop 12-SP2 (src):    glibc-2.22-62.3.4
SUSE CaaS Platform ALL (src):    glibc-2.22-62.3.4
OpenStack Cloud Magnum Orchestration 7 (src):    glibc-2.22-62.3.4
Comment 9 Swamp Workflow Management 2018-01-15 14:11:48 UTC
openSUSE-SU-2018:0089-1: An update that solves 7 vulnerabilities and has three fixes is now available.

Category: security (important)
Bug References: 1051042,1053188,1063675,1064569,1064580,1064583,1070905,1071319,1073231,1074293
CVE References: CVE-2017-1000408,CVE-2017-1000409,CVE-2017-15670,CVE-2017-15671,CVE-2017-15804,CVE-2017-16997,CVE-2018-1000001
Sources used:
openSUSE Leap 42.3 (src):    glibc-2.22-10.1, glibc-testsuite-2.22-10.1, glibc-utils-2.22-10.1
openSUSE Leap 42.2 (src):    glibc-2.22-4.12.1, glibc-testsuite-2.22-4.12.1, glibc-utils-2.22-4.12.1
Comment 10 Martin Hauke 2018-01-15 14:54:07 UTC
Update openSUSE-SU-2018:0089-1 fixed the issue.
Thanks!