Bug 1326896

Summary: -lpthread missing when built with gcc-go on s390x
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: dockerAssignee: Antonio Murdaca <amurdaca>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: adimania, admiller, amurdaca, bugproxy, dwalsh, hannsj_uhl, ichavero, jcajka, jchaloup, lsm5, marianne, miminar, nalin, skumari, vbatts
Target Milestone: ---   
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: docker-1.10.3-19.gitee81b72.fc24 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-18 18:34:49 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: 467765, 1208172    
Attachments:
Description Flags
build.log
none
docker s390x build fix none

Description Dan Horák 2016-04-13 17:07:57 UTC
Created attachment 1146918 [details]
build.log

Build fails on s390x with gcc-go, probably -lpthread missing from the LDFLAGS.

...
+++ echo 'Building: bundles/1.10.3/dynbinary/docker-1.10.3'
+++ go build -o bundles/1.10.3/dynbinary/docker-1.10.3 -a -tags 'autogen sqlite_omit_load_extension selinux seccomp daemon journald' -installsuffix netgo -ldflags '
		-w
		
	' ./docker
Building: bundles/1.10.3/dynbinary/docker-1.10.3
go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags
# _/builddir/build/BUILD/docker-f8a9a2a9fee151828f9deed04cb40e88bc3b2f56/docker
/usr/bin/ld: $WORK/libgo-sqlite3.a452538637(sqlite3-binding.o): undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2'
/usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.OxHW3Z (%build)
    Bad exit status from /var/tmp/rpm-tmp.OxHW3Z (%build)
...

For full logs please see http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=2183419 or attachment for build.log.


Version-Release number of selected component (if applicable):
docker-1.10.3-4.gitf8a9a2a.fc24

Comment 1 Dan Horák 2016-04-13 17:09:54 UTC
I think we saw this problem with sqlite3 and -lpthread earlier, but don't know if there was a solution.

Comment 2 Sinny Kumari 2016-06-02 13:31:54 UTC
Created attachment 1164091 [details]
docker s390x build fix

Reason of build failure on s390x was indeed missing linkage to pthread library.

Attached patch fixes the build issue.
F24 scratch build for s390x - http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=2250068

Also, did scratch build for primary arches  (http://koji.fedoraproject.org/koji/taskinfo?taskID=14352619) and powerpc (http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=3429464).

Docker build for all architectures looks good.

Comment 3 Dan Horák 2016-06-02 14:21:30 UTC
Maybe the patch can be applied unconditionally, because it should affect only gcc-go based builds and it's only s390x.

Comment 4 Sinny Kumari 2016-06-03 06:55:06 UTC
(In reply to Dan Horák from comment #3)
> Maybe the patch can be applied unconditionally, because it should affect
> only gcc-go based builds and it's only s390x.

In ExclusiveArch section of docker spec file, it also includes %{mips} and %{ix86} architectures. Do they also use golang package instead of gcc-go ?

Comment 5 Dan Horák 2016-06-03 08:01:01 UTC
(In reply to Sinny Kumari from comment #4)
> (In reply to Dan Horák from comment #3)
> > Maybe the patch can be applied unconditionally, because it should affect
> > only gcc-go based builds and it's only s390x.
> 
> In ExclusiveArch section of docker spec file, it also includes %{mips} and
> %{ix86} architectures. Do they also use golang package instead of gcc-go ?

[sharkcz@devel10 ~]$ rpmbuild --eval %gccgo_arches
s390x mips mipsel mipsr6 mipsr6el mips64 mips64el mips64r6 mips64r6el

so %{ix86} is golang, but mips is gcc-go (based on F-24 values)

Comment 6 Fedora Admin XMLRPC Client 2016-06-08 14:11:17 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Fedora Update System 2016-06-09 21:40:30 UTC
docker-1.10.3-19.gitee81b72.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-d0e7173e52

Comment 8 Fedora Update System 2016-06-10 17:59:59 UTC
docker-1.10.3-19.gitee81b72.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-d0e7173e52

Comment 9 Fedora Update System 2016-06-18 18:34:43 UTC
docker-1.10.3-19.gitee81b72.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.