Drazen Kacar wrote:
> You can't do that. It doesn't have anything to do with the compiler.
> You can't link statically with libdl, because there is no libdl.a.
> This is because libdl is not a library at all. It's a linker map file.
> I don't know enough about map files to explain what you can and
> cannot do, but I can give a simple example or two.

That makes sense, but it wasn't what I wanted to do, just a
side effect of the only solution to the errors I had.  Read on...
I didn't make myself very clear in the original post.

> > Which combination of flags should I be using here?
> 
> You should try to answer one simple question: why do you want to do
> that? I can understand that you want to link staticaly with libpng
> or g++ library. But why with system libraries? Sun doesn't guarantee
> that programs linked staticaly with system libraries will work on a
> next release. In LP64 environment there is even more severe restriction.
> There are no static libraries. OK, maybe one or two, for a low level
> system dependant things.

I just want to make a static binary.  When I use "-static" all sorts
of system libraries complain about functions that reside in 
libdl, even though I have not put "-ldl" on the link line.

Seems kind of silly that Sun would tag static binaries as something
_not_ to do if you want portability to future releases... I guess
they change the syscalls all the time.  

I'll try something like 
gcc -static myobjects.o mylibs.a -shared systemstuff

-- 
Shaw Terwilliger

Reply via email to