Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).


  Search this Thread
Old 03-10-2005, 11:02 PM   #1
LQ Newbie
Registered: Oct 2003
Location: India
Distribution: redhat 9
Posts: 5

Rep: Reputation: 0
cross compiling a shared library


i have to port a shared library to a linux 2.4.18 based handheld which goes by the name of SIMPUTER.Simputer is a ARM based hadheld and the SDK came with a cross-compilation toolchain which contains arm-linux-gcc, arm-linux-gcc.I have to change the MAKEFILE to create a shared library for the ARM.Here is the MAKEFILE:

LIBTOOL := ../../libtool
INCLUDE := ../../include/lufs
CFLAGS := -O2 -I ${INCLUDE} -c -o
LDFLAGS := -rpath /usr/local/lib -version-info 2:0:0 D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -o

O_TARGET := liblufs-localfs.o

obj-y := localfs.o client.o fh.o sfs_clnt.o sfs_xdr.o dircache.o

obj-h := fh.h sfs.h sfsclnt.h list.h

${O_TARGET}: ${obj-y}
../../libtool --tag=CC --mode=link ${CC} ${LDFLAGS} localfs.lo client.lo fh.lo sfs_clnt.lo sfs_xdr.lo dircache.lo

localfs.o: localfs.c ${obj-h}
${LIBTOOL} --tag=CC --mode=compile ${CC} ${CFLAGS} localfs.o localfs.c

dircache.o: dircache.c ${obj-h}

THE object are created fine , but when libtool goes on to create the shared library it is invoking "gcc" and hence failing.

../../libtool --tag=CC --mode=link arm-linux-gcc -rpath /usr/local/lib -version-info 2:0:0 D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -o localfs.lo client.lo fh.lo sfs_clnt.lo sfs_xdr.lo dircache.lo
rm -fr .libs/ .libs/liblufs-localfs.lai .libs/ .libs/ .libs/
gcc -shared .libs/localfs.o .libs/client.o .libs/fh.o .libs/sfs_clnt.o .libs/sfs_xdr.o .libs/dircache.o -Wl,-soname -Wl, -o .libs/
/usr/bin/ld: .libs/localfs.o: Relocations in generic ELF (EM: 40)
.libs/localfs.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [liblufs-localfs.o] Error 1

How do i tell libtool to use "arm-linux-gcc" as the compiler?



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
GNU based c++ cross compiler unable to link c library k_taid Programming 1 06-29-2005 09:38 AM
djgpp c++ cross compiler cannot read library functions written in C back2morrie Linux - General 0 05-31-2005 02:43 AM
A cross-platform networking library? elluva Programming 4 02-15-2005 04:35 PM
help shared library jingle_mj Programming 4 08-13-2004 04:13 AM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 04:20 AM > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 06:07 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration