public inbox for gentoo-embedded@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-embedded] openssl for arm
@ 2005-05-03 20:42 Tim Dodge
  2005-05-03 20:50 ` Mike Frysinger
  0 siblings, 1 reply; 12+ messages in thread
From: Tim Dodge @ 2005-05-03 20:42 UTC (permalink / raw
  To: gentoo-embedded

Hi,

I'm trying to cross compile openssl-0.9.7e-r1 for arm-xscale-linux-uclibc.

It gets as far as crypto/md5 directory, and then chokes on the ASM like so:

making all in crypto/md5...
make[2]: Entering directory
`/var/tmp/portage/openssl-0.9.7e-r1/work/openssl-0.9.7e/crypto/md5'
arm-xscale-linux-uclibc-gcc -I.. -I../.. -I../../include -fPIC
-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H
-DOPENSSL_NO_KRB5 -DL_ENDIAN -DTERMIO    -Wall -Os -pipe -march=armv5te
-mtune=xscale -Wa,--noexecstack -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
-I/tmp/minime/usr/include  -c -o md5_dgst.o md5_dgst.c
arm-xscale-linux-uclibc-gcc -I.. -I../.. -I../../include -fPIC
-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H
-DOPENSSL_NO_KRB5 -DL_ENDIAN -DTERMIO    -Wall -Os -pipe -march=armv5te
-mtune=xscale -Wa,--noexecstack -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
-I/tmp/minime/usr/include  -c -o md5_one.o md5_one.c
(cd asm; /usr/bin/perl md5-586.pl elf -I.. -I../.. -I../../include -fPIC
-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H
-DOPENSSL_NO_KRB5 -DL_ENDIAN -DTERMIO    -Wall -Os -pipe -march=armv5te
-mtune=xscale -Wa,--noexecstack -DSHA1_ASM -DMD5_ASM -DRMD160_ASM >
mx86-elf.s)
arm-xscale-linux-uclibc-gcc -c -I.. -I../.. -I../../include -fPIC
-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H
-DOPENSSL_NO_KRB5 -DL_ENDIAN -DTERMIO    -Wall -Os -pipe -march=armv5te
-mtune=xscale -Wa,--noexecstack -DSHA1_ASM -DMD5_ASM -DRMD160_ASM  -o
asm/mx86-elf.o asm/mx86-elf.s
asm/mx86-elf.s: Assembler messages:
asm/mx86-elf.s:11: Error: alignment too large: 15 assumed
asm/mx86-elf.s:13: Error: unrecognized symbol type ""
asm/mx86-elf.s:15: Error: bad instruction `pushl %esi'
asm/mx86-elf.s:16: Error: bad instruction `pushl %edi'
asm/mx86-elf.s:17: Error: bad instruction `movl 12(%esp),%edi'

and so on, until:

asm/mx86-elf.s:684: Error: bad instruction `popl %esi'
asm/mx86-elf.s:685: Error: bad instruction `ret'
make[2]: *** [asm/mx86-elf.o] Error 1
make[2]: Leaving directory
`/var/tmp/portage/openssl-0.9.7e-r1/work/openssl-0.9.7e/crypto/md5'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory
`/var/tmp/portage/openssl-0.9.7e-r1/work/openssl-0.9.7e/crypto'
make: *** [sub_all] Error 1

I'm completely lost when it comes to assembly, any ideas what I can do
to get this to build?

Tim
-- 
gentoo-embedded@gentoo.org mailing list


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

* Re: [gentoo-embedded] openssl for arm
  2005-05-03 20:42 [gentoo-embedded] openssl for arm Tim Dodge
@ 2005-05-03 20:50 ` Mike Frysinger
  2005-05-04  1:21   ` Yuri Vasilevski
  0 siblings, 1 reply; 12+ messages in thread
From: Mike Frysinger @ 2005-05-03 20:50 UTC (permalink / raw
  To: gentoo-embedded

On Tuesday 03 May 2005 04:42 pm, Tim Dodge wrote:
> I'm trying to cross compile openssl-0.9.7e-r1 for arm-xscale-linux-uclibc.

openssl doesnt cross-compile, there's a bug open about this
-mike
-- 
gentoo-embedded@gentoo.org mailing list


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

* Re: [gentoo-embedded] openssl for arm
  2005-05-03 20:50 ` Mike Frysinger
