[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] Re: [uClinux-dev] Ruby on uclinux



Hi, John,

Thanks a lot for your advice.  I am doing a project of building a
platform that can emulate wide area distributed applications with a
number of FPGAs running CPUs like microblaze.  The emulation is slow,
but we hope we can measure the interesting traffic patterns in the
network.  Thus being able to run more software is more important than
performance / memory usage to us.   If you are interested in our
project, you can find more details in my advisor's talk
http://radlab.cs.berkeley.edu/w/uploads/1/15/RAMPinRADS.pdf

Ruby is configured with ./configure, and I used CC=/path
to/ucfront-gcc ,  target=mb and --with-static-linked-ext.  I have to
modify config.sub to make it recognize mb-linux (just adding the
names, and set default os of mb to be linux -- I am I right in doing
this?)

I tried to modified the resulting Makefile a little bit to let the
CFLAGS etc to be appened from the top level Makefile.  I also build
the host miniruby required to run the ruby setup scripts before hand,
similar to the python build process.

The build process can be completed and the resulting ruby executable is
ruby: BFLT executable - version 4 ram

However, when I run it, I get
Allocation of length 1099927 from process 77 failed
Free pages:      249484kB (     0kB HighMem)
Zone:DMA freepages:249484kB
Zone:Normal freepages:     0kB
Zone:HighMem freepages:     0kB
( Active: 278, inactive: 73, free: 62371 )
1*4kB 1*8kB 0*16kB 0*32kB 0*64kB 1*128kB 0*256kB 1*512kB 1*1024kB
121*2048kB = 249484kB)
= 0kB)
= 0kB)
Unable to allocate RAM for process text/data, errno 12

Do you know what happened?  I think I encountered similar problems
when I try to build a few other applications.  Here is part of my make
file, and resulting parameters to ld.

Thanks in advance,

Wei

SHELL = /bin/sh

#### Start of system configuration section. ####

srcdir = .
VPATH = $(srcdir)/missing

#CC = /home/xuw/uClinux-dist/tools/ucfront-gcc mb-gcc
YACC = bison -y
PURIFY =
AUTOCONF = autoconf

MKFILES = Makefile

prefix = /home/xuw/uClinux-dist/nfsroot
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
arch = mb-uclinux
sitearch = mb-uclinux
sitedir = ${prefix}/lib/ruby/site_ruby
DESTDIR = $(prefix)

TESTUI = console
TESTS =
RDOCTARGET =

EXTOUT = .ext
RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system

empty =
OUTFLAG = -o $(empty)
CFLAGS += -g -O2  -DRUBY_EXPORT
CPPFLAGS += -I. -I$(srcdir)
#LDFLAGS +=  $(CFLAGS)  -rdynamic -Wl,-export-dynamic
LDFLAGS +=  $(CFLAGS) -Wl,-export-dynamic
EXTLDFLAGS +=
XLDFLAGS +=  -L. $(EXTLDFLAGS)
EXTLIBS +=
LIBS += -lcrypt -lm  $(EXTLIBS)
MISSING =  memcmp$U.o
LDSHARED = ${CC} -shared
DLDFLAGS =  $(EXTLDFLAGS)
SOLIBS =
MAINLIBS =
MINIOBJS =

RUBY_INSTALL_NAME=ruby
RUBY_SO_NAME=$(RUBY_INSTALL_NAME)
EXEEXT =
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
RUBY = $(RUBY_INSTALL_NAME)
### MINIRUBY = ruby -I/home/xuw/uClinux-dist/user/ruby -rfake
MINIRUBY = ./hostminiruby -I/home/xuw/uClinux-dist/user/ruby -rfake
RUNRUBY = $(MINIRUBY) -I`cd $(srcdir)/lib; pwd`

#### End of system configuration section. ####

MAJOR= 1
MINOR= 8
TEENY= 4

LIBRUBY_A     = lib$(RUBY_SO_NAME)-static.a
LIBRUBY_SO    = lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)
LIBRUBY_ALIASES= lib$(RUBY_SO_NAME).so
LIBRUBY       = $(LIBRUBY_A)
LIBRUBYARG    = $(LIBRUBYARG_STATIC)
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
LIBRUBYARG_SHARED = -Wl,-R -Wl,$(libdir) -L$(libdir) -L.

PREP          = fake.rb
ARCHFILE      =
SETUP         =
EXTSTATIC     = static

RM            = rm -f
NM            =
#AR            = mb-ar
#ARFLAGS       = rcu
#RANLIB        = mb-ranlib

OBJEXT        = o
MANTYPE       = doc

#### End of variables

-----------------------------------------------------------------------------------------------------
The final ld command:

ucfront-gcc mb-gcc  -Wl,-elf2flt -Os -g -fomit-frame-pointer
-fno-common -fno-builtin -Wall   -msoft-float -mno-xl-soft-mul
-mxl-soft-div  -DEMBED -Dlinux -D__linux__ -Dunix -D__uClinux__ -g -O2
 -DRUBY_EXPORT  -Wl,-export-dynamic -Os -g -fomit-frame-pointer
-fno-common -fno-builtin -Wall   -msoft-float -mno-xl-soft-mul
-mxl-soft-div  -DEMBED -Dlinux -D__linux__ -Dunix -D__uClinux__ -g -O2
 -DRUBY_EXPORT  -g -O2  -DRUBY_EXPORT  -Wl,-export-dynamic -L.  
main.o  -lruby-static -lcrypt -lm  -lutil -lz -o ruby

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/