On 12/08/10 06:11, Gary V. Vaughan wrote:
> If you are on a glibc system, I think the library provides the necessary
> symbol and you should be able to build a working libposix from the topic
> branch after a git pull. Otherwise you'll have to link in the progname
> module, or similar to resolve it... until we come up with a blessed
> method for dealing with it properly.
Hi,
Scratching my head and fuzzily remembering the problem, the issues are:
1. The error module gets sucked into the POSIX library and it
will seg fault for you if you have not defined and initialized
a "char * program_name" global variable.
This is very bad because it has the unanticipatable consequence
of requiring the libposix client to know that there are non-posix
requirements in using this posix library.
2. On some non-ELF systems, if you declare a pointer as in:
char * program_name;
that declaration is actually a definition with non-weak linkage.
i.e. it is not dumped into an "anonymous region(?)".
This creates a link problem, despite the commonness of using this
idiom for 40 years.
I think the correct solution is to find a way to have the error
module not seg fault and also to not require non-posix calls be
made in order to use the libposix library.
Possible fixes:
* modify the error module to tolerate a NULL value
in program_name, defining the variable only where needed
(using some autoconf wizardry).
* automatically set that value, likewise defining as needed
* figure out how to remove the dependency(ies) that draw it
into the library.
Just adding the progname module and requiring a non-posix call
is not a good solution (in my completely unhumble opinion).