2011-02-15 08:17:30     [2010R1- RC5] "Flex" library doesn't compile

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

2011-02-15 08:17:30     [2010R1- RC5] "Flex" library doesn't compile

Gilles Ganault (FRANCE)

Message: 98183   

Hello

 

I wanted to build a new image that includes the "at" applications to schedule one-time tasks. Apparently, "at" requires the Flex library, so here's what I did:

 

 

# export PATH=$PATH:/opt/uClinux-2010/bfin-linux-uclibc/bin:/opt/uClinux-2010/bfin-uclinux/bin

 

# cd /usr/src/uClinux-dist-2010R1-RC5/

 

 

 

# make menuconfig

 

Customize Application/Library Settings

 

Build flex

 

[*] at

 

[*] atd

 

[*] atrun

 

 

 

# make single

 

...

 

make[8]: Entering directory `/usr/src/uClinux-dist-2010R1-RC5/lib/flex/build-flex-2.5.35'

 

bfin-uclinux-gcc  -pipe -Wall -g -O2      -mcpu=bf533-0.3  -Wl,-elf2flt    -mcpu=bf533-0.3 -o flex  ccl.o dfa.o ecs.o scanflags.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o  -lm

 

filter.o: In function `filter_apply_chain':

 

/usr/src/uClinux-dist-2010R1-RC5/lib/flex/flex-2.5.35/filter.c:151: undefined reference to `_fork'

 

collect2: ld returned 1 exit status

 

make[8]: *** [flex] Error 1

 

make[8]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/lib/flex/build-flex-2.5.35'

 

make[7]: *** [install-recursive] Error 1

 

make[7]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/lib/flex/build-flex-2.5.35'

 

make[6]: *** [install] Error 2

 

make[6]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/lib/flex/build-flex-2.5.35'

 

make[5]: *** [all] Error 2

 

make[5]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/lib/flex'

 

make[4]: *** [flex] Error 2

 

make[4]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/lib'

 

make[3]: *** [all] Error 2

 

make[3]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/lib'

 

make[2]: *** [subdirs] Error 1

 

make[2]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5'

 

make[1]: *** [single_] Error 2

 

make[1]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5'

 

make: *** [single] Error 2

 

 

 

Has someone successfully compiled Flex + at?

 

Thank you.

QuoteReplyEditDelete

 

 

2011-02-15 13:54:42     Re: [2010R1- RC5] "Flex" library doesn't compile

Mike Frysinger (UNITED STATES)

Message: 98185   

 

`flex` is only used at development time.  "at" most likely only needs libflex.a.  so if you disabled the building of the `flex` binary, i'm sure "at" would compile fine.

QuoteReplyEditDelete

 

 

2011-02-15 15:10:35     Re: [2010R1- RC5] "Flex" library doesn't compile

Gilles Ganault (FRANCE)

Message: 98189   

 

Thanks. Here's the output when I exclude "Build Flex" while keeping the At programs:

 

make[5]: Entering directory `/usr/src/uClinux-dist-2010R1-RC5/user/at'

 

bfin-uclinux-gcc -pipe -Wall -g -O2      -mcpu=bf533-0.3 -O2 -o at at.o panic.o perm.o y.tab.o lex.yy.o -lutil -lfl  -lfl

 

/opt/uClinux-2010/bfin-uclinux/bfin-uclinux/bin/ld.real: cannot find -lfl

 

collect2: ld returned 1 exit status

 

make[5]: *** [at] Error 1

 

make[5]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/user/at'

 

make[4]: *** [at] Error 2

 

make[4]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/user'

 

make[3]: *** [all] Error 2

 

make[3]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/user'

 

make[2]: *** [subdirs] Error 1

 

make[2]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5'

 

make[1]: *** [single_] Error 2

 

make[1]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5'

 

make: *** [single] Error 2

 

QuoteReplyEditDelete

 

 

2011-02-16 05:05:30     Re: [2010R1- RC5] "Flex" library doesn't compile

Gilles Ganault (FRANCE)

Message: 98207   

 

After editing the empty LDFLAGS variable in ./user/at/Makefile to include -L/usr/src/uClinux-dist-2010R1-RC5/lib/flex/build-flex-2.5.35, and editing the "at" and "atd" targets to contain that variable, re-running "make single" ends with this error:

 

 

 

make[5]: Entering directory `/usr/src/uClinux-dist-2010R1-RC5/user/at'

 

bfin-uclinux-gcc -pipe -Wall -g -O2      -mcpu=bf533-0.3 -O2 -o atd atd.o daemon.o   -Wl,-elf2flt    -mcpu=bf533-0.3 -L/usr/src/uClinux-dist-2010R1-RC5/lib/flex/build-flex-2.5.35 -lutil -lfl

 

atd.o: In function `run_file':

 

/usr/src/uClinux-dist-2010R1-RC5/user/at/atd.c:204: undefined reference to `_fork'

 

/usr/src/uClinux-dist-2010R1-RC5/user/at/atd.c:309: undefined reference to `_fork'

 

atd.o: In function `run_loop':

 

/usr/src/uClinux-dist-2010R1-RC5/user/at/atd.c:534: undefined reference to `_getloadavg'

 

daemon.o: In function `daemon_setup':

 

/usr/src/uClinux-dist-2010R1-RC5/user/at/daemon.c:122: undefined reference to `_fork'

 

collect2: ld returned 1 exit status

 

make[5]: *** [atd] Error 1

 

make[5]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/user/at'

 

make[4]: *** [at] Error 2

 

make[4]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/user'

 

make[3]: *** [all] Error 2

 

make[3]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5/user'

 

make[2]: *** [subdirs] Error 1

 

make[2]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5'

 

make[1]: *** [single_] Error 2

 

make[1]: Leaving directory `/usr/src/uClinux-dist-2010R1-RC5'

 

make: *** [single] Error 2

 

 

Has someone successfully compiled the "at" tools with Blackfin uClinux, or at least the 2010R1-RC5 version of the source?

 

Thank you.

QuoteReplyEditDelete

 

 

2011-02-16 11:31:42     Re: [2010R1- RC5] "Flex" library doesn't compile

Mike Frysinger (UNITED STATES)

Message: 98208   

 

i guess "at" will need porting to nommu too.  this is not a util people have asked for in the past, so we havent noticed an issue.

 

do you actually need "at" functionality ?  or do you simply need cron services ?  busybox includes cron support ...

QuoteReplyEditDelete

 

 

2011-02-16 18:37:20     Re: [2010R1- RC5] "Flex" library doesn't compile

Gilles Ganault (FRANCE)

Message: 98209   

 

I need to schedule a one-time event, so cron could be a work-around to call a script that will perform its task and then remove itself from crontab. Good enough.

 

BTW, am I correct in understanding that the Blackfin team downloaded the uClinux source at some point (and it could be that changes made by the Blackfin team aren't being merged back into the standard uClinux source), but only application under ./user/ that actually work on Blackfin CPU's are those that ADI and some users deamed important?

 

IOW, there's no telling until we try to compile and run them?

 

Thank you.

QuoteReplyEditDelete

 

 

2011-02-17 13:52:57     Re: [2010R1- RC5] "Flex" library doesn't compile

michael allen (UNITED STATES)

Message: 98230   

 

ive fixed flex to build only the library.  i also fixed some of the build issues with at, but the fork() in atd needs quite a bit of work to fix cleanly -- there are a lot of code paths which can call exit().  i changed it to vfork() as in most cases, this should "just work".

 

no, that isnt really how our fork of uclinux.org is working.  the picture is a lot murkier than that in many ways.  best to just point out uclinux-dist is a dead distribution.

QuoteReplyEditDelete

 

 

2011-02-18 03:41:45     Re: [2010R1- RC5] "Flex" library doesn't compile

Gilles Ganault (FRANCE)

Message: 98248   

 

Thanks Michael for the clarification. The uClinux site does seem dead, although the latest dist is from October 2010.

 

Cron + script that removes itself is a good work-around.

QuoteReplyEditDelete

Attachments

    Outcomes