Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Recovering from x86_64-pc-linux-gnu removal
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
haruka
n00b
n00b


Joined: 15 Jul 2021
Posts: 10

PostPosted: Thu Jul 15, 2021 8:38 pm    Post subject: [SOLVED] Recovering from x86_64-pc-linux-gnu removal Reply with quote

So... I was trying to remove my mingw cross-compilers that are used for wine, but not knowing that crossdev wasn't its own thing, I accidentally ended up removing gcc:
Code:
# crossdev -C i686
 * Uninstalling target 'i686-pc-linux-gnu' ...
# crossdev -C x86_64
 * Uninstalling target 'x86_64-pc-linux-gnu' ...


Thankfully I keep binpkgs of everything I install. I used the instructions from https://forums.gentoo.org/viewtopic-t-1009338-start-0.html to get x86_64-pc-linux-gnu back:
Code:
# cd /data/star/portage/cache/binpkgs/sys-devel
# tar -xjpf gcc-10.3.0.tbz2  -C /


And now I can actually run programs again! But I still don't have i686 and I feel like that might be important...
The thread also suggests "it's recommended to build gcc again just to make sure the package metadata on your system is correct" but I can't because "C compiler cannot create executables". I get a different message for different packages. Here are the results for gcc.

/var/tmp/portage/sys-devel/gcc-10.3.0/temp/build.log: https://pastebin.com/kB8zKSGU
/var/tmp/portage/sys-devel/gcc-10.3.0/work/build/config.log: https://pastebin.com/N2jkH1uK

emerge -pqv '=sys-devel/gcc-10.3.0::gentoo'
Code:
# emerge -pqv '=sys-devel/gcc-10.3.0::gentoo'
[ebuild   R   ] sys-devel/gcc-10.3.0  USE="(cxx) fortran graphite lto (multilib) nls nptl openmp pch (pie) sanitize ssp (-ada) -d -debug -doc (-fixed-point) -go (-hardened) -jit (-libssp) -objc -objc++ -objc-gc -pgo -systemtap -test -vanilla -vtv -zstd"


emerge --info '=sys-devel/gcc-10.3.0::gentoo'
Code:
# emerge --info '=sys-devel/gcc-10.3.0::gentoo'
Portage 3.0.20 (python 3.9.5-final-0, default/linux/amd64/17.1/desktop, gcc-10.3.0, glibc-2.33-r1, 5.10.49-gentoo-r1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.10.49-gentoo-r1-x86_64-AMD_Ryzen_9_3900XT_12-Core_Processor-with-glibc2.33
KiB Mem:    32816296 total,  14824424 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Thu, 15 Jul 2021 17:30:01 +0000
Head commit of repository gentoo: 8e5e1f3ef263363ec0426ce7a8a3dec6f5f5bb5d
Timestamp of repository guru: Wed, 14 Jul 2021 19:51:39 +0000
Head commit of repository guru: 6c884c369154c1465c8a93661cce06f10eca90f8

Timestamp of repository pf4public: Thu, 15 Jul 2021 17:51:36 +0000
Head commit of repository pf4public: 360b22c743ae843bf584c4328e1a921a89f03c98

Timestamp of repository steam-overlay: Sat, 10 Jul 2021 21:52:35 +0000
Head commit of repository steam-overlay: 1a4b8d61985fd4e90abb96d2596cb88ad215b427

sh bash 5.1_p8
ccache version 4.3 [disabled]
app-shells/bash:          5.1_p8::gentoo
dev-lang/perl:            5.32.1::gentoo
dev-lang/python:          2.7.18_p10::gentoo, 3.9.5_p2::gentoo
dev-lang/rust:            1.52.1::gentoo
dev-util/ccache:          4.3::gentoo
dev-util/cmake:           3.18.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.3.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r1::gentoo
Repositories:

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

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

local
    location: /var/db/repos/local
    masters: gentoo
    priority: 0

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

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo

crossdev
    location: /data/stargate/crossdev
    masters: gentoo
    priority: 10

Installed sets: @fonts, @openbox, @portage-extras, @tz-base, @tz-desktop, @tz-desktop-extras
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
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=native"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--tree"
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"
FCFLAGS="-O2 -pipe -march=native"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg 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 strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native"
GENTOO_MIRRORS="https://distfiles.gentoo.org rsync://rsync.gtlib.gatech.edu/gentoo https://gentoo.osuosl.org/ https://mirrors.rit.edu/gentoo/ "
LANG="en_US.iso88591"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_US"
MAKEOPTS="-j24"
PKGDIR="/data/star/portage/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--progress --quiet"
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 amd64 branding bzip2 cairo cdda cdr cleartype cli corefonts crypt cups dbus dri dts dvd dvdr elogind emboss encode exif flac fortran gdbm gif gpm gui iconv icu ipv6 jpeg lcms libglvnd libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt5 readline sdl seccomp spell split-usr ssl startup-notification svg tcpd tiff truetype type1 udev udisks unicode upower usb vorbis vulkan wayland wxwidgets x264 xattr xcb xinerama xml xv xvid zeroconf zlib" ABI_X86="64" ADA_TARGET="gnat_2018" 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="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_1 sse4_2 sse4a 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" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="luajit" LUA_TARGETS="luajit" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" QEMU_SOFTMMU_TARGETS="aarch64 riscv64 x86_64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby26" SANE_BACKENDS="canon hp net" USERLAND="GNU" VIDEO_CARDS="nvidia nouveau" 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:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, RUSTFLAGS

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

sys-devel/gcc-10.3.0::gentoo was built with the following:
USE="(cxx) fortran graphite lto (multilib) nls nptl openmp pch (pie) sanitize ssp (-ada) -d -debug -doc (-fixed-point) -go (-hardened) -jit (-libssp) -objc -objc++ -objc-gc -pgo -systemtap -test -vanilla -vtv -zstd" ABI_X86="(64)"
CFLAGS="-pipe -march=native -O2"
CXXFLAGS="-pipe -march=native -O2"
FEATURES="binpkg-dostrip buildpkg protect-owned userfetch multilib-strict network-sandbox distlocks binpkg-docompress pid-sandbox usersync parallel-fetch preserve-libs unmerge-orphans userpriv usersandbox merge-sync unknown-features-warn config-protect-if-modified sandbox assume-digests qa-unresolved-soname-deps ebuild-locks xattr unmerge-logs news binpkg-logs sfperms ipc-sandbox fixlafiles strict"


Last edited by haruka on Fri Jul 16, 2021 2:52 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Thu Jul 15, 2021 9:11 pm    Post subject: Reply with quote

haruka,

Exactly what command did you use to install gcc from the tarball?

An you have a multilib install, your x86_64-pc-linux-gnu gcc can build both 64 bit and 32 bit code. Thats the -m64 and -m32 options.
You cannot install the 32 bit i686-pc-linux-gnu tools on that system as it would install some of the same files as your multilib gcc, and none of the 64 bit files.

Code:
configure:4488: gcc    conftest.c  >&5
gcc: fatal error: cannot execute 'as': execvp: No such file or directory
compilation terminated.


as is the ASsembler.
Selecting your active gcc with gcc-config rewrites the symlinks. That's worth trying.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
haruka
n00b
n00b


Joined: 15 Jul 2021
Posts: 10

PostPosted: Thu Jul 15, 2021 10:20 pm    Post subject: Reply with quote

NeddySeagoon wrote:
haruka,

Exactly what command did you use to install gcc from the tarball?

I used
Code:
emerge -1 --usepkg =gcc-10.3.0
and got:
Code:
>>> Running pre-merge checks for sys-devel/gcc-10.3.0
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted

And so I used,
Code:
tar -xjpf gcc-10.3.0.tbz2  -C /
from my binpkg directory. I presume I missed some post-install configuration that emerge would normally take care of and that's where my current issues stem from?

Quote:
An you have a multilib install, your x86_64-pc-linux-gnu gcc can build both 64 bit and 32 bit code. Thats the -m64 and -m32 options.
You cannot install the 32 bit i686-pc-linux-gnu tools on that system as it would install some of the same files as your multilib gcc, and none of the 64 bit files.

I think I understand. Maybe I never even had an i686-pc-linux-gnu folder.

Quote:
Code:
configure:4488: gcc    conftest.c  >&5
gcc: fatal error: cannot execute 'as': execvp: No such file or directory
compilation terminated.


as is the ASsembler.
Selecting your active gcc with gcc-config rewrites the symlinks. That's worth trying.

I already selected it earlier, but I tried it again anyways.
Code:
# gcc-config -f 1
 * Switching native-compiler to x86_64-pc-linux-gnu-10.3.0 ...
>>> Regenerating /etc/ld.so.cache...     


But, I think I'm seeing what you want now. I looked back an old install (from a month ago, also gcc 10.3.0) and I see:
Code:
# diff -q /old/usr/x86_64-pc-linux-gnu/ /usr/x86_64-pc-linux-gnu/
Only in /old/usr/x86_64-pc-linux-gnu/: bin
Common subdirectories: /old/usr/x86_64-pc-linux-gnu/binutils-bin and /usr/x86_64-pc-linux-gnu/binutils-bin
Common subdirectories: /old/usr/x86_64-pc-linux-gnu/gcc-bin and /usr/x86_64-pc-linux-gnu/gcc-bin
Only in /old/usr/x86_64-pc-linux-gnu/: i686-w64-mingw32
Common subdirectories: /old/usr/x86_64-pc-linux-gnu/lib and /usr/x86_64-pc-linux-gnu/lib
Only in /old/usr/x86_64-pc-linux-gnu/: x86_64-w64-mingw32


Are these the symlinks in question? This bin folder doesn't exist in my current messed-up state and wasn't created/repopulated by gcc-config.
Code:
# ls -la /old/usr/x86_64-pc-linux-gnu/bin
total 72
drwxr-xr-x 1 root root 190 May  2 11:55 .
drwxr-xr-x 1 root root 118 Oct 14  2020 ..
lrwxrwxrwx 1 root root  54 May  2 11:55 addr2line -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/addr2line
lrwxrwxrwx 1 root root  47 May  2 11:55 ar -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/ar
lrwxrwxrwx 1 root root  47 May  2 11:55 as -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/as
lrwxrwxrwx 1 root root  52 May  2 11:55 c++filt -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/c++filt
lrwxrwxrwx 1 root root  48 May  2 11:55 dwp -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/dwp
lrwxrwxrwx 1 root root  52 May  2 11:55 elfedit -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/elfedit
lrwxrwxrwx 1 root root  50 May  2 11:55 gprof -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/gprof
lrwxrwxrwx 1 root root  47 May  2 11:55 ld -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/ld
lrwxrwxrwx 1 root root  51 May  2 11:55 ld.bfd -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/ld.bfd
lrwxrwxrwx 1 root root  52 May  2 11:55 ld.gold -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/ld.gold
lrwxrwxrwx 1 root root  47 May  2 11:55 nm -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/nm
lrwxrwxrwx 1 root root  52 May  2 11:55 objcopy -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/objcopy
lrwxrwxrwx 1 root root  52 May  2 11:55 objdump -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/objdump
lrwxrwxrwx 1 root root  51 May  2 11:55 ranlib -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/ranlib
lrwxrwxrwx 1 root root  52 May  2 11:55 readelf -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/readelf
lrwxrwxrwx 1 root root  49 May  2 11:55 size -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/size
lrwxrwxrwx 1 root root  52 May  2 11:55 strings -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/strings
lrwxrwxrwx 1 root root  50 May  2 11:55 strip -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/strip


Any advisable path? Any harm in copying in the missing links since they're from the same hardware and gcc version?
Back to top
View user's profile Send private message
haruka
n00b
n00b


Joined: 15 Jul 2021
Posts: 10

PostPosted: Fri Jul 16, 2021 2:52 am    Post subject: Reply with quote

I spoke too soon.

I should have used -r with diff and I would see that binutils was actually missing its binaries - therefore, I emerged binutils using --binpkg, and then I could re-emerge gcc using --binpkg, and it created all the links in question.

I then finished a from-source gcc reinstall. And then I had to do pkgconf, and afterwards an emerge @world went off successfully.

I guess everything is fine again so I'll mark as solved, but please speak up if you can think of anything I might have missed that will cause me trouble down the line.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum