Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 631574 - dev-lang/spidermonkey-38.2.1_rc0 fails to emerge on ia64 (OSError: libc.so.6: cannot open shared object file: No such file or directory)
Summary: dev-lang/spidermonkey-38.2.1_rc0 fails to emerge on ia64 (OSError: libc.so.6:...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: IA64 Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL: https://bugs.gentoo.org/557956
Whiteboard:
Keywords:
Depends on:
Blocks: gnome-3.24 619820
  Show dependency tree
 
Reported: 2017-09-20 20:06 UTC by Émeric Maschino
Modified: 2018-07-25 14:24 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,11.01 KB, text/x-log)
2017-09-20 20:06 UTC, Émeric Maschino
Details
environment (environment,153.71 KB, text/plain)
2017-09-20 20:08 UTC, Émeric Maschino
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Émeric Maschino 2017-09-20 20:06:42 UTC
Created attachment 495670 [details]
build.log

Hi,

dev-lang/spidermonkey-38.2.1_rc0 fails to emerge, with the following error:

Traceback (most recent call last):
  File "./config.status", line 411, in <module>
    from mozbuild.config_status import config_status
  File "/var/tmp/portage/dev-lang/spidermonkey-38.2.1_rc0/work/mozjs-38.0.0/python/mozbuild/mozbuild/config_status.py", line 21, in <module>
    from mozbuild.frontend.emitter import TreeMetadataEmitter
  File "/var/tmp/portage/dev-lang/spidermonkey-38.2.1_rc0/work/mozjs-38.0.0/python/mozbuild/mozbuild/frontend/emitter.py", line 25, in <module>
    import mozinfo
  File "/var/tmp/portage/dev-lang/spidermonkey-38.2.1_rc0/work/mozjs-38.0.0/testing/mozbase/mozinfo/mozinfo/__init__.py", line 54, in <module>
    import mozinfo
  File "/var/tmp/portage/dev-lang/spidermonkey-38.2.1_rc0/work/mozjs-38.0.0/testing/mozbase/mozinfo/mozinfo/mozinfo.py", line 99, in <module>
    ctypes.CDLL("libc.so.6", use_errno=True).prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 362, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libc.so.6: cannot open shared object file: No such file or directory

And indeed, there's no /lib/libc.so.6 library on ia64. It's /lib/libc.so.6.1.

A similar error was reported years ago against Firefox (see bug #557956).

     Émeric
Comment 1 Émeric Maschino 2017-09-20 20:08:12 UTC
Created attachment 495672 [details]
environment
Comment 2 Émeric Maschino 2017-09-20 20:09:04 UTC
emerge --info output:

Portage 2.3.8 (python 3.4.5-final-0, default/linux/ia64/13.0/desktop/gnome/systemd, gcc-5.4.0, glibc-2.23-r4, 4.9.34-gentoo ia64)
=================================================================
System uname: Linux-4.9.34-gentoo-ia64-Madison-with-gentoo-2.3
KiB Mem:    24978912 total,  21376576 free
KiB Swap:     524272 total,    524272 free
Timestamp of repository gentoo: Wed, 20 Sep 2017 18:15:01 +0000
Head commit of repository gentoo: b0a3c82b089244e9bfd9e413e4e132d106fe7ab4
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28.1 p1.0) 2.28.1
app-shells/bash:          4.3_p48-r1::gentoo
dev-lang/perl:            5.24.1-r2::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.7.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.28::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.28.1::gentoo
sys-devel/gcc:            4.5.4::gentoo, 5.4.0-r3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.fr.gentoo.org/gentoo-portage
    priority: -1000

