LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 05-04-2007, 01:59 AM   #46
jowa45
Member
 
Registered: Apr 2007
Location: Stockholm, Sweden
Distribution: Slackware11&14.1
Posts: 119

Rep: Reputation: 15

Hi,
I have installed src2pkg. Would someone be as kind as to help me get started with it.

I would like to make Slackware installation packages for the GNU Tool Chain used for AVR microcontroller programming. The idea behind this being to install the tool chain in older computers with a minimal Slackware installation and use those only for this application.

I would just like to go through how the installation is normally carried out using the compiler as an example.

tar -jxvf gcc-core-4.1.1.tar.bz2
cd gcc-4.1.1
mkdir obj-avr
cd obj-avr
../configure --target=avr --prefix=/usr/local/avr --enable-languages=c \
--disable-nls --disable-libssp
make
make install

The computer that I will be making the packages on is an i686 and the ones that I will be installing are i486. The i686 has the toolchain installed already which I do not want changing in any way.
Gratefull for any help but please bear in mind that I have never made a Slackware package before.


John

Last edited by jowa45; 05-04-2007 at 04:52 AM.
 
Old 05-04-2007, 08:48 AM   #47
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Original Poster
Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Place the tarball in a separate directory, login as root and cd into the directory and run this command:

src2pkg -p='/usr/local/avr' -e='--target=avr --enable-languages=c --disable-nls --disable-libssp' gcc-core-4.1.1.tar.bz2
 
Old 05-05-2007, 08:01 PM   #48
hoofer
LQ Newbie
 
Registered: Jun 2005
Location: Brazil
Distribution: Slackware, Slamd64
Posts: 28

Rep: Reputation: 16
Quote:
Originally Posted by tuxdev
Yeah, what happens if you use an older installwatch from checkinstall?
I tried using installwatch 0.7, which comes with checkinstall 1.6.0.

It gave me the same error as the new one (apparently works but errors out)
 
Old 05-06-2007, 04:56 AM   #49
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
I had the same problems, but they went away when I built installwatch by hand (LDFLAGS="-fPIC -O2" ./configure).

As far as I can tell, i installed the 32 bit src2pkg package, then rebuilt installwatch and copied the lib (installwatch.so) to /usr/libexec/src2pkg/ over the top of the one provided. I suppose I meant to fix the problem at some point by rebuilding the source, but so far haven't gotten around to it.

- Piete.

Edit: For what it's worth, I'm using installwatch 0.6.3, but I'd bet someone elses leg that just rebuilding the library will fix the problem regardless of the lib version (API allowing, of course).

Last edited by piete; 05-06-2007 at 04:58 AM.
 
Old 05-06-2007, 11:57 AM   #50
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Original Poster
Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Thanks for chipping in with that Piete -I was wondering if you had worked that issue out?
Did you have to compile that under the 64bit system, or can it be done on the regular 32bit system?
 
Old 05-06-2007, 02:58 PM   #51
hoofer
LQ Newbie
 
Registered: Jun 2005
Location: Brazil
Distribution: Slackware, Slamd64
Posts: 28

Rep: Reputation: 16
Thank you piete, it worked!
Now, if you excuse me, I have some package building to do...
 
Old 05-07-2007, 10:46 AM   #52
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
I think the problem comes from the way relocation (-fPIC - position independant code) and shared objects work and the differences between x86 and x86_64 - likely register sizes. I don't know enough about the way libraries work to tell you the details, although I daresay a few searches will give you the necessary information on .so and PIC to draw your own conclusions.

Quote:
I was wondering if you had worked that issue out?
In terms of quick fix, recompile installwatch and shazzam. Did you mean something else? I've not built a slamd64 package for it, I imagine I was thinking about it when I copied the .so over, but I don't seem to have done it heh.

Quote:
Did you have to compile that under the 64bit system, or can it be done on the regular 32bit system?
Ahh, now we're talking about cross-compilation. If you can get a cross toolchain built for the target arch, it'll work just the same as building it under that arch. I built it using the native slamd64 11.0 toolchain, which is mono-arch x86_64 (not bi-arch, like the versions in 10.0), but if you had an x86 to x86_64 toolchain, you'd get the same result.

It comes down to installwatch being a shared object and thus architecture dependant (which I know you know =D ). Again, did I misunderstand?

Good luck with the building, hoofer =)

Gilbert: I'll happily provide you with any information you need for x86_64, feel free to give me an email (can you use the email form from LQ, or fish around in my profile for my old site, which should still have contact details on it) if there's anything I can do.

- Piete.
 
Old 05-10-2007, 02:13 AM   #53
jowa45
Member
 
Registered: Apr 2007
Location: Stockholm, Sweden
Distribution: Slackware11&14.1
Posts: 119

Rep: Reputation: 15
Hi,
My package making failed. It failed on two different computers both with successful installations and the exact tarball used for installation was used for src2pkg.

Here is my attempt to get a read out:-


root@slackbox_1:/install/src2pkg/avr-gcc# \
> src2pkg -p='/usr/local/avr' -e='--target=avr --enable-languages=c \
> --disable-nls --disable-libssp' gcc-core-4.1.1.tar.bz2
Found source archive: gcc-core-4.1.1.tar.bz2
Deleting old build files - Done
Creating working directories - PKG_DIR SRC_DIR Okay
Unpacking source archive - Done
Found sources: gcc-4.1.1
Moving into SRC_DIR: gcc-core-4.1.1-src-1
Correcting file permissions - Done
Found configure script - Configuring sources using:
CFLAGS=-O2 -march=i486 -mtune=i686 ./configure --prefix=/usr/local/avr
--target=avr --enable-languages=c --disable-nls --disable-libssp
Configuration has been - Successful!
Compiling sources - Using: 'make'
ERROR! Compiling source code has failed.
This usually happens because of missing libraries, or
badly written Makefiles or configure scripts.
Sorry! No Dependency or Requirements information found.

src2pkg FAILURE in compile_source
root@slackbox_1:/install/src2pkg/avr-gcc#


John
 
Old 05-10-2007, 02:25 AM   #54
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
Re-run that command with the -VV switch (man src2pkg), to show the output of the steps then post the failure message from make. Not knowing avr-gcc off the top of my head, I can't explain what's going wrong yet =)

- Piete.

[Edit]
Oh, you may want to add -A as well, to make you a script with all the right options in when it succeeds. Alternatively, use -N and hack the resultant script accordingly.

Last edited by piete; 05-10-2007 at 02:27 AM.
 
Old 05-10-2007, 04:30 AM   #55
jowa45
Member
 
Registered: Apr 2007
Location: Stockholm, Sweden
Distribution: Slackware11&14.1
Posts: 119

Rep: Reputation: 15
Hi piete,
The output is truly enormous to put on a web site. I am only putting the first and last part.
If you would like the complete file I will send it to you by email and you can put the relevant part on this forum. Backslashes at the end of lines were added by me to make the output more readable.

Found source archive: gcc-core-4.1.1.tar.bz2
Removing existing package build directory from previous build - 
Removing existing source build directory from previous build - 
Creating working directories - PKG_DIR SRC_DIR Okay
Unpacking source archive - 
gcc-4.1.1/
gcc-4.1.1/gcc/
gcc-4.1.1/gcc/diagnostic.def
gcc-4.1.1/gcc/cstamp-h.in
gcc-4.1.1/gcc/doc/
~
~
~
make[3]: Entering directory `/tmp/gcc-core-4.1.1-src-1/host-i686-pc-linux-gnu/gcc'
for d in libgcc avr3 libgcc/avr3 avr4 libgcc/avr4 avr5 libgcc/avr5; do \
if [ -d $d ]; then true; else /bin/sh ../.././gcc/../mkinstalldirs $d; fi; \
done
mkdir -p -- libgcc
mkdir -p -- avr3
mkdir -p -- libgcc/avr3
mkdir -p -- avr4
mkdir -p -- libgcc/avr4
mkdir -p -- avr5
mkdir -p -- libgcc/avr5
if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi
/tmp/gcc-core-4.1.1-src-1/host-i686-pc-linux-gnu/gcc/xgcc -B/tmp/gcc-core-4.1.1-src-1/ \
host-i686-pc-linux-gnu/gcc/ -B/usr/local/avr/avr/bin/ -B/usr/local/avr/avr/lib/ \
-isystem /usr/local/avr/avr/include -isystem /usr/local/avr/avr/sys-include -O2 \
-O2 -O2 -march=i486 -mtune=i686 -DIN_GCC -DCROSS_COMPILE \
-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition \
-isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g \
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../.././gcc -I../.././gcc/.\
-I../.././gcc/../include -I../.././gcc/../libcpp/include -DL_mulqi3 -xassembler-with-cpp -c \
../.././gcc/config/avr/libgcc.S -o libgcc/./_mulqi3.o
make[3]: Leaving directory `/tmp/gcc-core-4.1.1-src-1/host-i686-pc-linux-gnu/gcc'
make[2]: Leaving directory `/tmp/gcc-core-4.1.1-src-1/host-i686-pc-linux-gnu/gcc'
make[1]: Leaving directory `/tmp/gcc-core-4.1.1-src-1'
ERROR! Compiling source code has failed.
This usually happens because of missing libraries, or
badly written Makefiles or configure scripts.
Sorry! No Dependency or Requirements information found.

