Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 292606

Summary: binutils not in PATH, /etc/init.d/functions.sh from baselayout/openrc missing, gcc cant compile, ...
Product: Gentoo Linux Reporter: Michał Deszcz <descyk>
Component: [OLD] GCC PortingAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: VERIFIED CANTFIX    
Severity: normal CC: wmm
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
/var/tmp/portage/sys-devel/gcc-4.4.2/work/build/config.log

Description Michał Deszcz 2009-11-09 23:20:23 UTC
Before the crash, I was changed "CXXFLAGS" deleting "-fomit-frame-pointer" flag. After it is necessary to recompile gcc, binutils and glibc, so I tried.

Reproducible: Always

Actual Results:  
http://docs.google.com/Doc?docid=0ARZ-CIVhd3vXZGQ1ZmpmdHBfMjEwZmpnM3E1aG0&hl=pl
/var/tmp/portage/sys-devel/gcc-4.4.2/temp/build.log


checking for C compiler default output file name... configure: error: in `/var/tmp/portage/sys-devel/gcc-4.4.2/work/build':
configure: error: C compiler cannot create executables
See `config.log' for more details.
 * ERROR: sys-devel/gcc-4.4.2 failed:
 *   failed to run configure
 * 
 * Call stack:
 *     ebuild.sh, line   55:  Called src_compile
 *   environment, line 4977:  Called toolchain_src_compile
 *   environment, line 5503:  Called gcc_src_compile
 *   environment, line 3165:  Called gcc_do_configure
 *   environment, line 2878:  Called die
 * The specific snippet of code:
 *       "${S}"/configure "$@" || die "failed to run configure";
 * 
 * If you need support, post the output of 'emerge --info =sys-devel/gcc-4.4.2',
 * the complete build log and the output of 'emerge -pqv =sys-devel/gcc-4.4.2'.
 * The complete build log is located at '/var/tmp/portage/sys-devel/gcc-4.4.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-4.4.2/temp/environment'.
 * S: '/var/tmp/portage/sys-devel/gcc-4.4.2/work/gcc-4.4.2'

>>> Failed to emerge sys-devel/gcc-4.4.2, Log file:

>>>  '/var/tmp/portage/sys-devel/gcc-4.4.2/temp/build.log'




Expected Results:  
Correct compilation ;)

Portage 2.1.7.4 (default/linux/x86/10.0, gcc-4.3.3, glibc-2.10.1-r0, 2.6.26-1-686 i686)
=================================================================
System uname: Linux-2.6.26-1-686-i686-Intel-R-_Core-TM-2_Duo_CPU_E6550_@_2.33GHz-with-gentoo-2.0.1
Timestamp of tree: Mon, 09 Nov 2009 20:15:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p33
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.5.4-r2, 2.6.3, 3.1.1-r1
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.4-r2
sys-apps/baselayout: 2.0.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=nocona -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests ccache collision-protect distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ftp.vectranet.pl/gentoo/ ftp://ftp.vectranet.pl/gentoo/ http://gentoo.prz.rzeszow.pl http://gentoo.zie.pg.gda.pl http://gentoo.po.opole.pl ftp://gentoo.po.opole.pl ftp://mirror.icis.pcz.pl/gentoo/ http://gentoo.mirror.pw.edu.pl/ "
LANG="pl_PL.UTF-8"
LC_ALL="pl_PL"
LDFLAGS="-Wl,-O1"
LINGUAS="pl en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X aac acl acpi aiglx alsa arts artworkextra aspel automount bash-completion bashcomp beagle bzip2 cdr cdrom cdsound consolekit cracklib crypt cups dbus directfb dri dvd dvdr encode exif ffmpeg firefox flac fortran gdbm gimp glitz gnome gnutls gpm gstreamer gtk gtk2 hal iconv imagemagick in32codecs ipv6 java jpeg libnotify md5sum mmx modules mono mp3 mp4 mpeg mudflap mysql ncurses nls nptl nptlonly nsplugin ogg onls opengl pam pcre pdf perl png profile python qt3support readline reflection reiserfs samba session slang sndfile sound spl sql ssl svg sysfs tcpd threads thunar tiff truetype type1-fonts unicode unzip usb userlocales vim-syntax vim-with-x vorbis wavepack wavpack webkit x86 xcomposite xine xinerama xorg xvid zlib" ALSA_CARDS="ca0106" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl en" USERLAND="GNU" VIDEO_CARDS="nvidia vesa nv" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Michał Deszcz 2009-11-09 23:21:14 UTC
Created attachment 209780 [details]
build.log
Comment 2 Ryan Hill (RETIRED) gentoo-dev 2009-11-09 23:29:04 UTC
checking for C compiler default output file name... configure: error: in
`/var/tmp/portage/sys-devel/gcc-4.4.2/work/build':
configure: error: C compiler cannot create executables
See `config.log' for more details.

This is a generic error message.  Can you attach the config.log you find in that directory?
Comment 3 Michał Deszcz 2009-11-10 07:14:36 UTC
Created attachment 209807 [details]
/var/tmp/portage/sys-devel/gcc-4.4.2/work/build/config.log

Yes, here You are.
Comment 4 Rafał Mużyło 2009-11-10 11:35:52 UTC
Bit atypical:
i686-pc-linux-gnu-gcc: error trying to exec 'as': execvp: No such file or directory

Is everything alright with your PATH/binutils ?
Comment 5 SpanKY gentoo-dev 2009-11-11 04:21:35 UTC
verify your binutils is installed, selected (binutils-config), and your profile env is pointing to the right things
Comment 6 Michał Deszcz 2009-11-11 19:17:27 UTC
(In reply to comment #5)
> verify your binutils is installed, selected (binutils-config), and your profile
> env is pointing to the right things
> 

No such file or directory!

[code]
g2_poligon / # binutils-config 
/usr/bin/binutils-config: line 19: /etc/init.d/functions.sh: Nie ma takiego pliku ani katalogu
binutils-config: Could not source /etc/init.d/functions.sh!
[/code]
Comment 7 SpanKY gentoo-dev 2009-11-11 19:33:26 UTC
that file is provided by baselayout/openrc.  if that's missing, your system is severely screwed.  check those important core packages are actually installed.
Comment 8 Lukas Hrazky 2009-11-13 16:53:01 UTC
I had exactly the same issue. IMO it started by upgrading baselayout to 2.0.1, which removed (AFAIK) /sbin/functions.sh and probably much more. I didn't have openrc installed before and I couldn't emerge it anymore due to all these missing files.

This happened just during normal update process (which I haven't done for some time).

I was able to fix it like this:
1. the /usr/bin/as link leads (for me) to /usr/x86_64-pc-linux-gnu/binutils-bin/2.18/as. But I found only 2.20 (binutils version) directory in /usr/x86_64-pc-linux-gnu/binutils-bin/. So cd /usr/x86_64-pc-linux-gnu/binutils-bin/ && ln -s 2.20 2.18 fixes the compilation issue and you can emerge again.

2. emerge openrc. That will fix the funcitons.sh issue and now you can use binutils-config to set the new binutils to properly point to the new version.

Thanks to guys on #gentoo for help.

cheers
lukash
Comment 9 Michał Deszcz 2009-11-15 22:07:28 UTC
(In reply to comment #8)
> I had exactly the same issue. IMO it started by upgrading baselayout to 2.0.1,
> which removed (AFAIK) /sbin/functions.sh and probably much more. I didn't have
> openrc installed before and I couldn't emerge it anymore due to all these
> missing files.
> 
> This happened just during normal update process (which I haven't done for some
> time).
> 
> I was able to fix it like this:
> 1. the /usr/bin/as link leads (for me) to
> /usr/x86_64-pc-linux-gnu/binutils-bin/2.18/as. But I found only 2.20 (binutils
> version) directory in /usr/x86_64-pc-linux-gnu/binutils-bin/. So cd
> /usr/x86_64-pc-linux-gnu/binutils-bin/ && ln -s 2.20 2.18 fixes the compilation
> issue and you can emerge again.
> 
> 2. emerge openrc. That will fix the funcitons.sh issue and now you can use
> binutils-config to set the new binutils to properly point to the new version.
> 
> Thanks to guys on #gentoo for help.
> 
> cheers
> lukash
> 

It's not the same :(
My instaled binutils is 2.18 and the /usr/bin/as leads to /usr/bin/i686-pc-linux-gnu-as. I changed it to /usr/i686-pc-linux-gnu/binutils-bin/2.18/as, but the difference was no.
Ma baselayout is 2.0.1, but I have not instaled sysvinit (becouse I had to unmerge it before I'll install openrc), and openrc I cannot compile :/
So, I must to fix the compilation problem to do something else.
But how?
Comment 10 Wormo (RETIRED) gentoo-dev 2009-11-29 00:57:48 UTC
Michal, did you manage to recover your system yet? 

If not, please give more details on what happened before it broke -- for instance, how did baselayout-2.0.1 get installed without openrc being installed yet? Maybe you should revert to baselayout-1.12.13 to get things building again, since it does not depend on openrc.
Comment 11 Michał Deszcz 2009-11-29 14:43:15 UTC
I was downgrade from "~x86" to stable version, but someones packages were not wanted to compile, I used --skip-first option. I don't remenber this packages, but now, I think, it was a reason.
Comment 12 Wormo (RETIRED) gentoo-dev 2009-11-30 01:16:19 UTC
Ok, I can see how you might run into problems, since upgrades are the direction that developers focus on, especially for large changes like switching to openrc.

How about the suggestion to downgrade baselayout next, does that work for you?
Comment 13 Michał Deszcz 2009-12-04 18:23:59 UTC
I can't downgrade, becouse I can't compile anything, so it don't work.
Comment 14 garfungiloops 2010-01-04 14:31:30 UTC
Yes, I had also a problem when downgrading from ~x86_64 to the stable branch.
I've solved it by manually correcting all the symlinks in:
/usr/x86_64-pc-linux-gnu/bin (which pointed on the non-existing binutils)
and copying "functions.sh" from the live-CD
Comment 15 garfungiloops 2010-01-04 14:43:27 UTC
So, to the maintainers of binutils package!
Is it possible to check the correctness of the symlinks somehow automatically when installing a new version???
May be we should change the bug-title?
Comment 16 garfungiloops 2010-01-04 16:33:42 UTC
It seems to when downgrading one have to unmask: glibc and binutils anyway, because downgrading of glibc is not supported and it depends on binutils.
Comment 17 Patrick Lauer gentoo-dev 2010-01-10 01:29:14 UTC
Downgrading from ~arch to arch isn't really supported, so if things go wrong there's not much we can do. The best way to downgrade is to remove ACCEPT_KEYWORDS from make.conf, keyword all packages in /etc/portage/package.keywords with the exact installed version and then slowly let updates catch up as things are marked stable.
Comment 18 Michał Deszcz 2010-01-12 20:55:29 UTC
This system I removed and the problem too. Thenk You for help Mrs.
;)

Comment 19 Werner M. Mayer 2010-02-23 05:59:36 UTC
Even though this may be obsolete, I would like to document that I also had this error in comment #4 after upgrading an outdated x86 system from livecd in a chrooted environment.  I further had "kern-clo-test"-errors, emerge errors with failing wget in the  emerge process and links not working due to unmerged blockers, all kind of queer errors I never had before.  It was severe, as I was unable to compile anything, not even my kernel, and I was unable to emerge glibc, neither as source nor as binary. At times, even emerge failed due to gcc errors.  After having searched many bug and other weblinks without luck, poking around via trial and error, comment #4 and #5 was my life saver.   Even though I use gentoo for a long time now, I have a long history of outdated  slow systems due to unsolvable emerge errors cascading to very outdated systems.  I did a "binutils-config -l", with a "i686-pc-linux-gnu-2.18" as output,  followed by "binutils-config -c" with output of " [1] i686-pc-linux-gnu-2.19.1", and then successfully tried "binutils-config 1", which solved my problems:  * Switching to i686-pc-linux-gnu-2.19.1 ... [ ok ] >>> Regenerating /etc/ld.so.cache... Just run "source /etc/profile" afterwards.  Since these simple commands I can compile again and my "emerge -vun system" in a chrooted environment with the flag "--getbinpkg" is working perfectly.  After a successful update of my system I will return back to compile without "--getbinpkg", because I hope to run with a fast distcc server. Compiling the kernel with distcc also works again.  Furthermore I also had the errors posted in comment #6.  In my chrooted environment I had missing shell scripts in /etc/init.d/ , not only the functions.sh, other also, even execvp-errors, "as" missing.  I have done the following: I have saved my data in most config dirs like /etc and world config file. I have important data lying around elsewhere and was  unable to remove it from  the system without very much effort so I didn't just format the partition and start all over. Therefore, I then imported a new portage-latest and  stage3-latest.  Before installing stage3-latest, I installed it to another subdir of my choice, I renamed new config files that would overwrite mine to *.orig and repacked the stage3 file to a new name and then imported that.  At /etc I edited and merged .orig and my own config files together.  At some time in the update process some libs and other data were deleted or had  to be removed due to blocking issues. Wherever possible I copied missing libs and files from the current livecd to my new system, when they were missing due to file conflicts and unmerge processes.  Eventually my system is now somewhat stable and up-to-date. My PIII@500MHz is somewhat clean now (I hope), so I guess I'll do it again on my PI@133MHz.  I've decided to post this here, so in case other users in my rare situation can  see how I fixed this issue.