AppWeb Forum

Support for the AppWeb HTTP Server
It is currently Thu Sep 09, 2010 5:00 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Porting to Coldfire
PostPosted: Wed Apr 21, 2010 3:55 pm 
Offline

Joined: Wed Feb 10, 2010 10:10 am
Posts: 36
Hi,

I'm porting AppWeb to Coldfire but I have found some problems linking dynamic libraries.
I have followed the next steps to cross compile.

Code:
CFLAGS='-march=isac -mcpu=54455 -msoft-float'
AR=m68k-linux-gnu-ar
CC=m68k-linux-gnu-gcc
LD=m68k-linux-gnu-ld
CXX=m68k-linux-gnu-gcc
RANLIB=m68k-linux-gnu-ranlib
NM=m68k-linux-gnu-nm
STRIP=m68k-linux-gnu-strip
./configure --host=m68k-linux --disable-multi-thread --disable-samples --disable-doc --without-php --without-sql --disable-cgi

make TRACE=1


During cross-compiling phase, the " Fatal error: Tried to convert PC relative branch to absolute jum" raises:
Code:
    #
    #  Cross building for m68k-unknown-linux
    #
# /usr/bin/make -C "./build" compile
cd /home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2
# /usr/bin/make -C "./projects" compile
cd /home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2
# /usr/bin/make -C "./obj" compile
cd /home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2
# /usr/bin/make -C "./lib" compile
cd /home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2
# /usr/bin/make -C "./modules" compile
cd /home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2
# /usr/bin/make -C "./bin" compile
cd /home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2
# /usr/bin/make -C "./src" compile
# /usr/bin/make -C "./src/include" compile
# /usr/bin/make -C "./src/mpr" compile
/usr/bin/make -f Makefile.all
/opt/freescale/usr/local/gcc-4.3.43-eglibc-2.5.43/m68k-linux/bin/m68k-linux-gnu-gcc -c -DBUILDING_CROSS=1 -DPIC -Wall -g3 -fPIC -march=isac -mcpu=54455 -msoft-float -I../.. -I../../src/include http.c -o ../../obj/m68k-unknown-linux/http.o
/opt/freescale/usr/local/gcc-4.3.43-eglibc-2.5.43/m68k-linux/bin/m68k-linux-gnu-gcc -c -DBUILDING_CROSS=1 -DPIC -Wall -g3 -fPIC -march=isac -mcpu=54455 -msoft-float -I../.. -I../../src/include makerom.c -o ../../obj/m68k-unknown-linux/makerom.o
/opt/freescale/usr/local/gcc-4.3.43-eglibc-2.5.43/m68k-linux/bin/m68k-linux-gnu-gcc -c -DBUILDING_CROSS=1 -DPIC -Wall -g3 -fPIC -march=isac -mcpu=54455 -msoft-float -I../.. -I../../src/include mprLib.c -o ../../obj/m68k-unknown-linux/mprLib.o
/opt/freescale/usr/local/gcc-4.3.43-eglibc-2.5.43/m68k-linux/bin/m68k-linux-gnu-gcc -c -DBUILDING_CROSS=1 -DPIC -Wall -g3 -fPIC -march=isac -mcpu=54455 -msoft-float -I../.. -I../../src/include mprPcre.c -o ../../obj/m68k-unknown-linux/mprPcre.o
/tmp/ccS3Lu75.s: Assembler messages:
/tmp/ccS3Lu75.s:77129: Fatal error: Tried to convert PC relative branch to absolute jump
/opt/freescale/usr/local/gcc-4.3.43-eglibc-2.5.43/m68k-linux/bin/m68k-linux-gnu-gcc -c -DBUILDING_CROSS=1 -DPIC -Wall -g3 -fPIC -march=isac -mcpu=54455 -msoft-float -I../.. -I../../src/include mprSsl.c -o ../../obj/m68k-unknown-linux/mprSsl.o
bld --library ../../lib/m68k-unknown-linux/libmpr mprLib
"/opt/freescale/usr/local/gcc-4.3.43-eglibc-2.5.43/m68k-linux/bin/m68k-linux-gnu-gcc" "-o" "../../lib/m68k-unknown-linux/libmpr.so" "-shared" "../../obj/m68k-unknown-linux/mprLib.o" "-march=isac" "-mcpu=54455" "-msoft-float" "-g3" "-Wl,-rpath-link=/home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2/lib/m68k-unknown-linux" "-L/home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2/lib/m68k-unknown-linux" "-Wl,--enable-new-dtags" "-Wl,-rpath,$ORIGIN/" "-Wl,-rpath,$ORIGIN/../lib/m68k-unknown-linux" "-Wl,-rpath,$ORIGIN/../modules/m68k-unknown-linux" "-Wl,-rpath,/home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2/lib/m68k-unknown-linux" "-Wl,-rpath,/home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2/modules/m68k-unknown-linux" "-ldl" "-lm"
bld --library ../../lib/m68k-unknown-linux/libpcre mprPcre
"/opt/freescale/usr/local/gcc-4.3.43-eglibc-2.5.43/m68k-linux/bin/m68k-linux-gnu-gcc" "-o" "../../lib/m68k-unknown-linux/libpcre.so" "-shared" "../../obj/m68k-unknown-linux/mprPcre.o" "-march=isac" "-mcpu=54455" "-msoft-float" "-g3" "-Wl,-rpath-link=/home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2/lib/m68k-unknown-linux" "-L/home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2/lib/m68k-unknown-linux" "-Wl,--enable-new-dtags" "-Wl,-rpath,$ORIGIN/" "-Wl,-rpath,$ORIGIN/../lib/m68k-unknown-linux" "-Wl,-rpath,$ORIGIN/../modules/m68k-unknown-linux" "-Wl,-rpath,/home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2/lib/m68k-unknown-linux" "-Wl,-rpath,/home/depatre/Progetti/PCM/ltib.PCM/rpm/BUILD/appweb-3.1.2/modules/m68k-unknown-linux" "-ldl" "-lm"
m68k-linux-gnu-gcc: ../../obj/m68k-unknown-linux/mprPcre.o: No such file or directory
bld: /opt/freescale/usr/local/gcc-4.3.43-eglibc-2.5.43/m68k-linux/bin/m68k-linux-gnu-gcc failed
make[4]: *** [../../lib/m68k-unknown-linux/libpcre.so] Error 255
make[3]: *** [compileFirst] Error 2
make[2]: *** [compileDirs] Error 2
make[1]: *** [compileDirs] Error 2
make: *** [compile] Error 255