src2pkg FAILURE in compile_source


John
 
Old 05-10-2007, 08:52 AM   #56
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 115Reputation: 115
Try without src2pkg the exact steps it takes (i.e. no mkdir obj_avr and stuff).

Perhaps the example script for gcc 2.9.5 should be modified to do gcc-4.1.1 and avr.

Last edited by tuxdev; 05-10-2007 at 08:54 AM.
 
Old 05-10-2007, 09:10 AM   #57
jowa45
Member
 
Registered: Apr 2007
Location: Stockholm, Sweden
Distribution: Slackware11&14.1
Posts: 119

Rep: Reputation: 15
Hi tuxdev,
Is this likely to corrupt the installation in any way ?. I am using the two computers I have the installation on. If there is any chance of such I would prefer to install slack 11 on another. Might do that anyway.

John
 
Old 05-10-2007, 09:27 AM   #58
jowa45
Member
 
Registered: Apr 2007
Location: Stockholm, Sweden
Distribution: Slackware11&14.1
Posts: 119

Rep: Reputation: 15
Hi,
Just thought of something. I have used src2pkg to make a package for another link in the toolchain the binutils package. This is normally installed with the same mkdir obj-avr cd obj-avr ../configure proceedure as all the other packages in the chain. When I say I made a package I mean a package was produced I have not yet tested that I can use the package.

John
 
Old 05-10-2007, 10:01 AM   #59
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
Thanks John, the output is pretty mad

You can enclose code with [code.][/code.] tags (take out the . to make the BB code work) which will sort out wrapping and give you nice formatting and so on.

Anyway, to the problem at hand!

So, I got a hold of the gcc-core package you're using and ran the same line ... half way through compilation it occured to me that it wouldn't work, because I'm not using Slack 11 stock! Anyway, long story short the build failed for me too =)

Ok, so looking at the output you have, things are a bit wierd. Mine errored like so (emphasis added):

Code:
          else true; fi; \
          echo timestamp > include/fixed; \
        fi
