From: Galen Henderson on
Hello all. I tried several times to post a messge to perl.libwww but
it never appeared. I am having a problem building HTML::Parser. I've
pasted the original message below in case Gisle or someone here can
help me out.

Hello all. Hopefully Gisle is still monitoring this group. I went
through the archives and found a post by him about this issue. I
checked patchlevel.h and all seems well. There are no other
patchlevel.h on the system.

When I try to build (on OS/2), it bombs when it is trying to make the
PARSERMK.DLL. with the following:

weakld: error: Unresolved symbol (UNDEF EXPORT) 'boot_HTML__Parser'.
weakld: info: The symbol is referenced by:
U:/unixroot/galen/.cpan/build/HTML-Parser-3.64-GhzQBp/Parser.def
Ignoring unresolved externals reported from weak prelinker.
Error! E2028: boot_HTML__Parser is an undefined reference
Error! E2044: exported symbol boot_HTML__Parser not found
make: *** [blib/arch/auto/HTML/Parser/ParserMK.dll] Error 1

I can make the dll without declaring the export so it doesn't seem to
be a GCC issue... When I look at the parser.c file that gets
generated, there is no reference to this function. Is this supposed
to be automatically added by the EXTutils functions or something else?

Thanks in advance for any replies.

--
Regards,
Galen
------
There are only 10 kinds of people in the world. Those who understand
binary and those who don't.
From: Ben Morrow on

Quoth "Galen Henderson" <galen(a)hendersonsoftware.com>:
> Hello all. I tried several times to post a messge to perl.libwww but
> it never appeared.

Do you mean the group on nntp.perl.org? I believe that server doesn't
allow posting: certainly, nothing I've posted has ever shown up. You
should be able to send mail to libwww-perl(a)perl.org.

> I am having a problem building HTML::Parser. I've
> pasted the original message below in case Gisle or someone here can
> help me out.
>
> Hello all. Hopefully Gisle is still monitoring this group. I went
> through the archives and found a post by him about this issue. I
> checked patchlevel.h and all seems well. There are no other
> patchlevel.h on the system.

Well, I'm not Gisle, but I might be able to help :).

> When I try to build (on OS/2), it bombs when it is trying to make the
> PARSERMK.DLL. with the following:
>
> weakld: error: Unresolved symbol (UNDEF EXPORT) 'boot_HTML__Parser'.
> weakld: info: The symbol is referenced by:
> U:/unixroot/galen/.cpan/build/HTML-Parser-3.64-GhzQBp/Parser.def
> Ignoring unresolved externals reported from weak prelinker.
> Error! E2028: boot_HTML__Parser is an undefined reference
> Error! E2044: exported symbol boot_HTML__Parser not found
> make: *** [blib/arch/auto/HTML/Parser/ParserMK.dll] Error 1

I don't understand why this is trying to build a file called
ParserMK.dll. On my system the shared library is called

blib/arch/auto/HTML/Parser/Parser.so

(without the 'MK'). Is this usual on OS/2?

> I can make the dll without declaring the export so it doesn't seem to
> be a GCC issue... When I look at the parser.c file that gets
> generated, there is no reference to this function. Is this supposed
> to be automatically added by the EXTutils functions or something else?

There should be a section starting

XS(boot_HTML_Parser);
XS(boot_HTML_Parser)
{
#ifdef dVAR
dVAR; dXSARGS;
#else
dXSARGS;
#endif

in Parser.c. The XS() macro expands into a suitable function prototype.
Is it not there? Can you run nm (or some local equivalent) on Parser.o
to see if the symbol is defined? Can you post the link line(s) make is
trying to use, to make sure it's picking up the right files?

Ben

From: Galen Henderson on
Hi, Ben. Thanks for the reponse. My comments below...

On Thu, 1 Apr 2010 11:45:00 UTC, Ben Morrow <ben(a)morrow.me.uk> wrote:

snip

>
> I don't understand why this is trying to build a file called
> ParserMK.dll. On my system the shared library is called
>
> blib/arch/auto/HTML/Parser/Parser.so
>
> (without the 'MK'). Is this usual on OS/2?

I haven't been building Perl modules on OS/2 for very long but from
what I've seen, the MK is not added to the other dlls I've built.

>
> There should be a section starting
>
> XS(boot_HTML_Parser);
> XS(boot_HTML_Parser)
> {
> #ifdef dVAR
> dVAR; dXSARGS;
> #else
> dXSARGS;
> #endif

This is in the parser.c source file.

>
> in Parser.c. The XS() macro expands into a suitable function prototype.
> Is it not there? Can you run nm (or some local equivalent) on Parser.o
> to see if the symbol is defined? Can you post the link line(s) make is
> trying to use, to make sure it's picking up the right files?

Here is the gcc build command:

gcc -Zdll -Zomf Parser.o -O2 -fomit-frame-pointer -falign-loops=2
-falign-jump
s=2 -falign-functions=2 -s -o blib/arch/auto/HTML/Parser/ParserMK.dll
\
/perl5/lib/5.10.0/os2/CORE/libperl.a -lsocket
/perl5/lib/5.10.0/os2/CORE/libpe
rl_override.a Parser.def \
|| ( U:/PERL5/BIN/PERL.EXE -MExtUtils::Command -e 'rm_f' --
blib/arch/auto/HTM
L/Parser/ParserMK.dll && sh -c false )

nm shows the symbol as _boot_HTML__Parser. I'm stumped.

--
Regards,
Galen
------
There are only 10 kinds of people in the world. Those who understand
binary and those who don't.
From: Ben Morrow on

Quoth "Galen Henderson" <galen(a)hendersonsoftware.com>:
> Hi, Ben. Thanks for the reponse. My comments below...
>
> On Thu, 1 Apr 2010 11:45:00 UTC, Ben Morrow <ben(a)morrow.me.uk> wrote:
>
> snip
>
> >
> > I don't understand why this is trying to build a file called
> > ParserMK.dll. On my system the shared library is called
> >
> > blib/arch/auto/HTML/Parser/Parser.so
> >
> > (without the 'MK'). Is this usual on OS/2?
>
> I haven't been building Perl modules on OS/2 for very long but from
> what I've seen, the MK is not added to the other dlls I've built.

OK.

> > There should be a section starting
> >
> > XS(boot_HTML_Parser);
> > XS(boot_HTML_Parser)
> > {
> > #ifdef dVAR
> > dVAR; dXSARGS;
> > #else
> > dXSARGS;
> > #endif
>
> This is in the parser.c source file.

OK.

> > in Parser.c. The XS() macro expands into a suitable function prototype.
> > Is it not there? Can you run nm (or some local equivalent) on Parser.o
> > to see if the symbol is defined? Can you post the link line(s) make is
> > trying to use, to make sure it's picking up the right files?
>
> Here is the gcc build command:
>
> gcc -Zdll -Zomf Parser.o -O2 -fomit-frame-pointer -falign-loops=2
> -falign-jump
> s=2 -falign-functions=2 -s -o blib/arch/auto/HTML/Parser/ParserMK.dll
> \
> /perl5/lib/5.10.0/os2/CORE/libperl.a -lsocket
> /perl5/lib/5.10.0/os2/CORE/libpe
> rl_override.a Parser.def \
> || ( U:/PERL5/BIN/PERL.EXE -MExtUtils::Command -e 'rm_f' --
> blib/arch/auto/HTM
> L/Parser/ParserMK.dll && sh -c false )
>
> nm shows the symbol as _boot_HTML__Parser. I'm stumped.

Me too, I'm afraid. Try building some other XS module (List::Util is
provbably a good choice); if that fails in the same way, mail
perl5-porters(a)perl.org; otherwise, file a bug with HTML::Parser.

Ben