views:

393

answers:

3
A: 

It seems that the makefile is broken, because the libc.so.6 is assumed to be located in the /lib/ folder (note the preceding slash indicating an absolute path! ). This seems to be the issue.

moritz
Sure, but WHAT in the makefile could be broken? You can see from what I've pasted exactly what is getting linked in, right? And all those -L's point to places that clearly aren't /. Soooo... There's got to be something else I'm missing. I'll add in more information on my question and see if that helps clarify any...
lishevita
Okay, I guess I wasn't clear enough here.. :-). There is a huge difference between a path name like /foo/bar and foo/bar. The first is always pointed at /foo/bar /, as seen from the root of your file system, the latter one depends on your current working directory. Because the path in the makefile seems to be absolute, i.e. from the root ongoing, your search paths aren't even looked up and searched for the libc.so . hope that helped.
moritz
A: 

Have you not considered that possibly the LIBPATH is set and hard-coded to look for the /lib/libc.so.6 and therefore the /lib path?

Have you tried to set the environment variable like this on the command line, prior to issuing make when cross-compiling:

LIBPATH=/home/work/worldcom/filesys/lib

In your specific case, as you have mentioned in the tag 'cross-compiling', it might be worth it to remove any references to /lib to wholly force the linker to look in your own home directory instead as not to interfere with the cross-compile process.

The other possibility is that the gcc compiler when it was built for your environment, the configuration during the building of the compiler from source, was specified to point to the /lib path.

Hope this helps, Best regards, Tom.

tommieb75
Just tried <code>export LIBPATH=/home/work/worldcom/filesys/lib</code>and got no joy. Maybe you are right about the gcc compiler being built to point to the /lib path, although that seems weird. I'll look into that as a possible source of the problem.Thanks, Lisha
lishevita
A: 

Hi Lisha,

You didn't indicate what gcc version you are using, but if it is a recent enough one (4.0.0 and above me thinks) you should try the --with-sysroot flag to g++/ld. Point it to $SYSROOT as defined in your Makefile.

Assuming recent enough gcc version, it will work.

Hope this helps, Gilad

Correction: it's -sysroot, not --with-sysroot

gby
My Hero!!! :)It's actually --sysroot without "with-", but you pointed me in the right direction and it works. Now I have a new error. New errors are good. It means I got past one problem and have an entirely new challenge to induce high blood pressure! :) Here's the new line in my Makefile: $(CXX) $^ -o $@ $(LDFLAGS) -shared $(PKG_LIBS) --sysroot=$(SYSROOT)
lishevita