my_ebuilds
    location: /var/lib/layman/my_ebuilds
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="ia64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="ia64-unknown-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="ia64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/chromium/policies/managed/chrome-gnome-shell.json /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/opt/chrome/policies/managed/chrome-gnome-shell.json /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 multilib-strict 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="ftp://mirrors.linuxant.fr/distfiles.gentoo.org/"
LANG="fr_FR.utf8"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa berkdb branding bzip2 cairo cdda cdr cli colord cracklib crypt cups cxx dbus dri dts dvdr eds encode evo exif fam firefox flac fortran gdbm gif glamor gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk ia64 iconv introspection ipv6 jpeg lcms ldap libnotify libsecret mad mng modules mp3 mp4 mpeg nautilus ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt3support qt4 readline sdl session spell ssl startup-notification svg systemd tcpd tiff tracker truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" L10N="fr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="fr" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby22" USERLAND="GNU" VIDEO_CARDS="radeon" 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, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Émeric Maschino 2017-09-20 20:10:20 UTC
emerge -pqv output:

[ebuild   R   ] dev-lang/spidermonkey-38.2.1_rc0  USE="jit system-icu -custom-cflags -custom-optimization -debug -minimal -static-libs {-test}"
Comment 4 Émeric Maschino 2017-09-20 20:17:43 UTC
Solution in bug #557956 was not to explicitely request for libc.so.6, but just libc.so (or a.out).

Patching testing/mozbase/mozinfo/mozinfo/mozinfo.py accordingly didn't worked. I'm then getting:

OSError: /usr/lib/libc.so: invalid ELF header

Obviously, patching testing/mozbase/mozinfo/mozinfo/mozinfo.py to explicitely request for libc.so.6.1 as a workaround did the trick:

--- a/testing/mozbase/mozinfo/mozinfo/mozinfo.py
+++ b/testing/mozbase/mozinfo/mozinfo/mozinfo.py
@@ -96,7 +96,7 @@ if info['os'] == 'linux':
     import errno
     PR_SET_SECCOMP = 22
     SECCOMP_MODE_FILTER = 2
-    ctypes.CDLL("libc.so.6", use_errno=True).prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0)
+    ctypes.CDLL("libc.so.6.1", use_errno=True).prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0)
     info['has_sandbox'] = ctypes.get_errno() == errno.EFAULT
 else:
     info['has_sandbox'] = True

But that's not portable. 

