linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: Cross-compile dynamic apps for mpc860 on ix86
       [not found]                                                       ` <388BA902.B41A2E11@huawei.com.cn>
@ 2000-01-24  3:00                                                         ` Brendan J Simon
  2000-01-24  5:03                                                           ` Wolfgang Denk
  2000-01-24  6:46                                                           ` dony
  0 siblings, 2 replies; 6+ messages in thread
From: Brendan J Simon @ 2000-01-24  3:00 UTC (permalink / raw)
  To: dony; +Cc: Grant Carter, linuxppc-embedded


dony wrote:

> In fact, I have posted ALL howtos (not brief howtos)  that I have done when compiling the cross-compile environment. And
> these are all stealed from CrossGcc FAQ. See http://www.objsw.com.
> I do these successfully on SuSE linux (European version), kernel 2.2.13. But the same steps on Redhat linux cannot work
> and some errors occur. I don't know why and are checking these.
> Since Redhat linux is widely used by most linux fans, I will research some effective and stable steps on this. I will
> post to this mail list later when I succeed on Redhat linux.

I am using RedHat-5.2 and I don't have any problems.  There might be some problems with RedHad-6.0 and/or RedHat-6.1.  I
have heard of some people having problems with RedHat-6.x but I think that might be with RTEMS.  Anyway, RedHat-5.2 works
for me.


> > He is using egcs-1.1.2, glibc-2.1 and binutils-2.9.1.0.19a.
> >
> > I have just managed to cross-compile glibc-2.1.1 and glibc-2.1.2 with egcs-1.1.2.  I haven't tested them out yet but
> > will do it this week.  I am running with the embedded-2.2.5.tgz kernel and should upgrade to mpc8xx-2.2.13.tgz
> > kernel.  I assume things should still work with the 2.2.5 kernel and I will let you know soon.
> >
> > I couldn't get glibc-2.1.1 nor glibc-2.1.2 to compile using the cpu=860 flag.  I was setting CC="powerpc-linux-gcc
> > -mcpu=860".
>
> I think maybe you should use "export CC=powerpc-linux-gcc" and not use "-mcpu=860". I don't know why, but I do this and
> succeed.

Yes.  I have successfully built glibc-2.1.1 and glibc-2.1.2 with egcs-1.1.2 and binutils-2.9.1.0.19a.
I have copied all the shared libraries to my nfs root filesystem under /lib.  I still get segmentation faults when I try to
run the dynamic application.  Arghh !!!  This is so annoying.

I'm using embedded-2.2.5 sourece.  Maybe I should try mpc8xx-2.2.13 or linux-2.2.14 ?
Dony, have you modified any of the kernel source code ?

Does any body out there in linuxppc-embedded land have a clue as to what could be causing the segfaults ?
Can someone suggest a way of getting more debugging information.  I'm using nfsd with "-F -d" call options at the moment.
I can see the ld.so.1 gets called which causes lots of reads from ld-2.1.2.so and then that's it.  I would expect to get
calls to libc.so.6 but it never gets that far.


> > I also tried with the --nfp configure flag but I couldn't get any combination to work.
>
> I don't know this option , so not use it.

It is "supposed" to exclude generation of hardware floating point code.
I imagine this should work better in the next release of glibc (whenever that is) as all the fpu code is in a seperate fpu
directory for the powerpc target.

Brendan Simon.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cross-compile dynamic apps for mpc860 on ix86
  2000-01-24  3:00                                                         ` Cross-compile dynamic apps for mpc860 on ix86 Brendan J Simon
@ 2000-01-24  5:03                                                           ` Wolfgang Denk
  2000-01-24  6:46                                                           ` dony
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2000-01-24  5:03 UTC (permalink / raw)
  To: Brendan.Simon; +Cc: dony, Grant Carter, linuxppc-embedded


In message <388BC036.7BC21AE1@ctam.com.au> you write:
>
> I am using RedHat-5.2 and I don't have any problems.  There might be some problems with RedHad-6.0 and/or RedHat-6.1.  I
> have heard of some people having problems with RedHat-6.x but I think that might be with RTEMS.  Anyway, RedHat-5.2 works
> for me.

RH-6.0 and 6. work fine for me and several of my customers.

> Yes.  I have successfully built glibc-2.1.1 and glibc-2.1.2 with egcs-1.1.2 and binutils-2.9.1.0.19a.
> I have copied all the shared libraries to my nfs root filesystem under /lib.  I still get segmentation faults when I try to
> run the dynamic application.  Arghh !!!  This is so annoying.

Make sure you use ONLY files compiled in your  new  environment,  not
ANY files that might exist from older versions in your NFS tree.

Make sure the shell you are running is statically linked!

The easiest way to test this is to copy all relevant files to  a  new
place (say, /test/bin and /test/lib) and then test with "chroot /test".


Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
"It's when they say 2 + 2 = 5 that I begin to argue."    - Eric Pepke

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cross-compile dynamic apps for mpc860 on ix86
  2000-01-24  3:00                                                         ` Cross-compile dynamic apps for mpc860 on ix86 Brendan J Simon
  2000-01-24  5:03                                                           ` Wolfgang Denk
@ 2000-01-24  6:46                                                           ` dony
  2000-01-24  8:02                                                             ` Wolfgang Denk
  1 sibling, 1 reply; 6+ messages in thread
From: dony @ 2000-01-24  6:46 UTC (permalink / raw)
  To: Brendan.Simon; +Cc: Grant Carter, linuxppc-embedded




Brendan J Simon wrote:

> dony wrote:
>
> > In fact, I have posted ALL howtos (not brief howtos)  that I have done when compiling the cross-compile environment. And
> > these are all stealed from CrossGcc FAQ. See http://www.objsw.com.
> > I do these successfully on SuSE linux (European version), kernel 2.2.13. But the same steps on Redhat linux cannot work
> > and some errors occur. I don't know why and are checking these.
> > Since Redhat linux is widely used by most linux fans, I will research some effective and stable steps on this. I will
> > post to this mail list later when I succeed on Redhat linux.
>
> I am using RedHat-5.2 and I don't have any problems.  There might be some problems with RedHad-6.0 and/or RedHat-6.1.  I
> have heard of some people having problems with RedHat-6.x but I think that might be with RTEMS.  Anyway, RedHat-5.2 works
> for me.

Yes, I have problems with Redhat-6.0.

>
>
> > > He is using egcs-1.1.2, glibc-2.1 and binutils-2.9.1.0.19a.
> > >
> > > I have just managed to cross-compile glibc-2.1.1 and glibc-2.1.2 with egcs-1.1.2.  I haven't tested them out yet but
> > > will do it this week.  I am running with the embedded-2.2.5.tgz kernel and should upgrade to mpc8xx-2.2.13.tgz
> > > kernel.  I assume things should still work with the 2.2.5 kernel and I will let you know soon.
> > >
> > > I couldn't get glibc-2.1.1 nor glibc-2.1.2 to compile using the cpu=860 flag.  I was setting CC="powerpc-linux-gcc
> > > -mcpu=860".
> >
> > I think maybe you should use "export CC=powerpc-linux-gcc" and not use "-mcpu=860". I don't know why, but I do this and
> > succeed.
>
> Yes.  I have successfully built glibc-2.1.1 and glibc-2.1.2 with egcs-1.1.2 and binutils-2.9.1.0.19a.
> I have copied all the shared libraries to my nfs root filesystem under /lib.  I still get segmentation faults when I try to
> run the dynamic application.  Arghh !!!  This is so annoying.

Hi, Brendan:
    Here are some notes:
    1      Make sure you copy all your libraries under $(prefix)/$(target)/lib and $(prefix)/lib/gcc-lib to your target's root
filesystem /lib.
   2        Make sure you keep their property unchangeable. i.e, if a library is symbol link , you must keep it unchangeable
after copying. Especially, libc.so.6 is a symbol link pointing to libc-2.1.so .
   3         Make sure all  these libraries you are copying are generated when buiding your cross-compile environment.
  4          When cross-compiling your test app, you can specify its running share libraries path using "-Wl,--rpath,/lib".
i.e:
               powerpc-linux-gcc -O2 -mcpu=860 -Wl,--rpath,lib -o mytest mytest.c
              An easyest way to test this is to replace your target NFS root filesystem's /bin/sh with the above "mytest" and
reset your board. And running "rpc.nfsd -F -d call" on your x86 host to monitor whether it can run correctly. If not, what file
it cannot find? In my case , First , it can not find "/etc/ld.so.preload" and "/etc/ld.so.cache". then I run "touch
/tftpboot/etc/{ld.so.preload,ld.so.cache}". Then reset. And continue monitoring.
In my case, this time it cannot find some libraries under /usr/local/lib.Copy all the files it cannot find to its proper
place(where rpc.nfsd reports). In fact you can specify its running share libraries path using "-Wl, --rpath, /lib" to avoid
these.
Keep patient and you will find you are succeeding at this moment.

>
>
> I'm using embedded-2.2.5 sourece.  Maybe I should try mpc8xx-2.2.13 or linux-2.2.14 ?

I use mpc8xx-2.2.13. But I think it makes no difference.

>
> Dony, have you modified any of the kernel source code ?

No.

>
>
> Does any body out there in linuxppc-embedded land have a clue as to what could be causing the segfaults ?
> Can someone suggest a way of getting more debugging information.  I'm using nfsd with "-F -d" call options at the moment.

I think this is enough to debug your problem. This is what I use.

>
> I can see the ld.so.1 gets called which causes lots of reads from ld-2.1.2.so and then that's it.  I would expect to get
> calls to libc.so.6 but it never gets that far.

Then where does it go after it accesses ld.so.1?
dony


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cross-compile dynamic apps for mpc860 on ix86
  2000-01-24  6:46                                                           ` dony
@ 2000-01-24  8:02                                                             ` Wolfgang Denk
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2000-01-24  8:02 UTC (permalink / raw)
  To: dony; +Cc: Brendan.Simon, Grant Carter, linuxppc-embedded


In message <388BF52B.213CCD61@huawei.com.cn> dony wrote:
>
>     Here are some notes:
>     1      Make sure you copy all your libraries under $(prefix)/$(target)/lib and $(prefix)/lib/gcc-lib to your target's root
> filesystem /lib.

I don't think you will need the gcc-lib files on your target (as long
as you don't want to compile / linke on the target).

>                powerpc-linux-gcc -O2 -mcpu=860 -Wl,--rpath,lib -o mytest mytest.c
>               An easyest way to test this is to replace your target NFS root filesystem's /bin/sh with the above "mytest" and

Adding "init=<your_path>/mytest" will do as well.

[I don't think it is a good idea to modify files on  the  NFS  server
just for testing things. You might forget to change something back to
the  original state, or in bigger projects there might be other users
trying to use the same NFS server.]

> reset your board. And running "rpc.nfsd -F -d call" on your x86 host to monitor whether it can run correctly. If not, what file
> it cannot find? In my case , First , it can not find "/etc/ld.so.preload" and "/etc/ld.so.cache". then I run "touch
> /tftpboot/etc/{ld.so.preload,ld.so.cache}". Then reset. And continue monitoring.

Again, I don't think this is a good idea. You will be  creating  some
files  that are not really needed. For instance, "/etc/ld.so.preload"
is *NOT* needed at all.

> > Does any body out there in linuxppc-embedded land have a clue as to what could be causing the segfaults ?
> > Can someone suggest a way of getting more debugging information.  I'm using nfsd with "-F -d" call options at the moment.
>
> I think this is enough to debug your problem. This is what I use.

Grrrgh. You cannot really debug anything this way.

For instance, you will never be able to know if a failing attempt  to
open  a  non-existing  file (like "/etc/ld.so.preload") is a critical
error or just a feature that may beuseful  under  some  very  special
circumstances.

> > I can see the ld.so.1 gets called which causes lots of reads from ld-2.1.2.so and then that's it.  I would expect to get
> > calls to libc.so.6 but it never gets that far.
>
> Then where does it go after it accesses ld.so.1?

Good question - do you still claim you can  find  this  out  just  by
looking at the NFS transfers?

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
You young'uns. That was *long* before AltaVista,  DejaNews,  or  even
(gasp) the *Web*! In fact, we typed that thread on steam-powered card
punchers, and shipped it around via Pony Express.
            -- Randal Schwartz in <8cwww1cd0d.fsf@gadget.cscaper.com>

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cross-compile dynamic apps for mpc860 on ix86
       [not found] <388BEE23.A42DFCB5@huawei.com.cn>
@ 2000-01-24  8:02 ` Wolfgang Denk
  2000-01-25  0:02   ` Brendan John Simon
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2000-01-24  8:02 UTC (permalink / raw)
  To: dony; +Cc: Wolfgang Denk, Brendan.Simon, Grant Carter, linuxppc-embedded


Dony,

you did not get my point:

In message <388BEE23.A42DFCB5@huawei.com.cn> you write:
>
> > > Yes.  I have successfully built glibc-2.1.1 and glibc-2.1.2 with egcs-1.1.2 and binutils-2.9.1.0.19a.
> > > I have copied all the shared libraries to my nfs root filesystem under /lib.  I still get segmentation faults when I try to
> > > run the dynamic application.  Arghh !!!  This is so annoying.
> >
> > Make sure you use ONLY files compiled in your  new  environment,  not
> > ANY files that might exist from older versions in your NFS tree.
> >
> > Make sure the shell you are running is statically linked!
>
> Not needed. Both my shell (sash) and my test app can run dynamically.

Then what do you complain  about  segmentation  faults  when  running
dynamically linked applications???

> > The easiest way to test this is to copy all relevant files to  a  new
> > place (say, /test/bin and /test/lib) and then test with "chroot /test".
>
> In a cross-compile environment, It is impossible to do so.  i.e., You can not run any apps for Powerpc on X86 box.

I did not say you should try. Sorry, I thought at  least  *this*  was
obvious.


Ok, once more in detail:

1. Get your PPC target running with the root filesystem mounted  over
   NFS with a known set of working tools (shell, libraries, ...). For
   instance, you can start with the files from the `mbxroot.full.tgz'
   tarball.

2. Put all your new binaries and libraries in  a  separate  directory
   tree.

3. Run a statically linked shell on your PPC  target.  You  may  also
   want to have some more statically linked tools available.

4. Do a "chroot" to your separate directory tree  with  the  binaries
   and  libraries  you  want to test. Try to execute some dynamically
   linked binaries.

5. Fix the problems.

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
I have the simplest tastes.  I am always satisfied with the best.
                                                       -- Oscar Wilde

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cross-compile dynamic apps for mpc860 on ix86
  2000-01-24  8:02 ` Cross-compile dynamic apps for mpc860 on ix86 Wolfgang Denk
@ 2000-01-25  0:02   ` Brendan John Simon
  0 siblings, 0 replies; 6+ messages in thread
From: Brendan John Simon @ 2000-01-25  0:02 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: dony, linuxppc-embedded


Wolfgang Denk wrote:

> > > Make sure the shell you are running is statically linked!
> >
> > Not needed. Both my shell (sash) and my test app can run dynamically.
>
> Then what do you complain  about  segmentation  faults  when  running
> dynamically linked applications???

I think you are confusing Dony and myself.  Dony has got his dynamic binaries going but I am still having problems.  I am about to
compile ALL my tools again.  binutils-2.9.5.0.24, egcs-1.1.2, glibc-2.1.2.  Hopefully I can get gcc-2.95.2 going at some stage but
this is a lower concern at the moment.


> Ok, once more in detail:
>
> 1. Get your PPC target running with the root filesystem mounted  over
>    NFS with a known set of working tools (shell, libraries, ...). For
>    instance, you can start with the files from the `mbxroot.full.tgz'
>    tarball.

I should try this, but I wanted to steer away from the libc-1.99.  I have no technical reason for this but Dan Malek mentions that
he compiles most things statically.  This requires lots of memory and filesystem space.  I assumed from his statements that linking
dynmaically was not advisable or doesn't work.  This must be false as the mbxroot-min.tgz files are dynamically linked.

Brendan Simon.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-01-25  0:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <388BEE23.A42DFCB5@huawei.com.cn>
2000-01-24  8:02 ` Cross-compile dynamic apps for mpc860 on ix86 Wolfgang Denk
2000-01-25  0:02   ` Brendan John Simon
1999-12-31  2:29 Please help me dony
1999-12-30  4:23 ` Brendan J Simon
     [not found]   ` <38704D0B.94438516@huawei.com.cn>
1999-12-30  6:46     ` Brendan J Simon
2000-01-03 11:48       ` Cannot booting the kernel dony
2000-01-04  0:46         ` Brendan J Simon
     [not found]           ` <38715DAE.B6CBC772@huawei.com.cn>
     [not found]             ` <3871572F.FA4E7842@ctam.com.au>
     [not found]               ` <38717C52.ECF1AFFD@huawei.com.cn>
     [not found]                 ` <3871953B.345DDA23@ctam.com.au>
     [not found]                   ` <38754F28.B6B4CE70@huawei.com.cn>
     [not found]                     ` <38754419.20D95C5A@ctam.com.au>
     [not found]                       ` <3876A6E5.3488738B@huawei.com.cn>
     [not found]                         ` <3876C6FD.794BD1BF@ctam.com.au>
     [not found]                           ` <387A87DF.4ED23CA6@huawei.com.cn>
     [not found]                             ` <387A81F3.702B29A2@ctam.com.au>
     [not found]                               ` <387C4D8D.9C058F1C@huawei.com.cn>
     [not found]                                 ` <387D3212.A4E9904F@ctam.com.au>
     [not found]                                   ` <387DAFAF.DB0096C7@huawei.com.cn>
     [not found]                                     ` <387E460F.B007CE56@ctam.com.au>
     [not found]                                       ` <387E7F82.99AF83CE@huawei.com.cn>
     [not found]                                         ` <387E7AF5.A92A6122@ctam.com.au>
     [not found]                                           ` <387E9927.48689C08@huawei.com.cn>
     [not found]                                             ` <387EBEB9.B69B1680@ctam.com.au>
2000-01-14  8:31                                               ` Cross-compile Applications for 860 on x86 dony
2000-01-16  2:01                                                 ` Brendan J Simon
     [not found]                                                   ` <388ABF55.5BD3A031@eng.uct.ac.za>
     [not found]                                                     ` <388B9C86.8970590A@ctam.com.au>
     [not found]                                                       ` <388BA902.B41A2E11@huawei.com.cn>
2000-01-24  3:00                                                         ` Cross-compile dynamic apps for mpc860 on ix86 Brendan J Simon
2000-01-24  5:03                                                           ` Wolfgang Denk
2000-01-24  6:46                                                           ` dony
2000-01-24  8:02                                                             ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).