@ 2005-05-04  1:21   ` Yuri Vasilevski
  2005-05-04  1:30     ` Mike Frysinger
  2005-05-04  9:15     ` Tim Dodge
  0 siblings, 2 replies; 12+ messages in thread
From: Yuri Vasilevski @ 2005-05-04  1:21 UTC (permalink / raw
  To: gentoo-embedded; +Cc: vapier

Hi,

> > I'm trying to cross compile openssl-0.9.7e-r1 for arm-xscale-linux-uclibc.
> 
> openssl doesnt cross-compile, there's a bug open about this

OpenEmbedded (http://openembedded.org/) has a portage
like system for cross-compiling with openssl in it, you
can use it directly or see what patches to apply and
what steps to follow in order to cross-compile openssl.

But I personally preferred to use softgun (en arm
emulator, in portage) with a custom stage I made
with soft-float gcc and uclibc (i used the patches
posted in http://bugs.gentoo.org/show_bug.cgi?id=75585).
And this way I can compile and use openssl + openssh
without any problems.

Yuri.

-- 
gentoo-embedded@gentoo.org mailing list


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

* Re: [gentoo-embedded] openssl for arm
  2005-05-04  1:21   ` Yuri Vasilevski
@ 2005-05-04  1:30     ` Mike Frysinger
  2005-05-04  2:07       ` Yuri Vasilevski
  2005-05-13 17:18       ` Yuri Vasilevski
  2005-05-04  9:15     ` Tim Dodge
  1 sibling, 2 replies; 12+ messages in thread
From: Mike Frysinger @ 2005-05-04  1:30 UTC (permalink / raw
  To: gentoo-embedded

On Tuesday 03 May 2005 09:21 pm, Yuri Vasilevski wrote:
> But I personally preferred to use softgun (en arm
> emulator, in portage) with a custom stage I made
> with soft-float gcc and uclibc (i used the patches
> posted in http://bugs.gentoo.org/show_bug.cgi?id=75585).
> And this way I can compile and use openssl + openssh
> without any problems.

could you do me a favor and write up a little HOWTO for this ?  i'd like to 
make an index of howtos for all the emulators out there 
(qemu/hercules/softgun/etc...)

i wasnt able to figure out how to make softgun work nicely :/
-mike
-- 
gentoo-embedded@gentoo.org mailing list


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

* Re: [gentoo-embedded] openssl for arm
  2005-05-04  1:30     ` Mike Frysinger
@ 2005-05-04  2:07       ` Yuri Vasilevski
  2005-05-04  2:25         ` Mike Frysinger
  2005-05-13 17:18       ` Yuri Vasilevski
  1 sibling, 1 reply; 12+ messages in thread
From: Yuri Vasilevski @ 2005-05-04  2:07 UTC (permalink / raw
  To: gentoo-embedded; +Cc: vapier

Hi!

> > But I personally preferred to use softgun (en arm
> > emulator, in portage) with a custom stage I made
> > with soft-float gcc and uclibc (i used the patches
> > posted in http://bugs.gentoo.org/show_bug.cgi?id=75585).
> > And this way I can compile and use openssl + openssh
> > without any problems.
> 
> could you do me a favor and write up a little HOWTO for this ?  i'd like to 
> make an index of howtos for all the emulators out there 
> (qemu/hercules/softgun/etc...)

I'm going on vacation tomorrow for a week, and after that
i can try to write something. But the problem i see is that
the way I did it, it involves so many steps in hacking many
different things that I'm not sure that it is a good idea
to write about something so unpolished.

But if you want, and there is interest in it we can try
to make it more functional.

> i wasnt able to figure out how to make softgun work nicely :/

The way i did it was:

1.- Patch linux 2.6.8.1 (it was the one used at that time
    by the developer of softgun)
2.- Modify this patched version to register more that 64MB
    of ram and remove watchdog initialization.
    (i can try to (and plan to) make a patch for softgun's
    patch to linux 2.6.10)
3.- Modify uclibc's build root to build soft-float gcc and
    uclibc with the patches from that bug report.
4.- boot to softguns image, mount over nfs my root and
    chroot to it. and there build python and portage by
    hand. (after that i found a better way to do this step
    outlined in:
    http://dev.gentoo.org/~solar/uclibc/uclibc.txt)
5.- In this chrooted environment bootstrap gentoo.
6.- emerge system
7.- emerge openssh vixie-cron syslog-ng devfsd ...
8.- build another custom kernel to boot from nfs,
    with devfs, preemptive and some another modifications.
9.- boot to my arm gentoo directly over nfs

The problem I'm having now is that i sometimes get
segmentation faults that are reported by softgun
as "Alignment Problem in Load/Store Multiple".
And the things is that they happen in deterministic
manner on programs that work fine when called by hand.
And so far my best guess is that it may be corrected
when I will move to the kernel that is used in the
development of softgun (i.e 2.6.10)

Let me know about your thoughts about the how-to
and the steps I outlined.

Yuri.

-- 
gentoo-embedded@gentoo.org mailing list


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

* Re: [gentoo-embedded] openssl for arm
  2005-05-04  2:07       ` Yuri Vasilevski
@ 2005-05-04  2:25         ` Mike Frysinger
  2005-05-04  3:05           ` Yuri Vasilevski
  0 siblings, 1 reply; 12+ messages in thread
From: Mike Frysinger @ 2005-05-04  2:25 UTC (permalink / raw
  To: gentoo-embedded

On Tuesday 03 May 2005 10:07 pm, Yuri Vasilevski wrote:
> I'm going on vacation tomorrow for a week, and after that
> i can try to write something. But the problem i see is that
> the way I did it, it involves so many steps in hacking many
> different things that I'm not sure that it is a good idea
> to write about something so unpolished.
>
> But if you want, and there is interest in it we can try
> to make it more functional.

i would be interested :)

> > i wasnt able to figure out how to make softgun work nicely :/
>
> The way i did it was:
>
> 1.- Patch linux 2.6.8.1 (it was the one used at that time
>     by the developer of softgun)
> 2.- Modify this patched version to register more that 64MB
>     of ram and remove watchdog initialization.
>     (i can try to (and plan to) make a patch for softgun's
>     patch to linux 2.6.10)

this would be good to send to the softgun maintainer

> 3.- Modify uclibc's build root to build soft-float gcc and
>     uclibc with the patches from that bug report.

hmm, uclibc's buildroot should be fine with softfloat ... if it is not and if 
you can summarize what you needed to do here, i have commit access to uClibc 
so i can fix up buildroot

> 4.- boot to softguns image, mount over nfs my root and
>     chroot to it. and there build python and portage by
>     hand. (after that i found a better way to do this step
>     outlined in:
>     http://dev.gentoo.org/~solar/uclibc/uclibc.txt)

i recall not being able to make the networking happy ... but i probably just 
did something stupid :)

> 5.- In this chrooted environment bootstrap gentoo.
> 6.- emerge system
> 7.- emerge openssh vixie-cron syslog-ng devfsd ...
> 8.- build another custom kernel to boot from nfs,
>     with devfs, preemptive and some another modifications.
> 9.- boot to my arm gentoo directly over nfs

i have some real armeb hardware (thanks to the nslu2 project for the 
donation !) so i already have this stuff working :)
-mike
-- 
gentoo-embedded@gentoo.org mailing list


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

* Re: [gentoo-embedded] openssl for arm
  2005-05-04  2:25         ` Mike Frysinger
@ 2005-05-04  3:05           ` Yuri Vasilevski
  0 siblings, 0 replies; 12+ messages in thread
From: Yuri Vasilevski @ 2005-05-04  3:05 UTC (permalink / raw
  To: gentoo-embedded; +Cc: vapier

Hi,

On Tue, 3 May 2005 22:25:28 -0400
Mike Frysinger <vapier@gentoo.org> wrote:

> On Tuesday 03 May 2005 10:07 pm, Yuri Vasilevski wrote:
> > I'm going on vacation tomorrow for a week, and after that
> > i can try to write something. But the problem i see is that
> > the way I did it, it involves so many steps in hacking many
> > different things that I'm not sure that it is a good idea
> > to write about something so unpolished.
> >
> > But if you want, and there is interest in it we can try
> > to make it more functional.
> 
> i would be interested :)
> 
> > > i wasnt able to figure out how to make softgun work nicely :/
> >
> > The way i did it was:
> >
> > 1.- Patch linux 2.6.8.1 (it was the one used at that time
> >     by the developer of softgun)
> > 2.- Modify this patched version to register more that 64MB
> >     of ram and remove watchdog initialization.
> >     (i can try to (and plan to) make a patch for softgun's
> >     patch to linux 2.6.10)
> 
> this would be good to send to the softgun maintainer

As far as i understand he tries to make the kernel for
the specific board hi made the emulator. But i'm unsure
about that.

> > 3.- Modify uclibc's build root to build soft-float gcc and
> >     uclibc with the patches from that bug report.
> 
> hmm, uclibc's buildroot should be fine with softfloat ... if it is not and if 
> you can summarize what you needed to do here, i have commit access to uClibc 
> so i can fix up buildroot

The problem is that uclibc uses libfloat for softfloat,
which is 10x slower that Nicolas' patch (see benchmarks
in my bug report) and that is the reason i went this
process.

But i think this need extensive testing before changing
the whole buildroot behavior.

Off-Topic: The only thing that i think should be changed
for now in uclibc is with respect to:
http://bugs.uclibc.org/view.php?id=235
witch is an actual bug in uclibc.

> > 4.- boot to softguns image, mount over nfs my root and
> >     chroot to it. and there build python and portage by
> >     hand. (after that i found a better way to do this step
> >     outlined in:
> >     http://dev.gentoo.org/~solar/uclibc/uclibc.txt)
> 
> i recall not being able to make the networking happy ... but i probably just 
> did something stupid :)

If you want we can check this latter in another thread ;-)

> > 5.- In this chrooted environment bootstrap gentoo.
> > 6.- emerge system
> > 7.- emerge openssh vixie-cron syslog-ng devfsd ...
> > 8.- build another custom kernel to boot from nfs,
> >     with devfs, preemptive and some another modifications.
> > 9.- boot to my arm gentoo directly over nfs
> 
> i have some real armeb hardware (thanks to the nslu2 project for the 
> donation !) so i already have this stuff working :)

Again, check my benchmarks at gentoo's bug report 75585 :-D

Yuri.

-- 
gentoo-embedded@gentoo.org mailing list


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

* Re: [gentoo-embedded] openssl for arm
  2005-05-04  1:21   ` Yuri Vasilevski
  2005-05-04  1:30     ` Mike Frysinger
@ 2005-05-04  9:15     ` Tim Dodge
  1 sibling, 0 replies; 12+ messages in thread
From: Tim Dodge @ 2005-05-04  9:15 UTC (permalink / raw
  To: gentoo-embedded

Quoting Yuri Vasilevski <yvasilev@duke.math.cinvestav.mx>:

> Hi,
>
> But I personally preferred to use softgun (en arm
> emulator, in portage) with a custom stage I made
> with soft-float gcc and uclibc (i used the patches
> posted in http://bugs.gentoo.org/show_bug.cgi?id=75585).
> And this way I can compile and use openssl + openssh
> without any problems.
>
> Yuri.

Thanks for the info, I'll check it out.

I think that GCC 3.4 has the ASM soft-float stuff built in (although I
still needed a couple of small patches from openembedded to get it to
work).

Tim

-- 
gentoo-embedded@gentoo.org mailing list


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

* Re: [gentoo-embedded] openssl for arm
  2005-05-04  1:30     ` Mike Frysinger
  2005-05-04  2:07       ` Yuri Vasilevski
@ 2005-05-13 17:18       ` Yuri Vasilevski
  2005-05-15 17:39         ` Tim Dodge
  1 sibling, 1 reply; 12+ messages in thread
From: Yuri Vasilevski @ 2005-05-13 17:18 UTC (permalink / raw
  To: gentoo-embedded; +Cc: vapier

Hi,

Mike Frysinger <vapier@gentoo.org> wrote:
> could you do me a favor and write up a little HOWTO for this ?  i'd like to 
> make an index of howtos for all the emulators out there 
> (qemu/hercules/softgun/etc...)

I'm back form my vacation, so i'll try to adapt my patch to
softgun's patch to linux 2.6.10 and then write the HOWTO.

Yuri.

-- 
gentoo-embedded@gentoo.org mailing list


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

* Re: [gentoo-embedded] openssl for arm
  2005-05-13 17:18       ` Yuri Vasilevski
@ 2005-05-15 17:39         ` Tim Dodge
  2005-05-15 18:21           ` Yuri Vasilevski
  0 siblings, 1 reply; 12+ messages in thread
From: Tim Dodge @ 2005-05-15 17:39 UTC (permalink / raw
  To: gentoo-embedded

Yuri Vasilevski wrote:
> Hi,
> 
> Mike Frysinger <vapier@gentoo.org> wrote:
> 
>>could you do me a favor and write up a little HOWTO for this ?  i'd like to 
>>make an index of howtos for all the emulators out there 
>>(qemu/hercules/softgun/etc...)
> 
> 
> I'm back form my vacation, so i'll try to adapt my patch to
> softgun's patch to linux 2.6.10 and then write the HOWTO.
> 
> Yuri.

Hi Yuri,

I don't suppose you would mind putting a copy of your softgun image
somewhere it could be downloaded?

I've tried using the image at sourceforge, but running 'emerge' always
crashes it, I'm assuming it runs out of memory.

Cheers,
Tim
-- 
gentoo-embedded@gentoo.org mailing list


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

* Re: [gentoo-embedded] openssl for arm
  2005-05-15 17:39         ` Tim Dodge
@ 2005-05-15 18:21           ` Yuri Vasilevski
  2005-05-15 18:50             ` Tim Dodge
  0 siblings, 1 reply; 12+ messages in thread
From: Yuri Vasilevski @ 2005-05-15 18:21 UTC (permalink / raw
  To: gentoo-embedded; +Cc: timmy

Hi,

On Sun, 15 May 2005 18:39:40 +0100
Tim Dodge <timmy@invisibles.org> wrote:

> I don't suppose you would mind putting a copy of your softgun image
> somewhere it could be downloaded?

I intend to write two HOWTOs, first one on how to
configure and run softgun on Gentoo (I hope to post
this one in a day or so), and another one on how to
bootstrap and run Gentoo on softgun (this one will
take a little bit longer).

> I've tried using the image at sourceforge, but running 'emerge' always
> crashes it, I'm assuming it runs out of memory.

I think that this is probably because souftgun does not
implement any math coprocessor nor can give exceptions
about that to the kernel, so you can not run anything
that is not softfloat compiled (like Gentoo's stages)

Yuri.

-- 
gentoo-embedded@gentoo.org mailing list


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

* Re: [gentoo-embedded] openssl for arm
  2005-05-15 18:21           ` Yuri Vasilevski
@ 2005-05-15 18:50             ` Tim Dodge
  0 siblings, 0 replies; 12+ messages in thread
From: Tim Dodge @ 2005-05-15 18:50 UTC (permalink / raw
  To: gentoo-embedded

Yuri Vasilevski wrote:

> I intend to write two HOWTOs, first one on how to
> configure and run softgun on Gentoo (I hope to post
> this one in a day or so), and another one on how to
> bootstrap and run Gentoo on softgun (this one will
> take a little bit longer).

That'd be great.

>>I've tried using the image at sourceforge, but running 'emerge' always
>>crashes it, I'm assuming it runs out of memory.
> 
> 
> I think that this is probably because souftgun does not
> implement any math coprocessor nor can give exceptions
> about that to the kernel, so you can not run anything
> that is not softfloat compiled (like Gentoo's stages)
> 
> Yuri.

I've used uclibc's buildroot to build a softfloat root, including
portage and python, and am able to nfs mount it and chroot into it.

Running emerge always gives me something like this:

[root@hello /]# emerge portage
oom-killer: gfp_mask=0x1d2
DMA per-cpu:
cpu 0 hot: low 2, high 6, batch 1
cpu 0 cold: low 0, high 2, batch 1
Normal per-cpu: empty
HighMem per-cpu: empty

Free pages:         256kB (0kB HighMem)
Active:1786 inactive:864 dirty:0 writeback:0 unstable:0 free:64 slab:504
mapped:1370 pagetables:23
DMA free:256kB min:128kB low:256kB high:384kB active:7144kB
inactive:3456kB present:16384kB
protections[]: 64 64 64
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB
protections[]: 0 0 0
HighMem free:0kB min:128kB low:256kB high:384kB active:0kB inactive:0kB
present:0kB
protections[]: 0 0 0
DMA: 0*4kB 0*8kB 2*16kB 1*32kB 1*64kB 1*128kB 0*256kB 0*512kB 0*1024kB
0*2048kB 0*4096kB = 256kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Out of Memory: Killed process 51 (emerge).
Terminated

Anyway, I look forward to reading your HOWTOs.

Cheers,
Tim
-- 
gentoo-embedded@gentoo.org mailing list


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

end of thread, other threads:[~2005-05-15 18:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-03 20:42 [gentoo-embedded] openssl for arm Tim Dodge
2005-05-03 20:50 ` Mike Frysinger
2005-05-04  1:21   ` Yuri Vasilevski
2005-05-04  1:30     ` Mike Frysinger
2005-05-04  2:07       ` Yuri Vasilevski
2005-05-04  2:25         ` Mike Frysinger
2005-05-04  3:05           ` Yuri Vasilevski
2005-05-13 17:18       ` Yuri Vasilevski
2005-05-15 17:39         ` Tim Dodge
2005-05-15 18:21           ` Yuri Vasilevski
2005-05-15 18:50             ` Tim Dodge
2005-05-04  9:15     ` Tim Dodge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox