Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 581278 - dev-lang/go: failed to emerge go with binary format error on ppc64le
Summary: dev-lang/go: failed to emerge go with binary format error on ppc64le
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: PPC64 Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-26 17:14 UTC by Leno Hou
Modified: 2016-04-28 16:46 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leno Hou 2016-04-26 17:14:39 UTC
When emerge go on ppc64le platform, failed with

##### Building Go bootstrap tool.
cmd/dist
./make.bash: line 126: /var/tmp/portage/dev-lang/go-1.6.1/work/go-linux-ppc64-bootstrap/bin/go: cannot execute binary file: Exec format error
 * ERROR: dev-lang/go-1.6.1::gentoo failed (compile phase):


Reproducible: Always

Steps to Reproduce:
>>> Emerging (1 of 1) dev-lang/go-1.6.1::gentoo
>>> Downloading 'http://distfiles.gentoo.org/distfiles/go-linux-ppc64-bootstrap.tbz'
--2016-04-26 17:01:34--  http://distfiles.gentoo.org/distfiles/go-linux-ppc64-bootstrap.tbz
Resolving distfiles.gentoo.org... 156.56.247.195, 140.211.166.134, 64.50.236.52, ...
Connecting to distfiles.gentoo.org|156.56.247.195|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 45266082 (43M) [text/plain]
Saving to: ‘/usr/portage/distfiles/go-linux-ppc64-bootstrap.tbz’

/usr/portage/distfi 100%[=====================>]  43.17M  2.01MB/s   in 22s    

2016-04-26 17:01:56 (1.96 MB/s) - ‘/usr/portage/distfiles/go-linux-ppc64-bootstrap.tbz’ saved [45266082/45266082]

 * go-linux-ppc64-bootstrap.tbz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                                                        [ ok ]
>>> Downloading 'http://distfiles.gentoo.org/distfiles/go1.6.1.src.tar.gz'
--2016-04-26 17:01:59--  http://distfiles.gentoo.org/distfiles/go1.6.1.src.tar.gz
Resolving distfiles.gentoo.org... 216.165.129.135, 137.226.34.46, 64.50.233.100, ...
Connecting to distfiles.gentoo.org|216.165.129.135|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12615799 (12M) [application/x-gzip]
Saving to: ‘/usr/portage/distfiles/go1.6.1.src.tar.gz’

/usr/portage/distfi 100%[=====================>]  12.03M  1.72MB/s   in 7.1s   

2016-04-26 17:02:06 (1.68 MB/s) - ‘/usr/portage/distfiles/go1.6.1.src.tar.gz’ saved [12615799/12615799]

 * go1.6.1.src.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                                                                  [ ok ]
>>> Unpacking source...
>>> Unpacking go-linux-ppc64-bootstrap.tbz to /var/tmp/portage/dev-lang/go-1.6.1/work
>>> Unpacking go1.6.1.src.tar.gz to /var/tmp/portage/dev-lang/go-1.6.1/work
>>> Source unpacked in /var/tmp/portage/dev-lang/go-1.6.1/work
>>> Preparing source in /var/tmp/portage/dev-lang/go-1.6.1/work/go ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-lang/go-1.6.1/work/go ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-lang/go-1.6.1/work/go ...
##### Building Go bootstrap tool.
cmd/dist
./make.bash: line 126: /var/tmp/portage/dev-lang/go-1.6.1/work/go-linux-ppc64-bootstrap/bin/go: cannot execute binary file: Exec format error
 * ERROR: dev-lang/go-1.6.1::gentoo failed (compile phase):
 *   build failed
 * 
 * Call stack:
 *     ebuild.sh, line 133:  Called src_compile
 *   environment, line 979:  Called die
 * The specific snippet of code:
 *       ./make.bash || die "build failed"
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/go-1.6.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/go-1.6.1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-lang/go-1.6.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/go-1.6.1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/go-1.6.1/work/go/src'
 * S: '/var/tmp/portage/dev-lang/go-1.6.1/work/go'

>>> Failed to emerge dev-lang/go-1.6.1, Log file:

>>>  '/var/tmp/portage/dev-lang/go-1.6.1/temp/build.log'

 * Messages for package dev-lang/go-1.6.1:

 * ERROR: dev-lang/go-1.6.1::gentoo failed (compile phase):
 *   build failed
 * 
 * Call stack:
 *     ebuild.sh, line 133:  Called src_compile
 *   environment, line 979:  Called die
 * The specific snippet of code:
 *       ./make.bash || die "build failed"
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/go-1.6.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/go-1.6.1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-lang/go-1.6.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/go-1.6.1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/go-1.6.1/work/go/src'
 * S: '/var/tmp/portage/dev-lang/go-1.6.1/work/go'

