fivemack: (Default)
Tom Womack ([personal profile] fivemack) wrote2007-06-04 05:32 pm

Two Linux frustrations

We've just got a new machine at work on which I've been asked to install OpenSuSE 10.2 64-bit; this felt entirely straightforward.

Unfortunately, the default install of OpenSuSE doesn't include gcc. When I try installing gcc using YaST2, I get something which looks superficially like gcc, but which says 'gcc: error trying to exec 'cc1': execvp: No such file or directory' whenever I try to compile anything with it.

So, where's cc1 coming from? Deciding now would be a good time to use up some of the EU Assorted Symbol Mountain, I type

for i in /media/SU1020.001/suse/x86_64/*.rpm; do rpm -qpl $i | sed -e "s/^/${i//\//_}/g" | grep cc1; done

which tells me that /usr/lib64/gcc/x86_64-suse-linux/4.1.2/cc1 is provided by cpp41-4.1.2_20061115-5.x86_64.rpm

And indeed /usr/lib64/gcc/x86_64-suse-linux/4.1.2/cc1 exists on the machine. So, why isn't /usr/bin/gcc-4.1 finding it?

Normally strace comes to the rescue, but 'strace /usr/bin/gcc-4.1 -c foo.c' outputs many lines of the form

stat64(0x806b628, 0xff885abc) = -1 ENOENT (No such file or directory)

which are totally useless because strace is failing to dereference the pointer to the filename passed to stat64.

[identity profile] jojomojo.livejournal.com 2007-06-04 06:00 pm (UTC)(link)
Does simply running cc1 directly from the command line do anything useful? I'm wondering if it's, I don't know, making a reference to a version of ld-linux.so that's not installed on the machine, or something.

[identity profile] fivemack.livejournal.com 2007-06-05 11:21 am (UTC)(link)
Yes, /usr/lib64/gcc/x86_64-suse-linux/4.1.2/cc1 runs, though it doesn't have paths set up correctly so can't find things like stddef.h

I'm a little surprised that I've ended up in a situation with

/usr/bin/gcc-4.1: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), for GNU/Linux 2.6.4, stripped

/usr/lib64/gcc/x86_64-suse-linux/4.1.2/cc1: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), for GNU/Linux 2.6.4, stripped

I've not done much to the machine; whilst this is an obvious admission of defeat, I'll reinstall the OS and see if that helps.

[identity profile] jojomojo.livejournal.com 2007-06-05 01:38 pm (UTC)(link)
Hmm, well, it does sound like you've got a mix of 32-bit and 64-bit stuff on there, which would explain Odd Things Happening. Maybe you need to install a gcc-driver-64-bits and/or gcc-c-compiler-32-bits somehow?

[identity profile] fivemack.livejournal.com 2007-06-05 02:48 pm (UTC)(link)
I reinstalled the OS, asking for development tools when you got to configure the software setup, and now it works.

Sorry, that's the least useful possible resolution to this problem, but I lack the brain and the time to concoct a better.

[identity profile] jojomojo.livejournal.com 2007-06-05 02:52 pm (UTC)(link)
Hey, it's not like I'm too worried, my day job mostly involves QNX (and XP on the desktop) ;)

[identity profile] arnhem.livejournal.com 2007-06-04 09:25 pm (UTC)(link)
Errm, I've got some OpenSuSE 10.2 64-bit machines with a perfectly functional gcc. I think there's something fundamentally funted about your machine.

The trick with suse installs is to click the "software selection" link when you get to the "this is what we're going to install" page; you then get the chance to say "development tools, that sounds cool" ...

[identity profile] davidcook.livejournal.com 2007-06-05 06:56 am (UTC)(link)
Could there be a permissions issue somewhere ? Check that cc1 and the directory path leading to it have appropriate perms, ownership, etc.
Maybe you could try uninstalling the gcc package and reinstalling ? Double-check that there are no error messages on installation ?
ext_8103: (Default)

[identity profile] ewx.livejournal.com 2007-06-05 09:13 am (UTC)(link)
Permissions problems don't generally result in 'No such file or directory'.

[identity profile] fivemack.livejournal.com 2007-06-05 11:23 am (UTC)(link)
I have tried uninstalling and reinstalling the gcc package half a dozen times; rpm seems either to be perfectly silent about what it's doing or (with -v -v) uselessly verbose. With every frustrated blow on the keyboard I long for apt-get install, but the end user wants SuSE, and I'm having a different set of incomprehensible problems getting pre-compiled crystallography binaries to run properly on AMD64 Feisty.