Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916511 - app-editors/emacs +jit crossdev does not recognize the jit even though gcc has the jit use flag enabled and installed
Summary: app-editors/emacs +jit crossdev does not recognize the jit even though gcc ha...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: GNU Emacs project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-29 22:18 UTC by Lemon Lime
Modified: 2023-10-30 16:44 UTC (History)
1 user (show)

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


Attachments
Build log (buildlog,35.39 KB, text/plain)
2023-10-29 22:18 UTC, Lemon Lime
Details
Config log (configlog,163.41 KB, text/plain)
2023-10-29 23:18 UTC, Lemon Lime
Details
crossdev equery f output (crossdevfile,121.73 KB, text/plain)
2023-10-30 16:44 UTC, Lemon Lime
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lemon Lime 2023-10-29 22:18:32 UTC
Created attachment 873694 [details]
Build log

I have managed to compile crossdev gcc in amd64 to x86 with the jit flag enabled.
However, when I try to crossdev emacs with said jit flag enabled, I get the following error:

checking for gcc_jit_context_acquire in -lgccjit... no
configure: error: ELisp native compiler was requested, but libgccjit was not found.

Emerge info:
Portage 3.0.51 (python 3.11.5-final-0, default/linux/x86/17.0, gcc-13, glibc-2.37-r7, 6.1.57-gentoo-dist-hardened x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.1.57-gentoo-dist-hardened-x86_64-Intel-R-_Core-TM-_i7-7500U_CPU_@_2.70GHz-with-glibc2.37
KiB Mem:    12158796 total,   6325300 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of repository gentoo: Sun, 29 Oct 2023 19:00:01 +0000
Head commit of repository gentoo: fecfb228c6af899d44fc70bdbe5a949fd158f9ea
sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-lang/perl:             5.36.1-r3::gentoo
dev-lang/python:           3.11.5::gentoo
dev-util/cmake:            3.26.5-r1::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/openrc:           0.48::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc:             12.3.1_p20230526::gentoo, 13.2.1_p20231014::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts:

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=bonnell -msahf -mmovbe -mfxsr"
CHOST="i686-asus-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=bonnell -msahf -mmovbe -mfxsr"
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"
FCFLAGS="-O2 -pipe -march=bonnell -msahf -mmovbe -mfxsr"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news nodoc noinfo noman parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=bonnell -msahf -mmovbe -mfxsr"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
PKGDIR="/mnt/backup/i686-asus-linux-gnu"
PORTAGE_BINHOST="ssh://fabri@192.168.0.50/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/usr/i686-asus-linux-gnu/"
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="/usr/i686-asus-linux-gnu/tmp/"
SHELL="/bin/bash"
USE="X acl bzip2 cli crypt dist-kernel dri fortran gdbm iconv ipv6 libtirpc ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl test-rust unicode x86 xattr zlib" ABI_X86="32" 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="mmx mmxext sse sse2 sse3 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" INPUT_DEVICES="libinput synaptics" 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="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="intel i915" 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, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-29 22:24:02 UTC
Does the selected gcc definitely have jit? Please also include config.log.
Comment 2 Lemon Lime 2023-10-29 23:18:37 UTC
Created attachment 873695 [details]
Config log
Comment 3 Lemon Lime 2023-10-29 23:20:14 UTC
My apologies. I have now attached the config log.

Here's the output of the following command.
> equery u cross-i686-asus-linux-gnu/gcc-13.2.1_p20230826

[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for cross-i686-asus-linux-gnu/gcc-13.2.1_p20230826:
 U I
 - - ada                            : Build the ADA language (GNAT)
                                      frontend
 + + cet                            : (Restricted to >=sys-devel/gcc-10)
                                      Enable support for Intel Control
                                      Flow Enforcement Technology (CET).
                                      Only effective on amd64/x86. Only
                                      provides benefits on newer CPUs.
                                      For Intel, the CPU must be at least
                                      as new as Tiger Lake. For AMD, it
                                      must be at least as new as Zen 3.
                                      This is harmless on older CPUs, but
                                      provides no benefit either. When
                                      combined with USE=hardened, GCC
                                      will set -fcf-protection by default
                                      when building software. The effect
                                      is minimal on systems which do not
                                      support it, other than a possible
                                      small increase in codesize for the
                                      NOPs. The generated code is
                                      therefore compatible with i686 at
                                      the earliest.
 - - custom-cflags                  : Build with user-specified CFLAGS
                                      (unsupported)
 + + cxx                            : Build support for C++ (bindings,
                                      extra libraries, code generation,
                                      ...)
 - - d                              : Enable support for the D
                                      programming language
 - - debug                          : Enables GCC's 'checking' facility
                                      via
                                      --enable-checking=yes,extra,rtl.
                                      This adds checks to various
                                      compiler passes for integrity and
                                      input validation. This can help
                                      catch possible miscompilations
                                      early as well as latent bugs which
                                      could become real problems in
                                      future, but at the cost of slower
                                      compile times when using GCC.
                                      Unrelated to backtraces.
 - - default-stack-clash-protection : Build packages with stack clash
                                      protection on by default as a
                                      hardening measure. This enables
                                      -fstack-clash-protection by default
                                      which protects against large memory
                                      allocations allowing stack
                                      smashing. May cause slightly
                                      increased codesize, but modern
                                      compilers have been adapted to
                                      optimize well for this case, as
                                      this mitigation is now quite
                                      common. See https://developers.redh
                                      at.com/blog/2020/05/22/stack-clash-
                                      mitigation-in-gcc-part-3 and https:
                                      //www.qualys.com/2017/06/19/stack-
                                      clash/stack-clash.txt.
 - - default-znow                   : Request full relocation on start
                                      from ld.so by default. This sets
                                      the -z,now (BIND_NOW) flag by
                                      default on all linker invocations.
                                      By resolving all dynamic symbols at
                                      application startup, parts of the
                                      program can be made read-only as a
                                      hardening measure. This is closely
                                      related to RELRO which is also
                                      separately enabled by default. In
                                      some applications with many
                                      unresolved symbols (heavily plugin
                                      based, for example), startup time
                                      may be impacted.
 - - doc                            : Add extra documentation (API,
                                      Javadoc, etc). It is recommended to
                                      enable per package instead of
                                      globally
 - - fixed-point                    : Enable fixed-point arithmetic
                                      support for MIPS targets in gcc
                                      (Warning: significantly increases
                                      compile time!)
 + + fortran                        : Add support for fortran
 - - go                             : Build the GCC Go language frontend.
 - - graphite                       : Add support for the framework for
                                      loop optimizations based on a
                                      polyhedral intermediate
                                      representation
 + + hardened                       : Activate default security
                                      enhancements for toolchain (gcc,
                                      glibc, binutils)
 - - ieee-long-double               : Use accelerated 128-bit IEEE long
                                      double ABI (ppc64le only)
 + + jit                            : Enable libgccjit so other
                                      applications can embed gcc for
                                      Just-In-Time compilation.
 - - libssp                         : Build SSP support into a dedicated
                                      library rather than use the code in
                                      the C library (DO NOT ENABLE THIS
                                      IF YOU DON'T KNOW WHAT IT DOES)
 - - lto                            : Build using Link Time Optimizations
                                      (LTO). Note that GCC is always
                                      built with support for building
                                      other programs with LTO. This USE
                                      flag is for whether GCC itself is
                                      built and optimized with LTO.
 - - modula2                        : Build the GCC Modula-2 language
                                      frontend.
 + + nls                            : Add Native Language Support (using
                                      gettext - GNU locale utilities)
 + + nptl                           : Enable support for Native POSIX
                                      Threads Library, the new threading
                                      module (requires linux-2.6 or
                                      better usually)
 - - objc                           : Build support for the Objective C
                                      code language
 - - objc++                         : Build support for the Objective C++
                                      language
 - - objc-gc                        : Build support for the Objective C
                                      code language Garbage Collector
 + + openmp                         : Build support for the OpenMP
                                      (support parallel computing),
                                      requires >=sys-devel/gcc-4.2 built
                                      with USE="openmp"
 - - pgo                            : Build GCC using Profile Guided
                                      Optimization (PGO). GCC will build
                                      itself and then analyze the
                                      just-built binary and then rebuild
                                      itself using the data obtained from
                                      analysis of codepaths taken. It
                                      does not affect whether GCC itself
                                      supports PGO when building other
                                      software. This substantially
                                      increases the build time needed for
                                      building GCC itself.
 - - sanitize                       : Build support for various sanitizer
                                      functions (ASAN/TSAN/etc...) to
                                      find runtime problems in
                                      applications.
 - - systemtap                      : enable systemtap static probe
                                      points
 - - test                           : Enable dependencies and/or
                                      preparations necessary to run tests
                                      (usually controlled by
                                      FEATURES=test but can be toggled
                                      independently)
 - - valgrind                       : Enable annotations for accuracy.
                                      May slow down runtime slightly.
                                      Safe to use even if not currently
                                      using dev-util/valgrind
 - - vanilla                        : Do not add extra patches which
                                      change default behaviour; DO NOT
                                      USE THIS ON A GLOBAL SCALE as the
                                      severity of the meaning changes
                                      drastically
 - - vtv                            : Build support for virtual table
                                      verification (a C++ hardening
                                      feature). This does not control
                                      whether GCC defaults to using VTV>
                                      Note that actually using VTV breaks
                                      ABI and hence the whole system must
                                      be built with -fvtable-verify.
 - - zstd                           : Enable support for ZSTD compression



jit is marked as +I and +U.

Does that count as confirmation? Should I run a different command to verify?
Comment 4 Lemon Lime 2023-10-29 23:24:10 UTC
(In reply to Lemon Lime from comment #3)

Btw, this is the output of 

> eselect gcc list
 [1] i686-asus-linux-gnu-12
 [2] i686-asus-linux-gnu-13 *

 [3] x86_64-pc-linux-gnu-11 *
 [4] x86_64-pc-linux-gnu-12
 [5] x86_64-pc-linux-gnu-13

I have run . /etc/profile and even rebooted; so, in theory, the v13 compiler is selected.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-30 06:09:31 UTC
configure:20155: checking for gcc_jit_context_acquire in -lgccjit
configure:20184: i686-asus-linux-gnu-gcc -o conftest -O2 -pipe -march=bonnell -msahf -mmovbe -mfxsr    -Wl,-O1 -Wl,--as-needed conftest.c -lgccjit    >&5
/usr/libexec/gcc/i686-asus-linux-gnu/ld: cannot find -lgccjit: No such file or directory
collect2: error: ld returned 1 exit status

Okay, let's start with whether the jit library is even there: equery f cross-i686-asus-linux-gnu/gcc-13.2.1_p20230826 (upload the output as an attachment please)?
Comment 6 Lemon Lime 2023-10-30 16:43:48 UTC
(In reply to Sam James from comment #5)
> configure:20155: checking for gcc_jit_context_acquire in -lgccjit
> configure:20184: i686-asus-linux-gnu-gcc -o conftest -O2 -pipe
> -march=bonnell -msahf -mmovbe -mfxsr    -Wl,-O1 -Wl,--as-needed conftest.c
> -lgccjit    >&5
> /usr/libexec/gcc/i686-asus-linux-gnu/ld: cannot find -lgccjit: No such file
> or directory
> collect2: error: ld returned 1 exit status
> 
> Okay, let's start with whether the jit library is even there: equery f
> cross-i686-asus-linux-gnu/gcc-13.2.1_p20230826 (upload the output as an
> attachment please)?

Done.
You are right. The jit library files are missing even though the use flag is enabled.
Maybe I could try re emerging crossdev gcc v13?
Comment 7 Lemon Lime 2023-10-30 16:44:11 UTC
Created attachment 873722 [details]
crossdev equery f output