echo timestamp > stmp-fixproto
make[2]: *** No rule to make target `/usr/local/avr/bin/avr-as', needed by `stamp-as'.  Stop.
make[2]: Leaving directory `/tmp/gcc-core-4.1.1-src-1_pes_slamd64_11/host-x86_64-unknown-linux-gnu/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/tmp/gcc-core-4.1.1-src-1_pes_slamd64_11'
make: *** [all] Error 2
ERROR! Compiling source code has failed.
This usually happens because of missing libraries, or
badly written Makefiles or configure scripts.
Sorry! No Dependency or Requirements information found.
Which is pretty obviously some compile problem, and this is verified by cd /tmp/gcc-core and running make directly. I get the same error.

Anyway, with your output there is clearly no make failure so, could I ask you to run make directly in the source ( /tmp/gcc-core-4.1.1-src-1/ ) and see what happens?

Basically what we're seeking is if this is a src2pkg bug, a compilation bug or if it's something else.

Feel free to email me (you can use the forum tools in my profile) logs if you can't find the relevant parts.

And finally, congratulations on using src2pkg and getting your feet wet with package making!

- Piete.

Edit:

I never learn to refresh the thread before I post, having been called away to do something else ... *sigh*

And it's only just occured to me what you're actually trying to do! In general terms, I have found that making cross-toolchains is a PITA but the ones I have made I always built the whole toolchain with:
./configure --prefix=/opt/crosschain/<target> <options>

You may be best off building and installing everything with --prefix=/opt/avr (or similar) and then package the resultant directory up with appropriate /etc/profile.d/ setup scripts (to add /opt/avr/bin to PATH, for example) instead of trying to do each piece.

FWIW I can bet your left leg that --prefix=/opt/avr won't overwrite your native toolchain *nod*

Last edited by piete; 05-10-2007 at 10:10 AM.
 
Old 05-10-2007, 11:14 AM   #60
jowa45
Member
 
Registered: Apr 2007
Location: Stockholm, Sweden
Distribution: Slackware11&14.1
Posts: 119

Rep: Reputation: 15
Hi,
Well I got some interesting results. Perhaps though you could help me and tell me how I should have captured the output from make. Redirection did not reproduce what I saw and again this is manually adjusted. Is there a man to explain how to accurately capture output you see on the screen. I am doing this by looking at one screen and typing on another.

Here is the interesting last part :-


make[2]: Leaving directory `/tmp/gcc-core-4.1.1-src-1/host-i686-pc-linux-gnu/libcpp'
make[2]: Entering directory `/tmp/gcc-core-4.1.1-src-1/host-i686-pc-linux-gnu/gcc'
make \
CFLAGS="-O2 -march=i486 -mtune=i686 -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute " \
CONFIG_H="config.h auto-host.h ../.././gcc/../include/ansidecl.h" \
MAKEOVERRIDES= \
-f libgcc.mk all
make[3]: Entering directory `/tmp/gcc-core-4.1.1-src-1/host-i686-pc-linux-gnu/gcc'
/tmp/gcc-core-4.1.1-src-1/host-i686-pc-linux-gnu/gcc/xgcc -B/tmp/gcc-core-4.1.1-src
-1/host-i686-pc-linux-gnu/gcc/ -B/usr/local/avr/avr/bin/ -B/usr/local/avr/avr/lib/
-isystem /usr/local/avr/avr/include -isystem /usr/local/avr/avr/sys-include -O2
-O2 -O2 -march=i486 -mtune=i686 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include
-DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
-Dinhibit_libc -I. -I. -I../.././gcc -I../.././gcc/. -I../.././gcc/../include
-I../.././gcc/../libcpp/include -DL_mulqi3 -xassembler-with-cpp -c ../.././
gcc/config/avr/libgcc.S -o libgcc/./_mulqi3.o

cc1 : error : unrecognized command line option "-march=i486"
cc1 : error : unrecognized command line option "-mtune=i686"

make[3]: *** [libgcc/ ./_mulgi3.o] Error1


make[3]: Leaving directory `/tmp/gcc-core-4.1.1-src-1/host-i686-pc-linux-gnu/gcc'
make[2]: Leaving directory `/tmp/gcc-core-4.1.1-src-1/host-i686-pc-linux-gnu/gcc'
make[1]: Leaving directory `/tmp/gcc-core-4.1.1-src-1'

make : ***[all] Error 2
John

Last edited by jowa45; 05-10-2007 at 11:31 AM.
 
  


Reply



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
smart package manager bad magic cpio error matticus SUSE / openSUSE 5 04-10-2012 10:41 AM
Using Partition Magic and Boot Magic to install Linux zathrus MEPIS 4 01-14-2006 08:24 PM
Partition Magic/Boot magic and Slackware. adam1835 Linux - Newbie 5 01-11-2006 11:46 AM
Can't get Age of Empires II: Age of Kings started (I've could it before !!!) vegetassj2 Linux - Games 44 08-28-2005 04:59 PM
Java does "age" or "Age" matter when declaring an Int?? Laptop2250 Programming 3 10-13-2003 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:34 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration