From: Dave Hylands <dhylands@gm...> - 2007-07-26 14:47:19
> We are trying to execute a home made program in the gumstix following the=
web examples (hello world, etc). We are using a BerkeleyDB database (We in=
clude the library in the makefile for the compilation and in the buildroot =
package- make menuconfig -). After compiling our program we copy it to the=
gusmtix and the following message appears when we try to execute:
> Can't modify /lib/libdb-4.5.so's text section. Use GCC option =96fPIC for=
shared objects, please.
> First we tried to compile our program using the flag (-fPIC) for creating=
shared libraries, but still appears this error message. Furthermore, we h=
ave tried to put a new image in to the gusmtix with the flag =96fPIC in the=
"Toolchain Options/additional gcc options" of the buildroot. But it does n=
ot work too.
This affects options used to build the toolchain.
> Then we suspected that the problem is that we were missing some option in=
the Buildroot. If we compile our application linking libdb as a shared lib=
rary (gcc -shared -ldb) we have a core dump due to a segmentation fault. =
We check ldd and /etc/ld.so.cache and we see that the library libssp.so is=
missing but we don't see it on Buildroot, surfing on the web we see libssp=
is part of ulib (embedded version of glibc) but we don't know how to inclu=
de this library. Anyway we might have miss something, so we enclose is our =
The problem isn't an option missing in buildroot, but rather that
-fPIC isn't being passed into the compiler when it's building libdb.
I tried building libdb and sure enough, if I look at the command line,
I don't see any -fPIC, even though configure is being called with
I didn't have much time to look at it so I'm not sure why libdb isn't
being compiled with -fPIC, but that seems to be wat the problem is.
Vancouver, BC, Canada
On Jul 26, 2007, at 7:47 AM, Dave Hylands wrote:
> I tried building libdb and sure enough, if I look at the command line,
> I don't see any -fPIC, even though configure is being called with
It looks like configure wasn't setting up the Makefile right -- it
would figure out the right options to pass gcc and then just not
stick them in the Makefile...
Anyway, I've hacked it now by just passing -fPIC -DPIC in CFLAGS, and
that seems to work (at least, it's passing the arg through to gcc and
it all compiles OK). I've also added the CPU optimization flags too,
so it'll probably be a bit better/faster code to boot :)
Committed to buildroot as r1480