LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Broken toolchain (http://www.linuxquestions.org/questions/slackware-14/broken-toolchain-384677/)

Camino 11-19-2005 01: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 01: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.

Cheers,
Tink

uselpa 11-19-2005 01: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 07: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,

/Me

uselpa 11-20-2005 07: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 08:20 AM

uselpa:

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 09:53 AM

Maybe you can compare your system to this:
Code:

root@slackw:~$ echo $PATH
/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin
root@slackw:~$ which gcc
/usr/bin/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 10: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
/usr/local/bin/gcc

..yields that.

And naturally, if /usr/local/bin/gcc is removed,
# gcc -v

..is 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?

EDIT:
CORRECTION:
When the gcc is missing from /usr/local/bin/

# gcc -v
Does not work as the file does not exist,
HOWEVER:
# 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 10: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 09:38 AM

Yeaap!
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 01:45 AM.