2009-03-12 09:51:17     bash on blackfin

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2009-03-12 09:51:17     bash on blackfin

Tihomir Culjaga (CROATIA)

Message: 70865   

 

hello,

 

 

 

i'm trying to compile bash for blackfin and im having some issues

 

 

 

# OPTIMIZE="-O4" ASTCFLAGS="-g -mfdpic -mfast-fp -ffast-math -D__FIXED_PT__ -D__BLACKFIN__ -I/home/tculjaga/astfin/build_ip04/uClinux-dist-2008R1-RC8/staging/usr/include -fno-jump-tables" ASTLDFLAGS="-mfdpic -L/home/tculjaga/astfin/build_ip04/uClinux-dist-2008R1-RC8/staging/usr/lib -lpthread -ldl " \

        # make -C /home/tculjaga/astfin/build_ip04/bash-4.0 codecs NOISY_BUILD=1

OPTIMIZE="-Os" ASTCFLAGS="-g -mfdpic -mfast-fp -ffast-math -D__FIXED_PT__ -D__BLACKFIN__ -I/home/tculjaga/astfin/build_ip04/uClinux-dist-2008R1-RC8/staging/usr/include -fno-jump-tables" ASTLDFLAGS="-mfdpic -L/home/tculjaga/astfin/build_ip04/uClinux-dist-2008R1-RC8/staging/usr/lib -lpthread -ldl " \

        make -C /home/tculjaga/astfin/build_ip04/bash-4.0 NOISY_BUILD=1

make[1]: Entering directory `/home/tculjaga/astfin/build_ip04/bash-4.0'

 

          ***********************************************************

          *                                                         *

          * GNU bash, version 4.0.0(1)-release (bfin-unknown-linux-uclibc)

          *                                                         *

          ***********************************************************

 

rm -f bash

bfin-linux-uclibc-gcc -L./builtins -L./lib/readline -L./lib/readline -L./lib/glob -L./lib/tilde -L./lib/malloc -L./lib/sh -mfdpic -L/home/tculjaga/astfin/build_ip04/uClinux-dist-2008R1-RC8/staging/usr/lib -lpthread -ldl   -rdynamic  -g -mfdpic -mfast-fp -ffast-math -D__FIXED_PT__ -D__BLACKFIN__ -I/home/tculjaga/astfin/build_ip04/uClinux-dist-2008R1-RC8/staging/usr/include -fno-jump-tables -o bash shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o  dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o expr.o flags.o nojobs.o subst.o hashcmd.o hashlib.o mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o alias.o array.o arrayfunc.o assoc.o braces.o bracecomp.o bashhist.o bashline.o  list.o stringlib.o locale.o findcmd.o redir.o pcomplete.o pcomplib.o syntax.o xmalloc.o signames.o -lbuiltins -lsh -lreadline -lhistory -lcurses -lglob -ltilde -lmalloc lib/intl/libintl.a   -ldl

./lib/malloc/libmalloc.a(malloc.o): In function `lesscore':

/home/tculjaga/astfin/build_ip04/bash-4.0/lib/malloc/malloc.c:540: undefined reference to `_sbrk'

./lib/malloc/libmalloc.a(malloc.o): In function `morecore':

/home/tculjaga/astfin/build_ip04/bash-4.0/lib/malloc/malloc.c:626: undefined reference to `_sbrk'

./lib/malloc/libmalloc.a(malloc.o): In function `pagealign':

/home/tculjaga/astfin/build_ip04/bash-4.0/lib/malloc/malloc.c:683: undefined reference to `_sbrk'

/home/tculjaga/astfin/build_ip04/bash-4.0/lib/malloc/malloc.c:695: undefined reference to `_sbrk'

collect2: ld returned 1 exit status

make[1]: *** [bash] Error 1

make[1]: Leaving directory `/home/tculjaga/astfin/build_ip04/bash-4.0'

make: *** [bash] Error 2

tculjaga@subZero:~/astfin$

 

 

 

 

 

well it is obvious that ?sbrk function is missing ... well how do i fix this?

 

 

 

Tihomir.

 

bash_configure&compile.log

QuoteReplyEditDelete

 

 

2009-03-12 10:04:00     Re: bash on blackfin

Mike Frysinger (UNITED STATES)

Message: 70866   

 

sbrk is the least of your worries

 

bash requires fork() and that wont work on a no-mmu system

QuoteReplyEditDelete

 

 

2009-03-12 12:19:11     Re: bash on blackfin

Tihomir Culjaga (CROATIA)

Message: 70874   

 

hi Mike,

 

 

 

what do you suggest to be used as shell if someone wants to use functions

 

 

 

 

 

root:/persistent/var/www/cshop> cat test

#!/bin/msh

 

_if(){

   if $1 ; then

     echo $2

   else

     echo $3

   fi

}

 

link(){

    code=$1; text=$2; url=$3; selected=$4;

    class=""

    if [ $selected == $code ]

    then

       class='selected'

    fi

    echo '<a href="'$WWW_ROOT'/'$url'" '$class'>'$text'</a>'

}

 

 

 

link "code" "Stranica" "lines_view.cgi" "code2"

link "code" "Stranica" "lines_view.cgi" "code"

 

LINK1=11111

LINK2=22222

 

echo -n "

$LINK1  $LINK2

aaaaa

$LINK1

aaa"$LINK2"a

"

 

echo '<html><body id="1">'$LINK1'

'`./test2`'

</body>

</html>'

 

root:/persistent/var/www/cshop>

root:/persistent/var/www/cshop> ./test

syntax error

root:/persistent/var/www/cshop>

QuoteReplyEditDelete

 

 

2009-03-12 17:22:31     Re: bash on blackfin

Mike Frysinger (UNITED STATES)

Message: 70891   

 

there's an experimental patch for msh under bfin_patch/msh_patch/ you can try

QuoteReplyEditDelete

 

 

2009-03-17 20:04:28     Re: bash on blackfin

Ted Chen (UNITED STATES)

Message: 71141   

 

Hi,

 

I tried the patch but it didn't work if I need to return a value from a function.

 

Do you know if that is included in the patch?

 

Thanks.

QuoteReplyEditDelete

 

 

2009-03-17 20:32:16     Re: bash on blackfin

Mike Frysinger (UNITED STATES)

Message: 71142   

 

there is a newer patch in the busybox dir itself ... user/busybox/busybox-1.13.3/shell/msh_function.patch

 

you might also try using the hush shell in busybox rather than msh ... but i dont know the feature set of that vs msh

 

if that doesnt work though, well that's about all there is currently

QuoteReplyEditDelete

 

 

2009-03-29 09:34:35     Re: bash on blackfin

Tihomir Culjaga (CROATIA)

Message: 71729   

 

Hello,

 

 

 

thanks for your answer... Anyhow, the performance via shell script was really bad ... over 200 ms for a simple thing

 

 

 

i switched to pure C rather.

 

 

 

T.

QuoteReplyEditDelete

 

 

2009-03-31 10:39:40     Re: bash on blackfin

Rob Maris (GERMANY)

Message: 71884   

 

Hm, switched over - past tense - nevertheless:

 

I would have had recommend you to try tinytcl. It is included and it has a syntax comparable to that of shell scipting... You'd still have scripting flexibility and simplicity.

 

-Rob

Outcomes