[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Cross-compiling 1.9.1-p0 to bfin-uclinux

Aaron Gage

5/4/2009 7:20:00 PM

Greetings --

I am trying to see whether I can build ruby to run on an Analog Devices
Blackfin processor. The toolchain (with bfin-uclinux-gcc being the
compiler) is available here:

http://blackfin.uclinux.org/gf/project/too...

...using the latest 2008R1.5_RC14 release of both the toolchain and
libraries, where the build machine is an i686 running CentOS 5.3.

This will not cross-compile out of the box, but I'm not sure how much
help it needs to finish. I am using the following command line to
configure:

ac_cv_func_getpgrp_void=no ac_cv_func_setpgrp_void=yes ./configure --host=bfin-uclinux

configure completes without complaint. Everything seems to compile
(bfin-uclinux-gcc is used as expected) but it fails when trying to
create the encdb.so file. It looks to me like this step is using the
wrong linker (ld instead of bfin-uclinux-ld). The exact error is at the
bottom of this message.

I tried this with 1.8.7-p72 and it also failed (I had to tweak process.c
for something that got fixed in 1.9.1-p0 and copy in a config.sub from
another bfin-uclinux project port) but in a different place
(extmk.rb:357 undefined method '<<' for nil:NilClass).

Some Google searches show that others have had success (1.8.6-p114 and
-p287 are mentioned). However, I'd like to use the latest and greatest
if possible -- are there any known solutions for 1.9.1?

Error log is below (only the end is shown, I can the full build log if
it is needed). Any help would be appreciated.

bfin-uclinux-gcc -O2 -g -Wall -Wno-parentheses -I.
-I.ext/include/bfin-uclinux -I./include -I. -DRUBY_EXPORT -o tgamma.o
-c ./missing/tgamma.c
bfin-uclinux-gcc -O2 -g -Wall -Wno-parentheses -I.
-I.ext/include/bfin-uclinux -I./include -I. -DRUBY_EXPORT -o dmyext.o
-c dmyext.c
bfin-uclinux-ar rcu libruby-static.a dln.o encoding.o prelude.o array.o
bignum.o class.o compar.o complex.o dir.o enum.o enumerator.o error.o
eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o
numeric.o object.o pack.o parse.o process.o random.o range.o rational.o
re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o
ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o
time.o transcode.o util.o variable.o version.o compile.o debug.o iseq.o
vm.o vm_dump.o thread.o cont.o ascii.o us_ascii.o unicode.o utf_8.o
newline.o memcmp.o tgamma.o dmyext.o
ruby -I/tmp/ruby-1.9.1-p0 -rfake ./tool/generic_erb.rb -c -o encdb.h
/template/encdb.h.tmpl ./enc enc
encdb.h unchanged
make -f enc.mk RUBY="ruby -I/tmp/ruby-1.9.1-p0 -rfake " MINIRUBY="ruby
-I/tmp/ruby-1.9.1-p0 -rfake " enc
make[1]: Entering directory `/tmp/ruby-1.9.1-p0'
bfin-uclinux-gcc -I. -I.ext/include/bfin-uclinux -I./include -I.
-D_FILE_OFFSET_BITS=64 -DONIG_ENC_REGISTER=rb_enc_register -fPIC -O2
-g -Wall -Wno-parentheses -o enc/encdb.o -c ./enc/encdb.c

Here is where I think the problem is (the .o was created with
bfin-uclinux-gcc, now trying to link with normal ld):

ld -o .ext/bfin-uclinux/enc/encdb.so enc/encdb.o -L. -L. -L.
-lpthread -lrt -lcrypt -lm
ld: enc/encdb.o: Relocations in generic ELF (EM: 106)
ld: enc/encdb.o: Relocations in generic ELF (EM: 106)
ld: enc/encdb.o: Relocations in generic ELF (EM: 106)
ld: enc/encdb.o: Relocations in generic ELF (EM: 106)
ld: enc/encdb.o: Relocations in generic ELF (EM: 106)
ld: enc/encdb.o: Relocations in generic ELF (EM: 106)
enc/encdb.o: could not read symbols: File in wrong format
make[1]: *** [.ext/bfin-uclinux/enc/encdb.so] Error 1
make[1]: Leaving directory `/tmp/ruby-1.9.1-p0'
make: *** [enc] Error 2
--
Posted via http://www.ruby-....

8 Answers

Brian Candler

5/5/2009 10:44:00 AM

0

Aaron Gage wrote:
> Some Google searches show that others have had success (1.8.6-p114 and
> -p287 are mentioned). However, I'd like to use the latest and greatest
> if possible -- are there any known solutions for 1.9.1?

ruby 1.9 is *much* bigger than ruby 1.8, so for embedded applications,
I'd stick with 1.8 (pref 1.8.6) unless you really need 1.9 features.

openwrt has a working ruby 1.8.6 port. I don't know what the status is
of openwrt with blackfin, but a google search suggests maybe someone is
working on it:
https://dev.openwrt.org/changeset/7306/trunk/too...
--
Posted via http://www.ruby-....

Aaron Gage

5/5/2009 3:20:00 PM

0

Brian Candler wrote:
> ruby 1.9 is *much* bigger than ruby 1.8, so for embedded applications,
> I'd stick with 1.8 (pref 1.8.6) unless you really need 1.9 features.
>
> openwrt has a working ruby 1.8.6 port. I don't know what the status is
> of openwrt with blackfin, but a google search suggests maybe someone is
> working on it:
> https://dev.openwrt.org/changeset/7306/trunk/too...

Thanks for the info about 1.9. I have gone back and tried to build a
couple of 1.8.6 versions, but I still seem to be getting stuck. I am
consistently getting this error:

[blackfin@localhost ruby-1.8.6-p368]$ make
rbconfig.rb unchanged
/lib/fileutils.rb:1029:in `utime': can't convert NilClass into time
(TypeError)
from ./lib/fileutils.rb:1029:in `touch'
from ./lib/fileutils.rb:1026:in `each'
from ./lib/fileutils.rb:1026:in `touch'
from ./mkconfig.rb:188
make: *** [.rbconfig.time] Error 1

I checked out p287 (after reading
http://groups.google.com/group/ruby-talk-google/browse_thread/thread/26dadccab34f...)
and it reports the same error.

Since this build machine is CentOS 5.3, I have an older version of ruby
(1.8.5) installed. However, I can build 1.8.6-p287 (from Subversion),
1.8.6-p368, and 1.9.1-p0 on this machine natively without any difficulty
(./configure && make && make test). This tells me that the above error
(File.utime returning nil) is not necessarily due to the system's ruby
version being out of date (even though it is a ruby script that fails).

I will keep plugging away at it. The link to the OpenWRT project
doesn't give me any ideas about this particular error, but I'll see if I
can figure out what file mkconfig.rb is failing to find.
--
Posted via http://www.ruby-....

Aaron Gage

5/5/2009 4:00:00 PM

0

Well, I've gotten it to build. I have not yet tested this on the target
processor yet, but first things first.

The steps I had to follow are:

1) Get a copy of ruby-1.8.6-p368 and extract it if necessary

2) cd into the ruby-1.8.6-p368 directory and copy the attached patch
into it

3) Apply the attached patch by doing this:
patch -p0 < ruby-1.8.6-p368-bfin-uclinux.patch

4) configure as follows:

ac_cv_func_getpgrp_void=no ac_cv_func_setpgrp_void=yes ./configure --host=bfin-uclinux

5) make (assuming that bfin-uclinux-gcc is in the PATH and the libraries
are installed properly)

The resulting executable is about 2.3MB which isn't too bad. I still
need to try to convert it to the BFLT format, but I can work on that
next.

As for the patch, I had to remove three lines from mkconfig.rb
($timestamp was undefined), copy in the config.sub from the 1.9.1-p0
distribution, and set all of the extensions to build statically.

Hopefully this will be of use to someone else.

Attachments:
http://www.ruby-...attachment/3656/ruby-1.8.6-p368-bfin-ucl...

--
Posted via http://www.ruby-....

Nobuyoshi Nakada

5/6/2009 1:14:00 AM

0

Hi,

At Wed, 6 May 2009 00:19:45 +0900,
Aaron Gage wrote in [ruby-talk:335822]:
> [blackfin@localhost ruby-1.8.6-p368]$ make
> rbconfig.rb unchanged
> ./lib/fileutils.rb:1029:in `utime': can't convert NilClass into time
> (TypeError)
> from ./lib/fileutils.rb:1029:in `touch'
> from ./lib/fileutils.rb:1026:in `each'
> from ./lib/fileutils.rb:1026:in `touch'
> from ./mkconfig.rb:188
> make: *** [.rbconfig.time] Error 1

r14741 needs to get backported to 1.8.6.

--
Nobu Nakada

news

6/10/2014 9:13:00 AM

0

On Tue, 10 Jun 2014 07:33:25 +0000 (UTC), mm <mm2005@bigfoot.com>
wrote:

>On Mon, 9 Jun 2014 22:37:23 +0000 (UTC), "Evertjan."
><exxjxw.hannivoort@inter.nl.net> wrote:
>
>>Shelly <sheldonlg@thevillages.net> wrote on 09 jun 2014 in
>>soc.culture.jewish.moderated:
>>
>>> On 6/9/2014 3:03 PM, Evertjan. wrote:
>>>> mm <mm2005@bigfoot.com> wrote on 09 jun 2014 in
>>>> soc.culture.jewish.moderated:
>>>>
>>>>>> When saying "our" and not meaning the NG,
>>>>>> one should specify the context.
>>>>>
>>>>> Others can always ask. As you did.
>>>>
>>>> True.
>>>>
>>>> However, you only can when the posting is recent.
>>>
>>> Why? So long as the poster to whom you are responding still posts here
>>> (so that you can get an answer), what is stopping you from asking about
>>> an old post? If that poster is not here any longer, what is preventing
>>> you from _asking_?
>>
>>True, but very very ineffective.
>>
>>I maintain that, if a poster has any other meaning for "we" than the
>>collective membership of the newsgroup, he/she should specify.
>
>What about all the other hundreds of words and innumerable sentences
>that will not be clear to every reader?
>
>When I tried harder to take away any uncertainty of meaning from my
>posts, they got so long people complained about the length.
>
>>Since this collectivity does not own soldiers, well ...
>
>....well then we know the "our" didn't refer to scjm.
>
>Who all it actually referred to doesn't seem very important to me, since
>we know that "our" included the writer, Topaz. Who else she was
>including a) doesnt' seem so important to me, and b) could only be
>people in the USA or a subset of them, since it's the USA whose army he
>is in.

It sounds like you're arguing with someone who is being deliberately
obtuse. Given that most of the posters here are US-based, it wouldn't
have taken rocket surgery to guess what "our" meant.

--
Francis Xavier Turlough
University of the Witwatersrand
Johannesburg
South Africa

sheldonlg

6/10/2014 1:09:00 PM

0

On 6/9/2014 6:37 PM, Evertjan. wrote:
> Shelly <sheldonlg@thevillages.net> wrote on 09 jun 2014 in
> soc.culture.jewish.moderated:
>
>> On 6/9/2014 3:03 PM, Evertjan. wrote:
>>> mm <mm2005@bigfoot.com> wrote on 09 jun 2014 in
>>> soc.culture.jewish.moderated:
>>>
>>>>> When saying "our" and not meaning the NG,
>>>>> one should specify the context.
>>>>
>>>> Others can always ask. As you did.
>>>
>>> True.
>>>
>>> However, you only can when the posting is recent.
>>
>> Why? So long as the poster to whom you are responding still posts here
>> (so that you can get an answer), what is stopping you from asking about
>> an old post? If that poster is not here any longer, what is preventing
>> you from _asking_?
>
> True, but very very ineffective.
>
> I maintain that, if a poster has any other meaning for "we" than the
> collective membership of the newsgroup, he/she should specify.
>
> Since this collectivity does not own soldiers, well ...

.....and, as I pointed out before, when the situation, because of context
and knowledge of the posters warrants it, why belabor the obvious?
Thus questioning it becomes much less a quest for information than a
satisfaction of some inner need. In this particular case:

1 - The subject was the US (United States, for clarity) exchange of five
prisoners for one US (again United States) soldier.
2 - The author was topaz who has a long history in this news group and
has clearly been identified as a US (once again, United States) citizen.

So, for anyone in this news group with even a modicum of intelligence,
the answer as to who "we" and "our" meant should have been as obvious as
the nose on his/her face. Since you obviously have more than a mere
modicum of intelligence, I have to conclude (by Logic 101) that you did
this to satisfy some (none too flattering) inner need and not to gain
information. Perhaps you can come up with a third motivation?

--
Shelly

sheldonlg

6/10/2014 1:12:00 PM

0

On 6/10/2014 5:13 AM, news wrote:
> On Tue, 10 Jun 2014 07:33:25 +0000 (UTC), mm <mm2005@bigfoot.com>
> wrote:
>
>> On Mon, 9 Jun 2014 22:37:23 +0000 (UTC), "Evertjan."
>> <exxjxw.hannivoort@inter.nl.net> wrote:
>>
>>> Shelly <sheldonlg@thevillages.net> wrote on 09 jun 2014 in
>>> soc.culture.jewish.moderated:
>>>
>>>> On 6/9/2014 3:03 PM, Evertjan. wrote:
>>>>> mm <mm2005@bigfoot.com> wrote on 09 jun 2014 in
>>>>> soc.culture.jewish.moderated:
>>>>>
>>>>>>> When saying "our" and not meaning the NG,
>>>>>>> one should specify the context.
>>>>>>
>>>>>> Others can always ask. As you did.
>>>>>
>>>>> True.
>>>>>
>>>>> However, you only can when the posting is recent.
>>>>
>>>> Why? So long as the poster to whom you are responding still posts here
>>>> (so that you can get an answer), what is stopping you from asking about
>>>> an old post? If that poster is not here any longer, what is preventing
>>>> you from _asking_?
>>>
>>> True, but very very ineffective.
>>>
>>> I maintain that, if a poster has any other meaning for "we" than the
>>> collective membership of the newsgroup, he/she should specify.
>>
>> What about all the other hundreds of words and innumerable sentences
>> that will not be clear to every reader?
>>
>> When I tried harder to take away any uncertainty of meaning from my
>> posts, they got so long people complained about the length.
>>
>>> Since this collectivity does not own soldiers, well ...
>>
>> ....well then we know the "our" didn't refer to scjm.
>>
>> Who all it actually referred to doesn't seem very important to me, since
>> we know that "our" included the writer, Topaz. Who else she was
>> including a) doesnt' seem so important to me, and b) could only be
>> people in the USA or a subset of them, since it's the USA whose army he
>> is in.
>
> It sounds like you're arguing with someone who is being deliberately
> obtuse. Given that most of the posters here are US-based, it wouldn't
> have taken rocket surgery to guess what "our" meant.

Exactly. Yes, we also agree on this one.

--
Shelly

news

6/10/2014 1:32:00 PM

0

On Mon, 9 Jun 2014 00:39:45 +0000 (UTC), mm <mm2005@bigfoot.com>
wrote:

>On Mon, 9 Jun 2014 00:30:49 +0000 (UTC), "Evertjan."
><exxjxw.hannivoort@inter.nl.net> wrote:
>
>>mm <mm2005@bigfoot.com> wrote on 09 jun 2014 in
>>soc.culture.jewish.moderated:
>>
>>> On Sun, 8 Jun 2014 21:51:32 +0000 (UTC), "Evertjan."
>>> <exxjxw.hannivoort@inter.nl.net> wrote:
>>>
>>>>topazgalaxy <topazgalaxy@gmail.com> wrote on 08 jun 2014 in
>>>>soc.culture.jewish.moderated:
>>>>
>>>>>> > they may not have been there to
>>>>>> > swap at all for our soldier.
>>>>>>
>>>>>> Why is he "your" soldier?
>>>>
>>>>> My use of the word "our" is referring to an American soldier
>>>>
>>>>How strange imply that in an NG.
>>>>How were we to know that?
>>>
>>> FWIW, I knew what she meant. She didn't mean the newsgroup's
>>> solider, or the Jews' solider, or her county's soldier, and probably not
>>> the soldier of her and her parents, and all that was left was her
>>> country's solider. As an American, I'd call him "our soldier" too.
>>
>>Shouldn't we be hinted that you are an American first?
>>Explicitly in the text or in the signature?
>
>Me? I can't count the number of times I've said I live in Baltimore.
>
>But I started my reply with "FWIW". If it wasn't worth anything, so be
>it.

Are any of them worth anything?

--
Francis Xavier Turlough
University of the Witwatersrand
Johannesburg
South Africa