Do you have any idea to solve this problem?
Thanks in advance

Simone


Top
 Profile  
 
 Post subject: Re: Porting to Coldfire
PostPosted: Wed Apr 21, 2010 5:32 pm 
Offline

Joined: Wed Nov 19, 2003 11:55 pm
Posts: 481
Do you have src/mpr/mprPcre.c?

It should be there in the source dist -- where did u get the source?

P

_________________
Peter Hale
Gridable Systems


Top
 Profile  
 
 Post subject: Re: Porting to Coldfire
PostPosted: Wed Apr 21, 2010 8:10 pm 
Offline

Joined: Wed Feb 10, 2010 10:10 am
Posts: 36
yes, this file exists in the path src/mpr. (I downloaded some months ago appweb 3.1.2 tar gz)
It seems that -DPIC and -fPIC are not supported with m68k-linux-gnu-gcc, do you know?
Change configure, disabling the shared option, cross compile works fine...but I need to have dynamic libraries.

Any further idea? Thanks
Simone


Top
 Profile  
 
 Post subject: Re: Porting to Coldfire
PostPosted: Wed Apr 21, 2010 8:52 pm 
Offline

Joined: Wed Nov 19, 2003 11:55 pm
Posts: 481
u may need to edit the compiler flags in build/make/config.gcc

then make clean ; make compile

P

_________________
Peter Hale
Gridable Systems


Top
 Profile  
 
 Post subject: Re: Porting to Coldfire
PostPosted: Thu Apr 22, 2010 3:19 pm 
Offline

Joined: Wed Feb 10, 2010 10:10 am
Posts: 36
I have removed these options and launched configure with --shared.
The error "Fatal error: Tried to convert PC relative branch to absolute jump" still remains.
So I decided to configure Appweb with --static option ...

When I build my application (I'm trying to include statically Appweb), I have the next errors
Code:
Building target: Webs
Invoking: GCC C Linker
gcc -L/home/depatre/Progetti/appweb-3.1.2/lib -o"Webs"  ./CofdmDrv.o ./DmtEquip.o ./DmtIPCProt.o ./DmtNetLinkComm.o ./Dr_AM79C874.o ./Dr_I2C.o ./SnmpCfg.o ./Tx.o ./UserManagement.o ./Utils.o ./Web.o ./crc32.o   -lappweb -lejs -ldl -lac -lajs -lsqlite3 -lpcre -lmpr -lm
/home/depatre/Progetti/appweb-3.1.2/lib/libsqlite3.a(sqlite3.o): In function `pthreadMutexAlloc':
/home/depatre/Progetti/appweb-3.1.2/src/ejs/sqlite3.c:20608: undefined reference to `pthread_mutexattr_init'
/home/depatre/Progetti/appweb-3.1.2/src/ejs/sqlite3.c:20609: undefined reference to `pthread_mutexattr_settype'
/home/depatre/Progetti/appweb-3.1.2/src/ejs/sqlite3.c:20611: undefined reference to `pthread_mutexattr_destroy'
/home/depatre/Progetti/appweb-3.1.2/lib/libsqlite3.a(sqlite3.o): In function `pthreadMutexTry':
/home/depatre/Progetti/appweb-3.1.2/src/ejs/sqlite3.c:20731: undefined reference to `pthread_mutex_trylock'
/home/depatre/Progetti/appweb-3.1.2/lib/libsqlite3.a(sqlite3.o): In function `testThreadLockingBehavior':
/home/depatre/Progetti/appweb-3.1.2/src/ejs/sqlite3.c:27698: undefined reference to `pthread_create'
/home/depatre/Progetti/appweb-3.1.2/src/ejs/sqlite3.c:27699: undefined reference to `pthread_join'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `mprCreateLock':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11030: undefined reference to `pthread_mutexattr_init'
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11031: undefined reference to `pthread_mutexattr_settype'
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11033: undefined reference to `pthread_mutexattr_destroy'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `mprInitLock':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11060: undefined reference to `pthread_mutexattr_init'
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11061: undefined reference to `pthread_mutexattr_settype'
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11063: undefined reference to `pthread_mutexattr_destroy'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `mprTryLock':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11111: undefined reference to `pthread_mutex_trylock'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `mprCreateSpinLock':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11141: undefined reference to `pthread_spin_init'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `mprInitSpinLock':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11187: undefined reference to `pthread_spin_init'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `destroySpinLock':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11229: undefined reference to `pthread_spin_destroy'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `mprTrySpinLock':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11260: undefined reference to `pthread_spin_trylock'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `mprSpinLock':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11374: undefined reference to `pthread_spin_lock'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `mprSpinUnlock':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:11406: undefined reference to `pthread_spin_unlock'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `mprStartThread':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:19312: undefined reference to `pthread_attr_setstacksize'
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:19314: undefined reference to `pthread_create'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `threadLocalDestructor':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:19366: undefined reference to `pthread_key_delete'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `mprCreateThreadLocal':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:19386: undefined reference to `pthread_key_create'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `mprSetThreadData':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:19408: undefined reference to `pthread_setspecific'
/home/depatre/Progetti/appweb-3.1.2/lib/libmpr.a(mprLib.o): In function `mprGetThreadData':
/home/depatre/Progetti/appweb-3.1.2/src/mpr/mprLib.c:19419: undefined reference to `pthread_getspecific'
collect2: ld returned 1 exit status
make: *** [Webs] Error 1


Then I disable multi-thread option and build phase works fine.
Is it the right way to include Appweb statically?
Thanks for your answer and patience
Simone


Top
 Profile  
 
 Post subject: Re: Porting to Coldfire
PostPosted: Thu Apr 22, 2010 6:47 pm 
Offline
Site Admin

Joined: Wed Nov 19, 2003 11:42 pm
Posts: 1107
Location: Seattle, Washington
You will need to solve the compiler flags for the PIC issue. You won't be able to run until you sort those flags out. You'll just need to try various options and consult your tool chain specialists. Static vs Dynamic should not have an impact on this error.

Please update to the latest source from github.com/embedthis/appweb-3. I think there has been a fix for static building.

Michael

_________________
Michael O'Brien
Lead Architect
Embedthis Software


Top
 Profile  
 
 Post subject: Re: Porting to Coldfire
PostPosted: Fri Apr 30, 2010 7:27 am 
Offline

Joined: Wed Feb 10, 2010 10:10 am
Posts: 36
Hi,

I'm trying to cross-compile but I have several assembler errors. I have attached the log.
Could you please suggest me a way to solve it?
Thanks for your help
Simone


Attachments:
make.log [177.71 KiB]
Downloaded 22 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[ Time : 0.146s | 13 Queries | GZIP : Off ]