Re: static executable, can't open $DISPLAY



On 14 Mar 2002 10:22:09 -0500
Havoc Pennington <hp redhat com> wrote:

> Maybe you statically linked to libc

... Ummm ... Probably?  I just passed the -static linker option to gcc.
% file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped
% ldd a.out
	not a dynamic executable

> so it can't dlopen() its locale data correctly?

What is "its locale data"?  Where would that normally reside, and how is
it normally found?  (Or, is it just automagic?)
[ Just curious - I've never done much with locales... ]

Even if that is the problem, why would this present itself as a "cannot
open display" error?  Couldn't/Shouldn't GTK still be able to open the
$DISPLAY and run?

> I'm just speculating. I don't think you want to link statically to
> libc though. There is a way to avoid doing so and I figured it out
> once but I'm not remembering offhand...

If that is the problem, I should be able to figure out how to do it.  I'm
just trying to understand what the problem actually is (and why it's a
problem)...

[ If you can't/shouldn't link libc in statically, how to most people create
static executables?  If the problem is as you describe, then it would seem
that the -static GCC option is useless/dangerous... ]

Thanks,
Ian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]