Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Compiler lacks asm-goto support

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
mark4
Apprentice
Apprentice
Posts: 219
Joined: Sat Feb 26, 2011 2:34 pm

Compiler lacks asm-goto support

  • Quote

Post by mark4 » Thu Jan 05, 2023 3:51 pm

trying to do a build on a kernel source tree that is a slightly modified version of gentoo-sources 4.19.263 (added a driver for work). This previously built just fine but now i cant run genkernel on it or run make directly because I get the above error. This is kind of confusing because im using gcc version (Gentoo 11.3.1_p20221209 p3).

These sources built just fine a few weeks ago and no modifications have been made to the kernel source tree, just updates

< info >
Portage 3.0.41 (python 3.10.9-final-0, default/linux/amd64/17.1/systemd, gcc-11, glibc-2.36-r5, 4.19.263-gdls-x86_64 x86_64)
=================================================================
System uname: Linux-4.19.263-gdls-x86_64-x86_64-Intel-R-_Pentium-R-_CPU_D1519_@_1.50GHz-with-glibc2.36
KiB Mem: 16404140 total, 11541056 free
KiB Swap: 1048572 total, 1048572 free
Timestamp of repository gentoo: Tue, 03 Jan 2023 00:45:01 +0000
Head commit of repository gentoo: 11889b62058455ca061e0c0376a1db3716c97750
Timestamp of repository GDLS: Mon, 12 Dec 2022 00:45:01 +0000
sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.38 p4) 2.38
distcc 3.4 x86_64-pc-linux-gnu [enabled]
app-misc/pax-utils: 1.3.5::gentoo
app-shells/bash: 5.1_p16-r2::gentoo
dev-lang/perl: 5.36.0-r1::gentoo
dev-lang/python: 3.10.9::gentoo, 3.11.1::gentoo
dev-lang/rust: 1.65.0::gentoo
dev-util/cmake: 3.24.3::gentoo
dev-util/meson: 0.64.1::gentoo
sys-apps/baselayout: 2.9::gentoo
sys-apps/sandbox: 2.29::gentoo
sys-apps/systemd: 251.8::gentoo
sys-devel/autoconf: 2.71-r5::gentoo
sys-devel/automake: 1.16.5::gentoo
sys-devel/binutils: 2.38-r2::gentoo, 2.39-r4::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang: 15.0.6::gentoo
sys-devel/gcc: 11.3.1_p20221209::gentoo, 12.2.1_p20221231::gentoo
sys-devel/gcc-config: 2.8::gentoo
sys-devel/libtool: 2.4.7::gentoo
sys-devel/llvm: 15.0.6::gentoo
sys-devel/make: 4.3::gentoo
sys-kernel/linux-headers: 5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc: 2.36-r5::gentoo
Repositories:

gentoo
location: /var/db/repos/gentoo
sync-openpgp-key-refresh: no
sync-type: rsync
sync-uri: rsync://192.168.69.106/gentoo-portage
priority: -1000
sync-rsync-extra-opts:
sync-rsync-verify-jobs: 1
sync-rsync-verify-max-age: 24
sync-rsync-verify-metamanifest: no


ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=broadwell"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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 /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=broadwell"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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=broadwell"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live config-protect-if-modified distcc 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 strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=broadwell"
GENTOO_MIRRORS="ftp://192.168.69.106"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j16 -l16"
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"
SHELL="/bin/bash"
USE="X acl amd64 bzip2 cairo cleartype cli consolekit corefonts crypt dbus dri gdbm gif gles2 gtk gtk-doc iconv icu intel-microcode introspection jpeg libglvnd libtirpc multilib ncurses networkmanager nls nptl opengl openmp pam pcre pm-utils png polkit readline seccomp split-usr ssl systemd test-rust tiff truetype type1 udev unicode wifi xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2021" ALSA_CARDS="intel-hda" 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" 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="pc" 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="ruby27" 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, F77FLAGS, 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, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

< /info >
Top
sublogic
Guru
Guru
User avatar
Posts: 388
Joined: Mon Mar 21, 2022 3:02 am
Location: Pennsylvania, USA

  • Quote

Post by sublogic » Fri Jan 06, 2023 12:50 am

The message "Compiler lacks asm-goto support" comes from arch/x86/Makefile.

Code: Select all

checkbin:
ifndef CONFIG_CC_HAS_ASM_GOTO
	@echo Compiler lacks asm-goto support.
	@exit 1
endif
CONFIG_CC_HAS_ASM_GOTO is normally set in init/Kconfig, by testing the compiler with scripts/gcc-goto.sh.

Okay, that doesn't help much, but: it's purely a kernel issue, not portage and possibly not genkernel.

Are you able to build the kernel directly ? For example,

Code: Select all

# cd /usr/src/linux
# zcat /proc/config.gz > .config
# make oldconfig
# make bzImage
(the "make oldconfig" is for safety, probably won't do anything.)

If that doesn't build, you have a problem with the kernel source tree. If if it builds, genkernel is doing something weird. Check /var/log/genkernel.log, particularly the KERNEL_CC in use. If it's not gcc, you can test that compiler yourself with the gcc-goto.sh script.

Not a solution, just trying to point you in the right direction.
Top
mark4
Apprentice
Apprentice
Posts: 219
Joined: Sat Feb 26, 2011 2:34 pm

  • Quote

Post by mark4 » Fri Jan 06, 2023 1:23 pm

sublogic wrote:The message "Compiler lacks asm-goto support" comes from arch/x86/Makefile.

Code: Select all

checkbin:
ifndef CONFIG_CC_HAS_ASM_GOTO
	@echo Compiler lacks asm-goto support.
	@exit 1
endif
CONFIG_CC_HAS_ASM_GOTO is normally set in init/Kconfig, by testing the compiler with scripts/gcc-goto.sh.

Okay, that doesn't help much, but: it's purely a kernel issue, not portage and possibly not genkernel.

Are you able to build the kernel directly ? For example,

Code: Select all

# cd /usr/src/linux
# zcat /proc/config.gz > .config
# make oldconfig
# make bzImage
(the "make oldconfig" is for safety, probably won't do anything.)

If that doesn't build, you have a problem with the kernel source tree. If if it builds, genkernel is doing something weird. Check /var/log/genkernel.log, particularly the KERNEL_CC in use. If it's not gcc, you can test that compiler yourself with the gcc-goto.sh script.

Not a solution, just trying to point you in the right direction.
Had already figured this out and had commented out those three lines to get things to build but thats not really the fix, there is some kind of disconnection way down below that occurred when I updated my system some time and i was wondering if anyone might have had the same issue and maybe resolved it in a more correct manner :)
Top
Hu
Administrator
Administrator
Posts: 24401
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Fri Jan 06, 2023 3:44 pm

If you uncomment those lines and debug why they are producing the incorrect result, that may lead you to what you need to change in the system.
Top
ulenrich
Veteran
Veteran
Posts: 1483
Joined: Sun Oct 10, 2010 9:26 pm

  • Quote

Post by ulenrich » Fri Jan 06, 2023 6:36 pm

Have you tried to compile the kernel with <gcc-11
?
The comment in init/Kconfig: (line with a #)

Code: Select all

config CC_HAS_ASM_GOTO_OUTPUT
        def_bool $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) ::: bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null)

config CC_HAS_ASM_GOTO_TIED_OUTPUT
        depends on CC_HAS_ASM_GOTO_OUTPUT
        # Detect buggy gcc and clang, fixed in gcc-11 clang-14.
        def_bool $(success,echo 'int foo(int *x) { asm goto (".long (%l[bar]) - .": "+m"(*x) ::: bar); return *x; bar: return 0; }' | $CC -x c - -c -o /dev/null)
Top
Hu
Administrator
Administrator
Posts: 24401
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Fri Jan 06, 2023 7:05 pm

I have used gcc-11 to compile the kernel without issue. Switching to an older gcc should not be needed.
Top
ulenrich
Veteran
Veteran
Posts: 1483
Joined: Sun Oct 10, 2010 9:26 pm

  • Quote

Post by ulenrich » Sat Jan 07, 2023 6:16 pm

Hu,
I think the comment in the init/KConfig shows that kernel devs want you to use >=gcc-11
Top
Hu
Administrator
Administrator
Posts: 24401
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Jan 07, 2023 6:53 pm

OP is using gcc-11, so this should work. I interpreted your prior post to be a suggestion that OP should use a gcc older than gcc-11, so I posted to report that gcc-11 works.
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Sat Jan 07, 2023 7:42 pm

From /usr/src/linux/, if you run "scripts/gcc-goto.sh gcc; echo $?" what's the rc
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
Post Reply

9 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic