[tlbuild] Problem with program_invocation_name on Cygwin

Ken Brown kbrow1i at gmail.com
Sun Mar 6 02:41:38 CET 2011


On 3/5/2011 8:19 PM, Karl Berry wrote:
> Hi Ken,
>
>                        from ../../../texk/xdvik/main.c:10:
>
> Were you just compiling xdvik alone or what?

No, I was doing a complete build in the standard way (using the Build 
script), but this was the first failure.  Angelo Graziosi first noticed 
this, and I replicated it.

 >   I would have expected the
> build to fail on the first kpse-using program.  I don't see any obvious
> reason why xdvik should behave differently.  The kpse sources all
> include whatever .h's are needed.
>
>      extern __IMPORT char *program_invocation_name;
>      extern __IMPORT char *program_invocation_short_name;
>
> With no #ifdef __USE_GNU or anything around it?

There is an #ifdef __CYGWIN__ around it.  I think it's part of newlib, 
which supports Cygwin as well as some other systems.

>  The declarations (minus
> __IMPORT) are also present in /usr/include/errno.h on my CentOS system
> and have been around in glibc for decades.  Thus seemingly this should
> have been failing for a year or two at least, but hasn't been.
>
>
> Anyway, the story here is that originally I used those variables, which
> are automatically set up on glibc systems.  In retrospect, that was
> pointless since we have to compute them on other systems anyway, and the
> glibc values aren't necessarily what we want anyway (symlink expansion ...).
>
> When Taco made kpse thread-safe he made them part of the kpse instance
> and #define'd the bare names to be in the default instance as usual, to
> preserve compatibility.  That's when I would have expected glibc
> compilations to start failing too.
>
> At this point, I think the thing to do is prepend kpse_ to those #defines
> and change the few occurrences of program_invocation{,_short}_name that
> are in the sources.  A quick grep under texk showed<  10, most in
> luatexdir, which I expect Taco will be glad to hack out :).
>
> (We can also eliminate the configure test for it.)
>
> Taco, Peter, wdyt?
>
> Thanks,
> k




More information about the tlbuild mailing list