Slackware is not a newbie system. the libraries are not sane.
I recompiled the DEBUG libc and poked around until I found the var defined in
LD-2.3.1.so
so I link like this
gcc -o test yy.lex.o -I/root/glibc/glibc-2.3.1 -Lld-2.3.1.so -lc
and I get a sane user at-fault test program that does not die in the library.
for some reason the gcc link default does not pickup this particular library
or if there is some arcane reason, I do not know what that might be
This is true in earlier versions of slac kware as well
i booted slackware 3.0 and got the same error.