OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
> Compilation Troubles
Blaise
post Mar 18 2005, 08:33 PM
Post #1





Group: Members
Posts: 37
Joined: 15-March 05
From: Toulouse / France
Member No.: 6,643



hi,
sl-5500, OZ-3.5.2, OPIE-1.2
First try to compile on Z. I have to read more about that in this forum, but maybe somebody could help ?

#./configure
gives :
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See 'config.log' for more details.

I dl gcc and install it :
#ipkg -d sd install /mnt/cf/dl_ipk/8_gcc/gcc_3.4.3-r4_arm.ipk
Installing gcc (...) to sd...
Configuring apache
addgroup: www-data: group already in use
postinst script returned status 1
ERROR: apache.postinst returned 1
Configuring gcc

#ipkg-link mount /mnt/card

But when I ./configure again, I still have the same errors.
I am a bit lost with all the gcc packages; which ones are needed to compile ? And how do I add them in $PATH ?

tks
blaise
Go to the top of the page
 
+Quote Post
lardman
post Mar 19 2005, 02:51 AM
Post #2





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



Before you run configure, you need to run something like this in the terminal:

'export PATH=$PATH;/path/to/gcc/bin/directory/'


Si

P.S. Looks like your apache install has a problem (it was presumably a Sharp ROM version, you want to look at the script under <mount point>/usr/lib/ipkg/scripts/ to see whether there's a path/binary which doesn't exist, but which is used in the script).

P.P.S What are you trying to compile? Unless it's a trivial program, you may have troubles with other binaries which it needs, but which you don't have installed - have you thought about cross-compiling with OE?

This post has been edited by lardman: Mar 19 2005, 02:53 AM
Go to the top of the page
 
+Quote Post
Blaise
post Mar 19 2005, 03:46 AM
Post #3





Group: Members
Posts: 37
Joined: 15-March 05
From: Toulouse / France
Member No.: 6,643



QUOTE(lardman @ Mar 19 2005, 02:51 AM)
Before you run configure, you need to run something like this in the terminal:
'export PATH=$PATH;/path/to/gcc/bin/directory/'

ok, I will try, but I have to find out what is the path to gcc bin directory ! I tryied to install a gcc-ipkg to a sd card, and now, I have a /mnt/card/usr/bin/arm-linuxgcc and arm-linux-cpp files. Is this /mnt/card/usr/bin/ the right path ? I will check and try.

QUOTE(lardman @ Mar 19 2005, 02:51 AM)
P.S. Looks like your apache install has a problem (it was presumably a Sharp ROM version, you want to look at the script under <mount point>/usr/lib/ipkg/scripts/ to see whether there's a path/binary which doesn't exist, but which is used in the script).

ok, I will check this script, but I managed to run apache nicely yesterday (well, it just served me a basic html page, but gave me a lot of satisfaction !). It was complaining at startup about missing log file in /var/log/apache/ so I created the /apache directory in /var/log and that made it. But after reboot, this /apache directory had disappeared from /var/log ... ! So I will try either to have it stay at each shutdown, or create it automatically at startup, or change the log file path in apache conf. This should not be too much a problem.

QUOTE(lardman @ Mar 19 2005, 02:51 AM)
P.P.S What are you trying to compile? Unless it's a trivial program, you may have troubles with other binaries which it needs, but which you don't have installed - have you thought about cross-compiling with OE?
*

I want to compile MapServer ( http://mapserver.gis.umn.edu ), a kind of GIS software (geographical Informations System) also called "webmapping".
I am almost sure that it won't be easy at all, but I want to know if it is possible, and use it if yes. Actually, this is why I bought a Z a few days ago; I'm no geek at all yet, but might fall in it ! Depending on the ./configure options, MapServer might need some other libraries to compile fine. I am going to look at the compilator output when.... it will start !
Basic MapServer (without special ./configure options) compiles quite well on almost any linux box, so I suppose it should also on Z...
I have seen on this forum and elsewhere a lot of informations about C compilation, gcc-2.x, gcc--3.x, zgcc, and more. I am not a compilator expert so I have to read all this messages in details to understand how it works on Z. For sure, I will need a bit more help later... :-)
Cross-compilation ? Ha ? Sorry about that. I learnt almost all I know about computers by myself; and myself did not told me anything about cross-compilation ! Does that mean compiling something on another computer (such a linux PC) and then putting the resulting files in the Z ? I think I have read that somewhere ? Yes, it sounds really nice and I would be glad to try that. Complex MapServer configurations take quite a lot of time to compile on a PC, so I really wonder how long it will on a Z...
But isn't cross-compilation making things more difficult (synchronise PC and Z compilators, libraries, pathes... ?). I'll read about it and try to set it up, but I think the easyest way for me for now would be to compile on the Z, am I wrong ?
So I'm gonna read the docs again and I'll be back.
tks
Blaise
Go to the top of the page
 
