-   Slackware (
-   -   Broken toolchain (

Camino 11-19-2005 02:29 PM

Broken toolchain
Hi guys,

I'm used to work under Windows, and have done some AVR-developing.
I recently installed Slackware and have with it quite a bit, however, when I wanted to do developing for an Atmel microcontroller (Atmega16) I needed to do some updating & building. However, I did not do enough reading before, and realized only afterwards that updating native gcc, libc & binutils is a BAD idea, unless you know what you are doing.
So basically I'm asking about the possibilities of going back to the toolchain-setup that the Slackware 10.1 comes with. Or do I need to reinstall the distro?
If it's possible to fix, I'd rather do that instead of a reinstall to learn some valuable tricks.

Thanks for your time,

/ Me

Tinkster 11-19-2005 02:55 PM

Insert and mount CD1
upgradepkg --reinstall /mnt/cdrom/slackware/d/*tgz
Possibly some tools from the a/ap series may be affected
to - upgradepkg those individually.


uselpa 11-19-2005 02:56 PM

You just have to reinstall the original packages using "upgradepkg --reinstall".
The packages should be gcc-*.tgz, binutils-*.tgz and glibc-*.tgz I presume.

Camino 11-20-2005 08:12 AM

Thanks guys,

Allthough after doing that,
# gcc -v

..still claimed that I was running 4.x.x though. Also that it was configured with path-to-my-ATMEL-stuff, thus it seems that either my PATHS makes sure that I'm using the wrong versions, or that even after using upgradepkg --reinstall, I'd need to configure the whole toolchain and rebuild them, to finish the installation?

Anyhow, I seem to have gcc in a couple of different directories
(/usr/bin/ and /usr/local/bin/ ).
I noticed that the one in /usr/bin/ was gcc 3.3.4. so I copied it to /usr/local/bin/ and now ' gcc -v ' tells me that I'm running the right version.. .
I did manage to atleast compile a tiny gtk app, so something is working as it should..

Anyway, my question is:
In the Slackware distro, should the gcc (and other relevant) binaries be in /usr/bin or /usr/local/bin , is it my paths that are messed aswell?

*trying to get the hang of the structure with the files*

I've made a mess *sobs*

Thanks for your input, I appreciate it,


uselpa 11-20-2005 08:56 AM

It should be in /usr/bin, you can see that by looking into the relevant packages (either in /var/log/packages/ or by doing a less on a *.tgz package).
I'd clean the /usr/local stuff to get rid of gcc4.

Camino 11-20-2005 09:20 AM


The thing is, if I remove /usr/local/bin/gcc , then gcc cannot be found at all. Even though /usr/bin/ is also in the PATH..

*scratches head*

uselpa 11-20-2005 10:53 AM

Maybe you can compare your system to this:

root@slackw:~$ echo $PATH
root@slackw:~$ which gcc
root@slackw:~$ gcc -v
Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.3.6/specs
Configured with: ../gcc-3.3.6/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 3.3.6

Any differences?

Camino 11-20-2005 11:17 AM

LOL, got to love the "humorous" (a la "It's funny because it's true") unix/linux commands :D
Did not know of the 'which' command, but the selected name for that one is so spot-on that it's hillarious .. or maybe it's just me :p

Anyway, the PATHS are exactly the same. However, as expected:
# which gcc

..yields that.

And naturally, if /usr/local/bin/gcc is removed,
# gcc -v not possible, as the file doesn't exist.
However, copying /usr/bin/gcc to /usr/local/bin/ and then running it, I get (of course) the same result as you, except my version is 3.3.4 and not 3.3.6. I assume you have a more recent version of the distro or so.

So, somehow gcc wants to execute from /usr/local/bin and not /usr/bin/, and the PATH has nothing to do with it, then what has?

When the gcc is missing from /usr/local/bin/

# gcc -v
Does not work as the file does not exist,
# which gcc
/usr/bin/gcc <<------ !!!

which gcc says /usr/bin/gcc is the one, but still it's not working.
But when I copy /usr/bin/gcc to /usr/local/bin/ , gcc is found, and I can use it, and ' which gcc ' points to /usr/local/bin/gcc also..

this makes more sense, but still I wonder why gcc cannot be found from /usr/bin/ even though 'which' points to that

Camino 11-20-2005 11:49 AM

It occured to me while talking to myself here, that the PATHs are "local" during a session, thus deleting a file might not be enough even though the command "which" states that the PATH has changed. A new session comfirmed this :)
Trying to remove the rest of the files from /local.. hopefully it will work out :)

Thanks all :)

Camino 11-22-2005 10:38 AM

Did some cleaning all over the place and all seems to be working fine. Also installed the tool chain for AVR devving FAR away from the native stuff (according to a nice book about Embedded Linux that I'm reading), and that too works just fine.

Thanks a lot guys :)

All times are GMT -5. The time now is 08:24 PM.