localhost ~ # emerge --info '=dev-lang/go-1.6.1::gentoo'
setlocale: unsupported locale setting
setlocale: unsupported locale setting
Portage 2.2.26 (python 2.7.10-final-0, default/linux/powerpc/ppc64/13.0/64bit-userland/little-endian, gcc-5.3.0, glibc-2.22-r4, 4.1.15-gentoo-r1 ppc64le)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.1.15-gentoo-r1-ppc64le-POWER8E_-raw-,_altivec_supported-with-gentoo-2.2
KiB Mem:    10456128 total,     85760 free
KiB Swap:          0 total,         0 free
sh bash 4.3_p42-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42-r1::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.19.1::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            5.3.0::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://github.com/gentoo/gentoo
    priority: -1000

ACCEPT_KEYWORDS="ppc64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="powerpc64le-unknown-linux-gnu"
CFLAGS="-O2 -pipe -mcpu=power8 -mtune=power8 -mabi=elfv2"
CHOST="powerpc64le-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="acl altivec berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm ibm iconv ipv6 modules ncurses nls nptl openmp pam pcre ppc64 readline session ssl tcpd unicode xattr zlib" ABI_PPC="64" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="fbdev mach64 mga nv r128 radeon dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON


Actual Results:  

Failed to compile go

Expected Results:  
emerge go successfully
Comment 1 SpanKY gentoo-dev 2016-04-26 18:01:19 UTC
does go have a LE port ?  if not, then just mask go in the LE sub-profile.
Comment 2 Leno Hou 2016-04-26 18:07:23 UTC
We've successfully used gcc5[go] to compile GO-1.6.1 on ppc64le. So GO-1.6.1 have LE port.
Comment 3 William Hubbs gentoo-dev 2016-04-27 16:12:39 UTC
It does, and I can build a bootstrap binary for you so you don't have to
use gccgo; I will include one with 1.6.2.
Comment 4 William Hubbs gentoo-dev 2016-04-27 16:39:47 UTC
Looking at the profiles, I currently do not see a way to tell the
difference between ppc64 and ppc64le, so I don't know how to support
it. Is the support not in the tree yet?
Comment 5 Leno Hou 2016-04-27 16:54:31 UTC
The difference

ARCH           ppc64                                  ppc64le
CHOST          powerpc64-unknown-linux-gnu            powerpc64le-unkown-linux-gnu
tc-arch        ppc64                                  ppc64le

So maybe you can use CHOST or tc-arch to  distinguish .
Comment 6 William Hubbs gentoo-dev 2016-04-27 18:48:55 UTC
There now is a bootstrap tarball for ppc64le, so the only thing left is
to figure out what I can test against to select it to download in
src_uri.
Comment 7 William Hubbs gentoo-dev 2016-04-27 20:53:55 UTC
 I added go-1.6.2 to the tree along with the download for a ppc64le
 bootstrap tree I created.

 Please try to build go-1.6.2 without gccgo on ppc64le and report back.

 Thanks,

 William
Comment 8 Leno Hou 2016-04-28 05:42:01 UTC
Hi William, 

   Build with failures as same as before and I'll send the workaround patch for you. This workaround patch works fine with me. e.g. successfully build go-1.6.2 without gccgo. Could you help me to review and merge ? Thanks
Comment 9 William Hubbs gentoo-dev 2016-04-28 13:54:17 UTC
Hi,

Sure, I'll take a look at what you send.

What I've found looks like tc-arch might be the culpret. Line 153 in the
ebuild is where GOROOT_BOOTSTRAP is set. The go_arch function selects
the architecture based on tc-arch, but it doesn't appear to recognize
ppc64le?
Comment 10 Leno Hou 2016-04-28 13:57:52 UTC
Yes. select architecture based on tc-arch can't recognise ppc64le platform. So I changed to based on tc-endian.
Comment 11 William Hubbs gentoo-dev 2016-04-28 15:40:56 UTC
Based on your information, I modified go_arch to take tc-endian into
account. Please try to build again without the gccgo use flag and report
back.

Thanks,

William
Comment 12 Leno Hou 2016-04-28 16:25:47 UTC
Thanks in advance. Works fine. 



>>> Installing (1 of 1) dev-lang/go-1.6.2::gentoo
 * fixing timestamps to avoid unnecessary rebuilds ...                                                                                                                                                      [ ok ]

 * Messages for package dev-lang/go-1.6.2:

 * GOROOT_BOOTSTRAP is /var/tmp/portage/dev-lang/go-1.6.2/work/go-linux-ppc64le-bootstrap
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

 * IMPORTANT: 3 config files in '/etc' need updating.
 * See the CONFIGURATION FILES section of the emerge
 * man page to learn how to update config files.

 * IMPORTANT: 13 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.
Comment 13 William Hubbs gentoo-dev 2016-04-28 16:46:00 UTC
Thanks for your help.