Any idea how to fix this properly? It's noteworthy that, while reported on ia64, all the arches and OSes (BSD comes to mind) where libc.so isn't called libc.so.6 will be impacted.
Comment 5 Émeric Maschino 2017-09-20 20:21:32 UTC
Well, dev-lang/spidermonkey-38.2.1_rc0 is needed by gnome-base/gnome-shell-3.24.3, so blocking bug #611270.
Comment 6 Ian Stakenvicius (RETIRED) gentoo-dev 2018-01-08 21:10:39 UTC
Conditional patch on ia64 ?  That seems extremely dirty, but....
Comment 7 Émeric Maschino 2018-01-08 22:27:28 UTC
(In reply to Ian Stakenvicius from comment #6)
> Conditional patch on ia64 ?  That seems extremely dirty, but....

Not only ia64. As I was outlining in comment #4, as well as SpanKY in https://bugs.gentoo.org/557956#c8, all the arches and OSes where libc.so isn't called libc.so.6 will be impacted.
Comment 8 Ian Stakenvicius (RETIRED) gentoo-dev 2018-01-12 14:31:40 UTC
(In reply to Émeric Maschino from comment #7)
> (In reply to Ian Stakenvicius from comment #6)
> > Conditional patch on ia64 ?  That seems extremely dirty, but....
> 
> Not only ia64. As I was outlining in comment #4, as well as SpanKY in
> https://bugs.gentoo.org/557956#c8, all the arches and OSes where libc.so
> isn't called libc.so.6 will be impacted.

OK well I'm not sure what it is we're supposed to do as an alternative -- I just ran this on guppy.ia64 and it looks like it works exactly as we'd expect:

$ python2
Python 2.7.14 (default, Jan 12 2018, 00:25:30) 
[GCC 5.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> import ctypes.util
>>> print ctypes.util.find_library('c')
libc.so.6.1


This is effectively what the patch did. But if this isn't working, what are our options??
Comment 9 Larry the Git Cow gentoo-dev 2018-01-13 01:48:03 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52b51f73609113386a4fceb5310262e1e96932d0

commit 52b51f73609113386a4fceb5310262e1e96932d0
Author:     Ian Stakenvicius <axs@gentoo.org>
AuthorDate: 2018-01-13 01:47:27 +0000
Commit:     Ian Stakenvicius <axs@gentoo.org>
CommitDate: 2018-01-13 01:47:56 +0000

    dev-lang/spidermonkey:38 - don't hardcode libc soname
    
    This patch attempts to fix issues linking to libc on platforms
    whos libc is not libc.so.6 (ie, ia64 and others).
    
    Bug: http://bugs.gentoo.org/631574
    Package-Manager: Portage-2.3.13, Repoman-2.3.3

 .../files/moz38-dont-hardcode-libc-soname.patch           | 15 +++++++++++++++
 dev-lang/spidermonkey/spidermonkey-38.2.1_rc0.ebuild      |  3 ++-
 2 files changed, 17 insertions(+), 1 deletion(-)}
Comment 10 Ian Stakenvicius (RETIRED) gentoo-dev 2018-01-13 03:34:27 UTC
(In reply to Larry the Git Cow from comment #9)
> commit 52b51f73609113386a4fceb5310262e1e96932d0
> Author:     Ian Stakenvicius <axs@gentoo.org>
> CommitDate: 2018-01-13 01:47:56 +0000
> 
>     dev-lang/spidermonkey:38 - don't hardcode libc soname
>     
>     This patch attempts to fix issues linking to libc on platforms
>     whos libc is not libc.so.6 (ie, ia64 and others).


Émeric can you test this please?  It seems to be fine based on the build and test I did on guppy.ia64.   The test suite does fail but IIRC it always failed so I don't know how much that actually matters.
Comment 11 Émeric Maschino 2018-01-14 10:58:53 UTC
(In reply to Ian Stakenvicius from comment #10)
> (In reply to Larry the Git Cow from comment #9)
> > commit 52b51f73609113386a4fceb5310262e1e96932d0
> > Author:     Ian Stakenvicius <axs@gentoo.org>
> > CommitDate: 2018-01-13 01:47:56 +0000
> > 
> >     dev-lang/spidermonkey:38 - don't hardcode libc soname
> >     
> >     This patch attempts to fix issues linking to libc on platforms
> >     whos libc is not libc.so.6 (ie, ia64 and others).
> 
> 
> Émeric can you test this please?  It seems to be fine based on the build and
> test I did on guppy.ia64.   The test suite does fail but IIRC it always
> failed so I don't know how much that actually matters.

Thanks Ian, it works flawlessly.

Can you also apply this patch to spidermonkey:45, please? It's failing the same than unpatched spidermonkey:38.

     Émeric
Comment 12 Larry the Git Cow gentoo-dev 2018-07-25 14:21:24 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52881c05b0e493b710f847d16780357ce768135b

commit 52881c05b0e493b710f847d16780357ce768135b
Author:     Ian Stakenvicius <axs@gentoo.org>
AuthorDate: 2018-07-25 14:20:41 +0000
Commit:     Ian Stakenvicius <axs@gentoo.org>
CommitDate: 2018-07-25 14:21:14 +0000

    dev-lang/spidermonkey: don't hardcode libc soname on :45 and :52
    
    Applying patch from bug 631574 to both versions as upstream did not
    address this issue until :60
    
    Bug: http://bugs.gentoo.org/631574
    Package-Manager: Portage-2.3.40, Repoman-2.3.9

 dev-lang/spidermonkey/spidermonkey-45.0.2.ebuild      | 7 ++++---
 dev-lang/spidermonkey/spidermonkey-52.9.1_pre1.ebuild | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)
Comment 13 Ian Stakenvicius (RETIRED) gentoo-dev 2018-07-25 14:24:50 UTC
Build tested this on guppy.ia64 to confirm it still works, marking fixed.