Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 894120 - dev-lang/spidermonkey: please consider switching to --enable-optimize
Summary: dev-lang/spidermonkey: please consider switching to --enable-optimize
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-02-12 19:38 UTC by Johannes Penßel
Modified: 2023-10-19 18:03 UTC (History)
1 user (show)

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


Attachments
spidermonkey-102.7.0-build-test.log (build.tar.xz,478.93 KB, application/x-xz)
2023-02-12 20:09 UTC, Johannes Penßel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Penßel 2023-02-12 19:38:21 UTC
Current ebuilds for dev-lang/spidermonkey configure the package with --disable-optimize, which can lead to performance issues with gnome-shell, especially on weaker hardware. The forced use of -fno-tree-vectorize with GCC10+ seems to be obsolete as well. (See bug #758446 Comment #14)

Please consider dropping -fno-tree-vectorize, and swapping --disable-optimize for --enable-optimize. On my machine, a build with these modifications compiles and runs flawlessly. This is also the standard configuration used by Fedora and openSUSE, both of which build with GCC 12:

https://kojipkgs.fedoraproject.org//packages/mozjs102/102.7.0/1.fc37/data/logs/x86_64/build.log

https://build.opensuse.org/public/build/GNOME:Next/openSUSE_Factory/x86_64/mozjs102/_log

Thanks.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-12 19:44:05 UTC
Which version(s) of SM did you test?
Comment 2 Johannes Penßel 2023-02-12 19:48:20 UTC
(In reply to Sam James from comment #1)
> Which version(s) of SM did you test?

I tested version 102.7.0

$ emerge --info spidermonkey

Portage 3.0.44 (python 3.10.10-final-0, default/linux/amd64/17.1/no-multilib/systemd/merged-usr, gcc-12, glibc-2.37, 6.1.11-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.1.11-gentoo-x86_64-12th_Gen_Intel-R-_Core-TM-_i5-1240P-with-glibc2.37
KiB Mem:    16221520 total,   8555636 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Sun, 12 Feb 2023 18:17:01 +0000
Head commit of repository gentoo: 6ecfbe524743a309779826945ac2f34256c08cb9

Timestamp of repository guru: Sun, 12 Feb 2023 15:16:53 +0000
Head commit of repository guru: 160fe7a69cb9b7ea84bd4de58847915006e61445

sh bash 5.2_p15-r2
ld GNU ld (Gentoo 2.40 p2) 2.40.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r2::gentoo
dev-lang/perl:             5.36.0-r2::gentoo
dev-lang/python:           3.10.10::gentoo, 3.11.2::gentoo
dev-lang/rust:             1.67.1::gentoo
dev-util/cmake:            3.25.2::gentoo
dev-util/meson:            1.0.0::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/sandbox:          2.30-r1::gentoo
sys-apps/systemd:          252.5::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.40-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc:             12.2.1_p20230121-r1::gentoo
sys-devel/gcc-config:      2.10::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/llvm:            15.0.7::gentoo
sys-devel/make:            4.4::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37::local
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    volatile: True
    sync-git-verify-commit-signature: yes

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: True

local
    location: /usr/local/portage/overlay
    masters: gentoo
    priority: 10
    volatile: True

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -g -Wall -flto=auto -fno-omit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-O2 -pipe -march=native -g -Wall -flto=auto -fno-omit-frame-pointer"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
F77FLAGS="-O2 -pipe -march=native -g -Wall -flto=auto -fno-omit-frame-pointer"
FCFLAGS="-O2 -pipe -march=native -g -Wall -flto=auto -fno-omit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live cgroup compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native -g -Wall -flto=auto -fno-omit-frame-pointer"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-O2 -pipe -march=native -g -Wall -flto=auto -fno-omit-frame-pointer -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--build-id"
LEX="flex"
MAKEOPTS="-j16"
PKGDIR="/var/cache/binpkgs"
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"
RUSTFLAGS="-C target-cpu=native"
SHELL="/bin/zsh"
USE="X acl activities afp aio alsa amd64 amr apng apparmor appstream archive argon2 audit bcrypt blake2 bluetooth boost brotli bs2b btrfs bzip2 cairo caps cet chromium cjk cli cloudproviders colord connection-sharing crypt cryptsetup cups curl cxx dbus default-compiler-rt default-lld device-mapper djvu dracut dri drm duktape eds egl eglfs evolution-data-server exif fat fdk ffmpeg firewalld flatpak fontconfig fonts fortran freetype fribidi gbm gdbm geolocation gif gles2 glib gmp gnome gnome-keyring gnome-online-accounts gnome-shell gnuefi gsettings gssapi gstreamer gtk gtk4 harfbuzz highlight hpn hsts ibus iconv icu idn idn2 introspection io-uring ios ipv6 jit jpeg jpeg2k jpegxl kbd kerberos ktls ladspa lcms libaom libdrm libevent libglvnd libidn2 libmount libnotify libproxy libssh2 libtirpc libv4l libxml2 lmdb lto lv2 lzma minizip modemmanager mp3 mpc mpfr mtp natspec nautilus ncurses networkmanager nfs nftables nls nptl numa oauth ogg openal openconnect opengl openh264 openmp opus pam pango pcre pcre2 pdf perl pgo pie pipewire pkcs11 png policykit postproc postscript psl pulseaudio qml qsv qt6 readline rubberband samba sasl scanner screencast sdjournal seccomp semantic-desktop speex sqlite ssl sssd stemmer sudo svg sysprof systemd systemtap taglib tdb test-rust theora threads thunderbolt tiff tpm tracker truetype udev udisks unicode unwind upower uuid v4l vaapi vala valgrind verify-sig vfat vorbis vpx vulkan wayland weather webengine webp widgets wifi x264 x265 xattr xft xinerama xml xscreensaver xv xvid xwidgets xxhash zeroconf zlib zram zstd" ABI_X86="64" ADA_TARGET="gnat_2021" 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 pc coreboot" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby31" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

dev-lang/spidermonkey-102.7.0::local was built with the following:
USE="jit lto -clang -debug -test"
CFLAGS="-O2 -pipe -march=native -g -Wall -fno-omit-frame-pointer"
CXXFLAGS="-O2 -pipe -march=native -g -Wall -fno-omit-frame-pointer"
FEATURES="config-protect-if-modified binpkg-multi-instance usersync network-sandbox preserve-libs distlocks userfetch binpkg-dostrip strict news sandbox pid-sandbox assume-digests ipc-sandbox merge-sync binpkg-docompress buildpkg-live unmerge-logs compressdebug multilib-strict unknown-features-warn xattr qa-unresolved-soname-deps parallel-fetch protect-owned ebuild-locks fixlafiles sfperms splitdebug unmerge-orphans usersandbox cgroup userpriv binpkg-logs"
LDFLAGS="-O2 -pipe -march=native -g -Wall -fno-omit-frame-pointer -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--build-id"
Comment 3 Johannes Penßel 2023-02-12 20:09:12 UTC
Created attachment 850560 [details]
spidermonkey-102.7.0-build-test.log

Testsuite runs successfully with the build options outlined above. Here's the full build + test log.
Comment 4 Joonas Niilola gentoo-dev 2023-02-20 12:49:46 UTC
I vaguely remember it was disabled due to performance issues in Gnome.. but sounds like something we can try enabling now. Thanks!
Comment 5 Joonas Niilola gentoo-dev 2023-02-21 10:05:26 UTC
Then again toggling the option will break the library ABI meaning all rdeps depending on :102 need to be rebuilt, and in future they need to depend on a subslot binder. There are two packages currently depending on :102. 
I'm not super keen on adding a subslot binder just to toggle this option for a minor version bump, when you should be able to just depend on :102 in future, because upstream don't break ABI between releases. So the best chance for least-destructive change is to enable this option in 115.1.0 release (happens in July). 

Let me test the rdeps and make a decision after.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-21 10:06:49 UTC
(In reply to Joonas Niilola from comment #5)
> Then again toggling the option will break the library ABI meaning all rdeps
> depending on :102 need to be rebuilt, and in future they need to depend on a
> subslot binder. There are two packages currently depending on :102. 

wait, really? What does it change?
Comment 7 Joonas Niilola gentoo-dev 2023-02-21 11:15:51 UTC
With --disable-optimize:
CMP: dev-lang/spidermonkey-102.7.0/image with dev-lang/spidermonkey-102.8.0/image
------> ABI(nodebug)


With --enable-optimize:
CMP: dev-lang/spidermonkey-102.7.0/image with dev-lang/spidermonkey-102.8.0/image
   ABI: libmozjs-102.so.0(64) func(+97,-652) vars(+82,-82) [BREAKING]
------> ABI(+179,-734,>B<)

I don't know the internals any better than this, I'd say this is enough confirmation for some action.
Comment 8 Joonas Niilola gentoo-dev 2023-02-21 11:16:32 UTC
(In reply to Joonas Niilola from comment #7)
> With --disable-optimize:
> CMP: dev-lang/spidermonkey-102.7.0/image with
> dev-lang/spidermonkey-102.8.0/image
> ------> ABI(nodebug)
> 
> 
> With --enable-optimize:
> CMP: dev-lang/spidermonkey-102.7.0/image with
> dev-lang/spidermonkey-102.8.0/image
>    ABI: libmozjs-102.so.0(64) func(+97,-652) vars(+82,-82) [BREAKING]
> ------> ABI(+179,-734,>B<)
> 
> I don't know the internals any better than this, I'd say this is enough
> confirmation for some action.

And in both cases the -fno-tree-vectorize has been taken out.
Comment 9 Larry the Git Cow gentoo-dev 2023-02-22 06:25:41 UTC
The bug has been closed via the following commit(s):

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

commit f3e81dffcabc5549927a1bed355991c5c441d9d8
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2023-02-22 06:24:38 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-02-22 06:24:38 +0000

    dev-lang/spidermonkey: add 102.8.0
    
    - enable '--enable-optimize'.
    
    Closes: https://bugs.gentoo.org/894120
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 dev-lang/spidermonkey/Manifest                    |   2 +
 dev-lang/spidermonkey/spidermonkey-102.8.0.ebuild | 411 ++++++++++++++++++++++
 2 files changed, 413 insertions(+)