+Quote Post
Teletubbie
post Mar 19 2005, 04:23 AM
Post #4





Group: Members
Posts: 252
Joined: 25-April 04
Member No.: 3,006



Hi,
the whole openzaurus and opie are compiled with the crosscompiling/developement framework openembedded.
You can find it here:
http://openembedded.org/
It is fast, depending on you machine.
There is very good documentation for openembedded.
If you have a linux machine, set up openembedded, then have a look at metadata.
You can browse also metadata here:
http://openembedded.bkbits.net:8080/openem...index.html|src/.
There you will find a lot of similar packages as example and construct the metadata file (they are called bb files, because of the bb extension, that stands for bitbake) for your mapserver.
Once you have this, the frame work build all the necessary packages for crosscompiling mapserver. It gets all the sources via internet and compiles them for your target host.
Once it builds succesfully, you can submit your metadata to the openembedded source tree, so other users can build it too and make some imporovements.
You can find help at #oe on freenode irc, by the mailing list and sometimes here on these forums.
Cheers,
Sam
Go to the top of the page
 
+Quote Post
Blaise
post Mar 19 2005, 07:44 PM
Post #5





Group: Members
Posts: 37
Joined: 15-March 05
From: Toulouse / France
Member No.: 6,643



Tks for your suggestions about cross-compilation. Maybe I'm wrong, but I would like to compile natively on the Z. I have the feeling that if it compiles well, it is more likely to run fine than being x-compiled. But I will learn about x-compil later anyway.
I found on the "Live Cd For Developpers" thread that some people managed to compile natively, so I keep on trying... (btw, I made some customs livecd a few month ago, and find this process real cool, so I'll look for these Z development livecds.)

I followed lardman export PATH suggestion without success, I must miss something :

I dl gcc and install it, but maybe I need more than 1 gcc ipk ? :
#ipkg -d sd install /mnt/cf/dl_ipk/8_gcc/gcc_3.4.3-r4_arm.ipk
Installing gcc (...) to sd...
Configuring apache
addgroup: www-data: group already in use
postinst script returned status 1
ERROR: apache.postinst returned 1
Configuring gcc

#ipkg-link mount /mnt/card

(Apache error is ok, Apache runs fine)
This gives me the following files :
#ls /mnt/card/usr/bin
arm-linux-cpp
arm-linux-gcc
arm-linux-gccbug
arm-linux-gcov

(all are executable by everybody)


Then :
#echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:
#export PATH=$PATH/mnt/card/usr/bin
#echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/mnt/card/usr/bin

Then :
#./configure
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See 'config.log' for more details.


Do I miss other than "gcc_3.4.3-r4_arm.ipk" gcc ipk (as there is plenty of) ?
Is my path to the C compiler wrong ?
Something else ?
blaise
Go to the top of the page
 
+Quote Post
lardman
post Mar 20 2005, 07:38 AM
Post #6





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



QUOTE
#ipkg-link mount /mnt/card

(Apache error is ok, Apache runs fine)
This gives me the following files :
#ls /mnt/card/usr/bin
arm-linux-cpp
arm-linux-gcc
arm-linux-gccbug
arm-linux-gcov


You should more properly now use the symlinked files which are/should be in /usr/bin (as you've run ipkg-link).

The reason it can't find gcc, is that gcc isn't there - arm-linux-gcc is. Try creating some symlinks from /usr/bin/arm-linux-gcc -> /usr/bin/gcc etc.


Si
Go to the top of the page
 
+Quote Post
Blaise
post Mar 20 2005, 01:33 PM
Post #7





Group: Members
Posts: 37
Joined: 15-March 05
From: Toulouse / France
Member No.: 6,643



ok, I'm willing to learn how to properly use smlinked files...
I tryied to create symlinks :

After installing some gcc ipkg, I have the following files :
#ls /mnt/card/usr/bin
arm-linux-cpp
arm-linux-g++
arm-linux-gcc
arm-linux-gccbug
arm-linux-gcov

and links :
#ls -l /mnt/card/usr/bin
arm-linux-cpp -> /mnt/card/usr/bin/arm-linux-cpp
arm-linux-g++ -> /mnt/card/usr/bin/arm-linux-g++
arm-linux-gcc -> /mnt/card/usr/bin/arm-linux-gcc
arm-linux-gccbug -> /mnt/card/usr/bin/arm-linux-gccbug
arm-linux-gcov -> /mnt/card/usr/bin/arm-linux-gcov

I follow your symlink suggestion :
#ln -s /usr/bin/arm-linux-cpp /usr/bin/cpp
#ln -s /usr/bin/arm-linux-g++ /usr/bin/g++
#ln -s /usr/bin/arm-linux-gcc /usr/bin/gcc
#ln -s /usr/bin/arm-linux-gccbug /usr/bin/gccbug
#ln -s /usr/bin/arm-linux-gcov /usr/bin/gcov

to have :
#ls -l /mnt/card/usr/bin
arm-linux-cpp -> /mnt/card/usr/bin/arm-linux-cpp
arm-linux-g++ -> /mnt/card/usr/bin/arm-linux-g++
arm-linux-gcc -> /mnt/card/usr/bin/arm-linux-gcc
arm-linux-gccbug -> /mnt/card/usr/bin/arm-linux-gccbug
arm-linux-gcov -> /mnt/card/usr/bin/arm-linux-gcov
cpp -> /usr/bin/arm-linux-cpp
g++ -> /usr/bin/arm-linux-g++
gcc -> /usr/bin/arm-linux-gcc
gccbug -> /usr/bin/arm-linux-gccbug
gcov -> /usr/bin/arm-linux-gcov


Then try to configure again; it's going farther, but... :
cd /mnt/cf/dl_ipkg/ms/mapserver-4.4.0
./configure
checking for gcc.. gcc
ckecking for C compiler default output file name... configure: error C compiler cannot create executables
See 'config.log' for more details.

This is part of the config.log file where it seems to fail :
. . . . . . . . .
gcc driver version 3.4.3 executing gcc
version 3.4.2
configure:1671: $? = 0
configure:1673: gcc -V </dev/null>&5
gcc: '-V' option must have argument
configure:1676: $? = 1
configure:1699: checking for C compiler default output file name
configure:1702: gcc conftest.c >&5
gcc: installation problem, cannot exec 'as':
No such file or directory
configure:1705: $? = 1
configure: failed program was:
| /* confdefs.h */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h */
|
| int
| main()
| {
|
| ;
| return 0;
| }
configure:error1743: error:C compiler cannot create executables
See 'config.log' for more details
. . . . . . . . .


I am trying to understand what more stands if the config.log file. Can it still be some missing symlinks ? a wrong file tree ? missing directories ? or bad mod settings ? What about the confdefs.h file ? I am no C guru, but isn't it something wrong with the main function ?
Were should the C compiler try to create executables ? I think I have a wrong gcc configuration, but where ? ! ? I'm searching the forum...
blaise
Go to the top of the page
 
+Quote Post
Blaise
post Mar 20 2005, 04:44 PM
Post #8





Group: Members
Posts: 37
Joined: 15-March 05
From: Toulouse / France
Member No.: 6,643



Hummm... I have to setup well gcc. Hello world doesn't even compile !

#echo 'int main(int argc, char **argv) { printf("hello, world!"); putchar(10); }' > hello.c
#gcc -o hello hello.c
gcc: installation problem, cannot exec 'as': No such file or directory

but how ? searching ...
Go to the top of the page
 
+Quote Post
Blaise
post Mar 20 2005, 05:26 PM
Post #9





Group: Members
Posts: 37
Joined: 15-March 05
From: Toulouse / France
Member No.: 6,643



'seems that I was missing the binutils ipkg :

#ipkg-install -d sd install /mnt/cd/dl_ipkg/8_gcc/binutils_2.15.94.0.1-r0_arm.ipk
Installing binutils (...) to sd...
Configuring binutils

ipkg-link mount /mnt/card

#gcc -o hello hello.c
/mnt/card/usr/bin/../lib/gcc/arm-linux/3.4.3/../../../../arm-linux/ld: crt1.o: No such file or directory
collect2: ld returned 1 exit status

investigating.........
Go to the top of the page
 
+Quote Post
Blaise
post Mar 20 2005, 07:28 PM
Post #10





Group: Members
Posts: 37
Joined: 15-March 05
From: Toulouse / France
Member No.: 6,643



now, it seems I'm missing libc-dev or something, ipkgfind offers libc6-dev.

#ipkg list :
libc6, but no libc6-dev

libc6-dev requires :libthread-db1, glibc-extra-nss

#ipkg-install -d sd install /mnt/cd/dl_ipkg/8_gcc/libthread-db1_2.3.2+cvs20040726-r14_arm.ipk
Installing libthread-db1 (...) to sd...
Configuring libthread-db1

#ipkg-link mount /mnt/card

#ipkg-install -d sd install /mnt/cd/dl_ipkg/8_gcc/glibc-extra-nss_2.3.2+cvs20040726-r13_arm.ipk
Installing glibc-extra-nss (...) to sd...
Configuring glibc-extra-nss

#ipkg-link mount /mnt/card

#ipkg-install -d sd install /mnt/cd/dl_ipkg/8_gcc/libc6-dev_2.3.2+cvs20040726-r14_arm.ipk
Installing libc6-dev (...) to sd...
Configuring libc6-dev

#ipkg-link mount /mnt/card

Then, try to compile again :
#gcc -o hello hello.c
/mnt/card/usr/bin/../lib/gcc/arm-linux/3.4.3/../../../../arm-linux/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status

Is this "-lgcc_s" a file or what ? ? ? What does this error means ?
keeping investigating....
Go to the top of the page
 
+Quote Post
Blaise
post Mar 20 2005, 07:56 PM
Post #11





Group: Members
Posts: 37
Joined: 15-March 05
From: Toulouse / France
Member No.: 6,643



well... no good news :< I found the same problem in this thread : "How To Setup Native Onboard Development On 3.5.2, using new development section of oz feed", and tryied the :
#ln -sf /lib/libgcc_s.so.1 /mnt/card/usr/lib/libgcc_s.so
trick to try to get rid of my last error. But then compiling helloworld gives me the same error as in the other thread :
libc.so: file format not recognized; treating as linker script
libc.so:4: syntax error
collect2: ld returned 1 exit status

Last post is Feb 2 2005 and it seems not to have been solved. Something related to glibc ? ha ? keep searching... and hoping... Anybody having managed native c compilation around ? ? ? sad.gif sad.gif
Go to the top of the page
 
+Quote Post
Blaise
post Mar 20 2005, 09:17 PM
Post #12





Group: Members
Posts: 37
Joined: 15-March 05
From: Toulouse / France
Member No.: 6,643



Might I need some libstdc++ ipkg to compile properly ?
I don't have any in the output of ipkg-list command.
IpkgFind offers :
gcc3-libstdc++4 the shared library libstdc++.so.4 from gcc3.Used to run p...
libstdc++-dev The GNU cc and gcc C compilers.
libstdc++2.10-dev The GNU stdc++ library (development files)NOTE: This is n...
libstdc++2.10-glibc2.2 The GNU stdc++ libraryNOTE: This is not a final release, ...
libstdc++5 The GNU Standard C++ Library v3This package contains an a...
libstdc++6 The GNU cc and gcc C compilers.
Which one should I take ? how canI know which libstc++ lib does my gcc need ?
I'm going to try


Another thing :
In thread :"c Compiler Cannot Create Executable", What's up with this error?
Although it is about cross-compilation, I found this test that gives me :
#cd /mnt/card/usr/bin
#strings arm-linux-gcc | grep GLIBC
GLIBC_2.0
GLIBC_2.3
GLIBC_2.1

#find -name collect2
./mnt/card/usr/libexec/gcc/arm-linux/3.4.3/collect2
./usr/libexec/gcc/arm-linux/3.4.3/collect2
(./mnt/card/usr/libexec/gcc/arm-linux/3.4.3/collect2 is the real file, the other one is a link)

#cd /mnt/card/usr/libexec/gcc/arm-linux/3.4.3
#strings collect2 | grep GLIBC
GLIBC_2.0
GLIBC_2.1

Is this important that it doesn't match ?

keep hoping..... . . . .
Go to the top of the page
 
+Quote Post
Blaise
post Mar 20 2005, 11:01 PM
Post #13





Group: Members
Posts: 37
Joined: 15-March 05
From: Toulouse / France
Member No.: 6,643



Haven't tryied to install libstdc++ yet, but was figuring out what libc.so was made of :

/usr/lib/libc.so on linux-pc :
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-i386)
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )


/mnt/card/usr/lib/libc.so on Zaurus :
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
***BUG in libc/scripts/output-formated.sed ***
elf32-bigarm,elf32-littlearm
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )

Any idea what this BUG is about ? I tryied to change the libc.so file, keeping only 1 line :
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
This gives, at compilation :
ERROR: /usr/lib/libc_nonshared.a(elf-init.oS) uses hardware FP, whereas 0_hello uses software FP
and a few similar error messages.

... doesn't seem to be a good idea...
Maybe an "OUTPUT_FORMAT" is needed in the libc.so file ?
Wondering if I'm not geting lost ?
Go to the top of the page
 
+Quote Post
lardman
post Mar 21 2005, 02:04 AM
Post #14





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



I tried the native compiler a while nack, I'd be happy if you could track down what the problem with it is as it would be a useful tool.

In the meantime, it might be worth your while to set up the BB/OE system and use that to compile your app.


Si
Go to the top of the page
 
+Quote Post
Blaise
post Mar 21 2005, 02:29 AM
Post #15





Group: Members
Posts: 37
Joined: 15-March 05
From: Toulouse / France
Member No.: 6,643



keep trying... but still stuck with this error :
libc.so: file format not recognized; treating as linker script
libc.so:4: syntax error
collect2: ld returned 1 exit status

I'll see also the BB/OE system you talk about. I would really like to be able to compile :-)
blaise
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd September 2014 - 12:19 PM