[LLVMdev] Revised patch to make gccld link native .so's

Adam Treat manyoso at yahoo.com
Sun Feb 20 22:46:57 PST 2005


Here is a revised patch after some suggestions:

1.   Removed extraneous changes (the white space changes that are -/+ 
whitespace), and the commented out code.
2.   Keep the warning for linking dynamic libraries in LinkLibraries.cpp

I still don't have a good solution to the problem of -L paths that include 
bytecode versions of the native libraries we're trying to link.  Consider the 
following situation...  

A directory in our -L path has a libFoo.so native library that we need to 
link.  It also contains a libBar.so bytecode library.  

Another directory in our -L path has a bytecode version of libFoo.so and a 
native version of libBar.so.

What do we do?

llvm-g++ -Wl,-native -shared -o libtest.so test.o -L/foobar -lfoo -L/barfoo 
-lbar

/foobar
	libFoo.so 		--native
	libBar.so 		--bytecode

/barfoo
	libFoo.so		--bytecode
	libBar.so		--native

Now, it is possible to test for this situation, but even if we know that it is 
going to happen, how do we tell gcc or the system linker how to do the 
correct thing?
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linker.diff.gz
Type: application/x-gzip
Size: 2473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050221/d266b044/attachment.bin>


More information about the llvm-dev mailing list