[tlbuild] hitex build failure

Martin Ruckert martin.ruckert at hm.edu
Thu Feb 24 19:42:30 CET 2022


Hi Johannes,

hiparser.c and hiparser.c are generated by bison and
the default value for YYDEBUG in hiparser.h depends on
the -t option when running bison. With -t the value is 1 and without its 0.
YYDEBUG is used to include debugging code in the generated parser.
The variable yydebug ist used to switch it on and off dynamically.
If hishrink is compiled with debugging (-DDEBUG) the parser sould also be
compiled with debugging support. The yydebug variable can then be set
using the -d option of hishrink.
  
The default value in hiparser.h is used only if YYDEBUG ist _not_ defined.
So hiformat.w will always define YYDEBUG to either 0 or 1  depending on DEBUG
before including hiparser.h
The variable yydebug is used in hilexer.c, hishrink.c, and  hiparser.c only if if YYDEBUG == 1,
The definition of int yydebug is also in hiparser.c (line 1446) guarded by #if YYDEBUG
in line 758.

So I rechecked all combinations of -t and -DDEBUG without getting a compiler problem.
Can you check that in hilexer.c and hishrink.c and hiparser.c you find
#ifdef DEBUG
#define  YYDEBUG 1
extern int yydebug;
#else
#define YYDEBUG 0
#endif

  before

#include "hiparser.h"

and before any #if YYDEBUG

and that your use of -DDEBUG is consistent. I.e not compiling hishrink.c with -DDEBUG
and hiparser.c without -DDEBUG ?

Regards
    Martin

On 2/24/22 14:03, Johannes Hielscher wrote:
> Confirmed (aarch64-linux). Martin did push an attempt to fix this
> (TeXLive SVN -r62160), but the build failure persists.
> 
> The immediate reason for the broken compile (not its root cause) is the
> changed default value of YYDEBUG from 0 to 1:
> https://tug.org/svn/texlive/trunk/Build/source/texk/web2c/hitexdir/hiparser.h?r1=61723&r2=62150&pathrev=62160
> Reverting this one-liner change makes the builds pass. But of course
> there is an issue underneath -- changing debug settings shouldn't break
> a build.
> 
> A peek into hishrink.c (created by ctangle from hiformat.w during the
> build) shows that the CPP macro YYDEBUG is sourced from hiparser.h .
> The variable "yydebug" is only ever declared, but defined nowhere.
> 
> When YYDEBUG==0, the preprocessor deletes this buggy code branch as a
> whole.
> 
> A definition of "yydebug" happens in hiparser.c:1446, however, upon
> superficial investigation, it seems that the preprocessor somehow
> deletes this definition too: the variable "yydebug" does not appear in
> the object file hishrink-hiparser.o (nm finds many "yy*" variables,
> but "yydebug" is none of them), and the final linker call rightfully
> complains about this.
> I don't fully understand what happens there, and why. It seems to me
> that the extent/scoping of the YYDEBUG preprocessor conditional within
> hiparser.c might be off, or its logical state not propagated properly.
> 
> Best,
> Johannes
> 
> 
> Am Wed, 23 Feb 2022 22:31:07 +0000
> schrieb Richard Koch <koch at uoregon.edu>:
> 
>> Same problem on macOS for arm:
>>
>> Undefined symbols for architecture arm64:
>>    "_yydebug", referenced from:
>>        _main in hishrink-hishrink.o
>> ld: symbol(s) not found for architecture arm64
>>
>> Dick Koch
> 


-- 
Prof.Dr.Martin Ruckert
Hochschule Muenchen - University of Applied Sciences
Department for Mathematics and Computer Science
Lothstrasse 64
D-80335 Muenchen
GERMANY


More information about the tlbuild mailing list.