LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 11-19-2005, 01:29 PM   #1
Camino
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware
Posts: 22

Rep: Reputation: 15
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
 
Old 11-19-2005, 01:55 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
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
 
Old 11-19-2005, 01:56 PM   #3
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
You just have to reinstall the original packages using "upgradepkg --reinstall".
The packages should be gcc-*.tgz, binutils-*.tgz and glibc-*.tgz I presume.
 
Old 11-20-2005, 07:12 AM   #4
Camino
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 15
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
 
Old 11-20-2005, 07:56 AM   #5
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
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.
 
Old 11-20-2005, 08:20 AM   #6
Camino
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 15
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*
 
Old 11-20-2005, 09:53 AM   #7
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
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?
 
Old 11-20-2005, 10:17 AM   #8
Camino
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 15
LOL, got to love the "humorous" (a la "It's funny because it's true") unix/linux commands
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

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

Last edited by Camino; 11-20-2005 at 10:40 AM.
 
Old 11-20-2005, 10:49 AM   #9
Camino
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 15
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

Last edited by Camino; 11-20-2005 at 11:05 AM.
 
Old 11-22-2005, 09:38 AM   #10
Camino
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ARM Toolchain Problem richardji Linux - General 2 08-08-2005 10:24 PM
Held on 5.9. Adjusting the Toolchain satimis Linux From Scratch 2 06-30-2005 06:36 AM
toolchain-funcs.eclass doralsoral Linux - Software 2 05-17-2005 06:54 AM
5.9. Adjusting the Toolchain - Error Spudds Linux From Scratch 6 02-23-2005 09:22 AM
6.12. Re-adjusting the Toolchain jobesd Linux From Scratch 2 01-16-2005 01:50 PM


All times are GMT -5. The time now is 10:13 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration