libxml2-2.7.8

classic Classic list List threaded Threaded
35 messages Options
12
Reply | Threaded
Open this post in threaded view
|

libxml2-2.7.8

Earnie Boyd
I've been trying to debug why when building as a DLL with gcc-4.6.1 and
binutils-2.21.53.20110804 the libxml2-2.7.8 xmlcatalog was failing to
parse the catalogs delivered in its tests.  The issue is an array table
of 256 char values of 0x00 or 0x01 that defines if a character is XML
valid.  The data in that array is all 0x00 instead of having 0x01 in the
valid character values.  This table resides in the DLL and has been
properly exported and imported by the programs using it.  After much ado
I've found that modifying the optimization from -O2 to -O0 caused the
data values to be correct.  I tried creating a simple test but of course
it doesn't fail like it does with libxml2-2.7.8.

Anyone have any suggestions?  I've already tried -O1 which produced the
same results as -O2.

--
Earnie
-- https://sites.google.com/site/earnieboyd/

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Greg Chicares
On 2011-11-17 19:03Z, Earnie wrote:

> I've been trying to debug why when building as a DLL with gcc-4.6.1 and
> binutils-2.21.53.20110804 the libxml2-2.7.8 xmlcatalog was failing to
> parse the catalogs delivered in its tests.  The issue is an array table
> of 256 char values of 0x00 or 0x01 that defines if a character is XML
> valid.  The data in that array is all 0x00 instead of having 0x01 in the
> valid character values.  This table resides in the DLL and has been
> properly exported and imported by the programs using it.  After much ado
> I've found that modifying the optimization from -O2 to -O0 caused the
> data values to be correct.  I tried creating a simple test but of course
> it doesn't fail like it does with libxml2-2.7.8.
>
> Anyone have any suggestions?  I've already tried -O1 which produced the
> same results as -O2.

I don't know how to make it "just work", but...

0) I'm sure you've googled the [hidden email] mailing list already.

1) Experiment with earlier versions of gcc and libxml. I know I can
build libxml2-2.6.26 with MinGW gcc-3.4.5, for example. Maybe this
gets you to a working version of libxml that's sufficiently modern
to meet your requirements; at least it's a path to narrowing down
where the problem arose.

2) Experiment with spelling out the specific suboptions that are
turned on by '-O1':
  http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
Maybe there's a particular one that causes the problem and can be
selectively turned off without losing too much speed.

3) Modify the source. If the array is const, try making it nonconst.
Or try wrapping it in a function: I've always preferred exporting
and importing functions rather than data (at least at one historical
point that was more robust), and you can use #pragma GCC optimize
on a function.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Earnie Boyd
Greg Chicares wrote:

> On 2011-11-17 19:03Z, Earnie wrote:
>> I've been trying to debug why when building as a DLL with gcc-4.6.1 and
>> binutils-2.21.53.20110804 the libxml2-2.7.8 xmlcatalog was failing to
>> parse the catalogs delivered in its tests.  The issue is an array table
>> of 256 char values of 0x00 or 0x01 that defines if a character is XML
>> valid.  The data in that array is all 0x00 instead of having 0x01 in the
>> valid character values.  This table resides in the DLL and has been
>> properly exported and imported by the programs using it.  After much ado
>> I've found that modifying the optimization from -O2 to -O0 caused the
>> data values to be correct.  I tried creating a simple test but of course
>> it doesn't fail like it does with libxml2-2.7.8.
>>
>> Anyone have any suggestions?  I've already tried -O1 which produced the
>> same results as -O2.
>
> I don't know how to make it "just work", but...
>
> 0) I'm sure you've googled the [hidden email] mailing list already.
>
> 1) Experiment with earlier versions of gcc and libxml. I know I can
> build libxml2-2.6.26 with MinGW gcc-3.4.5, for example. Maybe this
> gets you to a working version of libxml that's sufficiently modern
> to meet your requirements; at least it's a path to narrowing down
> where the problem arose.
>

I'm interested in what works with the currently delivered by mingw-get
and that currently is gcc-4.6.1.  I'm not interested in a workaround
that includes using older software.  Now narrowing the path to find
which version caused the issue to track back to the commit I can
understand but in the meantime what options do I have with 4.6.1?

> 2) Experiment with spelling out the specific suboptions that are
> turned on by '-O1':
>   http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
> Maybe there's a particular one that causes the problem and can be
> selectively turned off without losing too much speed.
>

Yes, I plan to attempt this but after coming up with a minimal test that
fails.  In other words what else in the code caused the array data to be
0x00 for 256 items that didn't cause my already minimal test an issue.

> 3) Modify the source. If the array is const, try making it nonconst.
> Or try wrapping it in a function: I've always preferred exporting
> and importing functions rather than data (at least at one historical
> point that was more robust), and you can use #pragma GCC optimize
> on a function.

Well, modifying the source to print out the array was how I found the
values. :)  I thought about using a function instead of the macro used
now.  But well, it should just work anyway with the data.

Thanks for you hints, it is appreciated.

--
Earnie
-- https://sites.google.com/site/earnieboyd/

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Earnie Boyd
Earnie wrote:

>> 2) Experiment with spelling out the specific suboptions that are
>> turned on by '-O1':
>>   http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
>> Maybe there's a particular one that causes the problem and can be
>> selectively turned off without losing too much speed.
>>
>
> Yes, I plan to attempt this but after coming up with a minimal test that
> fails.  In other words what else in the code caused the array data to be
> 0x00 for 256 items that didn't cause my already minimal test an issue.
>

And of course adding the flags manually as documented[1] for -O1 doesn't
present the issue.  So what happens in an undocumented manner?  Is there
a way to determine that?

[1]http://bit.ly/sF1UdC

--
Earnie
-- https://sites.google.com/site/earnieboyd/

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Charles Wilson-2
In reply to this post by Earnie Boyd
On 11/17/2011 3:17 PM, Earnie wrote:
> I'm interested in what works with the currently delivered by mingw-get
> and that currently is gcc-4.6.1.  I'm not interested in a workaround
> that includes using older software.  Now narrowing the path to find
> which version caused the issue to track back to the commit I can
> understand but in the meantime what options do I have with 4.6.1?

BTW, I think there have been a few bugs fixed recently in binutils that
may affect PE/COFF binaries (I forget the details, but one such fix
prompted a re-release of cygwin gcc IIRC).  Maybe we need to update
mingw32-binutils?

--
Chuck


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Chris Sutcliffe-2
On 17 November 2011 16:36, Charles Wilson wrote:

> On 11/17/2011 3:17 PM, Earnie wrote:
>> I'm interested in what works with the currently delivered by mingw-get
>> and that currently is gcc-4.6.1.  I'm not interested in a workaround
>> that includes using older software.  Now narrowing the path to find
>> which version caused the issue to track back to the commit I can
>> understand but in the meantime what options do I have with 4.6.1?
>
> BTW, I think there have been a few bugs fixed recently in binutils that
> may affect PE/COFF binaries (I forget the details, but one such fix
> prompted a re-release of cygwin gcc IIRC).  Maybe we need to update
> mingw32-binutils?

I believe Tristan plans on making a 2.22 release next week, so I was
planning on waiting until then.  That should contain DaveK's fix I
believe.

Earnie, there has also been some back and forth regarding gcc
optimizations and the MinGW gcc with respect to building GDB.  I'm not
sure if it's related, but if you build with '-fno-omit-frame-pointer'
does it help?

Cheers,

Chris

--
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Earnie Boyd
Chris Sutcliffe wrote:
> Earnie, there has also been some back and forth regarding gcc
> optimizations and the MinGW gcc with respect to building GDB.  I'm not
> sure if it's related, but if you build with '-fno-omit-frame-pointer'
> does it help?

I added -fomit-frame-pointer when I did the individual list that is
documented for -O1 to contain with no issue.  There is definitely a
difference by adding -O1, the objdump -Ss object file source comparison
gives different assembler in the code.  I'll give the
-fno-omit-frame-pointer a try with -O1 to see if it makes a difference.
 I'll also add a -save-temps switch and compare those files.

--
Earnie
-- https://sites.google.com/site/earnieboyd/

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Earnie Boyd
Earnie wrote:

> Chris Sutcliffe wrote:
>> Earnie, there has also been some back and forth regarding gcc
>> optimizations and the MinGW gcc with respect to building GDB.  I'm not
>> sure if it's related, but if you build with '-fno-omit-frame-pointer'
>> does it help?
>
> I added -fomit-frame-pointer when I did the individual list that is
> documented for -O1 to contain with no issue.  There is definitely a
> difference by adding -O1, the objdump -Ss object file source comparison
> gives different assembler in the code.  I'll give the
> -fno-omit-frame-pointer a try with -O1 to see if it makes a difference.
>  I'll also add a -save-temps switch and compare those files.
>
-fno-omit-frame-pointer did not help.

The attached files show the assembler difference between what is
documented as enabled by -O1 specified individually and adding -O1.
Notice the difference for xmlIsPubidChar_tab.

--
Earnie
-- https://sites.google.com/site/earnieboyd/

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe

chvalid.s-with-O.txt (39K) Download Attachment
chvalid.s-without-O.txt (37K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Fabian Greffrath
In reply to this post by Earnie Boyd
Am 18.11.2011 14:36, schrieb Earnie:
> I added -fomit-frame-pointer when I did the individual list that is
> documented for -O1 to contain with no issue.  There is definitely a

Hm, how about "-fno-toplevel-reorder"?

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Greg Chicares
In reply to this post by Earnie Boyd
On 2011-11-18 15:03Z, Earnie wrote:
[...
> The attached files show the assembler difference between what is
> documented as enabled by -O1 specified individually and adding -O1.
> Notice the difference for xmlIsPubidChar_tab.

In these source files (which I guess might match yours) respectively:
  http://doxygen.reactos.org/da/d9c/chvalid_8h_source.html
  http://doxygen.reactos.org/d8/d54/chvalid_8c_source.html
I see:
  XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
            const unsigned char xmlIsPubidChar_tab[256] = {
so I gather that there's an export-import decoration only on the
declaration, not on the definition. A shot in the dark: does it do
what you want if you decorate the definition too? It's been years
since I messed with this stuff, but I seem to recall that some
compilers wanted both to be decorated. I know that's not the
"solution" you want, but it might point to a regression in the
MinGW toolchain and possibly even produce a nice minimal testcase.
Well, like I said, it's just a shot in the dark.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Earnie Boyd
Greg Chicares wrote:

> On 2011-11-18 15:03Z, Earnie wrote:
> [...
>> The attached files show the assembler difference between what is
>> documented as enabled by -O1 specified individually and adding -O1.
>> Notice the difference for xmlIsPubidChar_tab.
>
> In these source files (which I guess might match yours) respectively:
>   http://doxygen.reactos.org/da/d9c/chvalid_8h_source.html
>   http://doxygen.reactos.org/d8/d54/chvalid_8c_source.html
> I see:
>   XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
>             const unsigned char xmlIsPubidChar_tab[256] = {
> so I gather that there's an export-import decoration only on the
> declaration, not on the definition. A shot in the dark: does it do
> what you want if you decorate the definition too? It's been years

Tried that already, no it doesn't matter.

> since I messed with this stuff, but I seem to recall that some
> compilers wanted both to be decorated. I know that's not the

Yea, that is what I thought to but my minimal test works either way.

> "solution" you want, but it might point to a regression in the
> MinGW toolchain and possibly even produce a nice minimal testcase.
> Well, like I said, it's just a shot in the dark.

But it would have been simple enough to convince the maintainers to the
patch.

--
Earnie
-- https://sites.google.com/site/earnieboyd/

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Kai Tietz-2
2011/11/18 Earnie <[hidden email]>:

> Greg Chicares wrote:
>> On 2011-11-18 15:03Z, Earnie wrote:
>> [...
>>> The attached files show the assembler difference between what is
>>> documented as enabled by -O1 specified individually and adding -O1.
>>> Notice the difference for xmlIsPubidChar_tab.
>>
>> In these source files (which I guess might match yours) respectively:
>>   http://doxygen.reactos.org/da/d9c/chvalid_8h_source.html
>>   http://doxygen.reactos.org/d8/d54/chvalid_8c_source.html
>> I see:
>>   XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
>>             const unsigned char xmlIsPubidChar_tab[256] = {
>> so I gather that there's an export-import decoration only on the
>> declaration, not on the definition. A shot in the dark: does it do
>> what you want if you decorate the definition too? It's been years
>
> Tried that already, no it doesn't matter.
>
>> since I messed with this stuff, but I seem to recall that some
>> compilers wanted both to be decorated. I know that's not the
>
> Yea, that is what I thought to but my minimal test works either way.
>
>> "solution" you want, but it might point to a regression in the
>> MinGW toolchain and possibly even produce a nice minimal testcase.
>> Well, like I said, it's just a shot in the dark.
>
> But it would have been simple enough to convince the maintainers to the
> patch.
>
> --
> Earnie
> -- https://sites.google.com/site/earnieboyd/

On a first glance I would see the issue in definition of XMLPUBVAR.
For dll-version build it gets defined to '__declspec(dllexport)'.  So
the declaration in header for the variable becomes a definition
itself, as here no 'extern' is provided.

And this doesn't seem to be a compiler bug AFAICS.

Kai

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Earnie Boyd
In reply to this post by Fabian Greffrath
Fabian Greffrath wrote:
> Am 18.11.2011 14:36, schrieb Earnie:
>> I added -fomit-frame-pointer when I did the individual list that is
>> documented for -O1 to contain with no issue.  There is definitely a
>
> Hm, how about "-fno-toplevel-reorder"?
>

It's not listed in the list for -O1 but trying it did not help.

http://bit.ly/sF1UdC

--
Earnie
-- https://sites.google.com/site/earnieboyd/

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Kai Tietz-2
In reply to this post by Kai Tietz-2
2011/11/18 Kai Tietz <[hidden email]>:

> 2011/11/18 Earnie <[hidden email]>:
>> Greg Chicares wrote:
>>> On 2011-11-18 15:03Z, Earnie wrote:
>>> [...
>>>> The attached files show the assembler difference between what is
>>>> documented as enabled by -O1 specified individually and adding -O1.
>>>> Notice the difference for xmlIsPubidChar_tab.
>>>
>>> In these source files (which I guess might match yours) respectively:
>>>   http://doxygen.reactos.org/da/d9c/chvalid_8h_source.html
>>>   http://doxygen.reactos.org/d8/d54/chvalid_8c_source.html
>>> I see:
>>>   XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
>>>             const unsigned char xmlIsPubidChar_tab[256] = {
>>> so I gather that there's an export-import decoration only on the
>>> declaration, not on the definition. A shot in the dark: does it do
>>> what you want if you decorate the definition too? It's been years
>>
>> Tried that already, no it doesn't matter.
>>
>>> since I messed with this stuff, but I seem to recall that some
>>> compilers wanted both to be decorated. I know that's not the
>>
>> Yea, that is what I thought to but my minimal test works either way.
>>
>>> "solution" you want, but it might point to a regression in the
>>> MinGW toolchain and possibly even produce a nice minimal testcase.
>>> Well, like I said, it's just a shot in the dark.
>>
>> But it would have been simple enough to convince the maintainers to the
>> patch.
>>
>> --
>> Earnie
>> -- https://sites.google.com/site/earnieboyd/
>
> On a first glance I would see the issue in definition of XMLPUBVAR.
> For dll-version build it gets defined to '__declspec(dllexport)'.  So
> the declaration in header for the variable becomes a definition
> itself, as here no 'extern' is provided.
>
> And this doesn't seem to be a compiler bug AFAICS.
>
> Kai

2011/11/18 Kai Tietz <[hidden email]>:

> 2011/11/18 Earnie <[hidden email]>:
>> Greg Chicares wrote:
>>> On 2011-11-18 15:03Z, Earnie wrote:
>>> [...
>>>> The attached files show the assembler difference between what is
>>>> documented as enabled by -O1 specified individually and adding -O1.
>>>> Notice the difference for xmlIsPubidChar_tab.
>>>
>>> In these source files (which I guess might match yours) respectively:
>>>   http://doxygen.reactos.org/da/d9c/chvalid_8h_source.html
>>>   http://doxygen.reactos.org/d8/d54/chvalid_8c_source.html
>>> I see:
>>>   XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
>>>             const unsigned char xmlIsPubidChar_tab[256] = {
>>> so I gather that there's an export-import decoration only on the
>>> declaration, not on the definition. A shot in the dark: does it do
>>> what you want if you decorate the definition too? It's been years
>>
>> Tried that already, no it doesn't matter.
>>
>>> since I messed with this stuff, but I seem to recall that some
>>> compilers wanted both to be decorated. I know that's not the
>>
>> Yea, that is what I thought to but my minimal test works either way.
>>
>>> "solution" you want, but it might point to a regression in the
>>> MinGW toolchain and possibly even produce a nice minimal testcase.
>>> Well, like I said, it's just a shot in the dark.
>>
>> But it would have been simple enough to convince the maintainers to the
>> patch.
>>
>> --
>> Earnie
>> -- https://sites.google.com/site/earnieboyd/
>
> On a first glance I would see the issue in definition of XMLPUBVAR.
> For dll-version build it gets defined to '__declspec(dllexport)'.  So
> the declaration in header for the variable becomes a definition
> itself, as here no 'extern' is provided.
>
> And this doesn't seem to be a compiler bug AFAICS.
>
> Kai

The easiest solution for this is to invent a new macro XMLPUBVAR_DEF
as '#define extern _-declspec(dllexport)' and use it for exported
variables in headers.

For test you could simply prefix in header before the forwarder
declaration of the variable via PUBDEFVAR by

#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
extern
#endif

Kai

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Earnie Boyd
In reply to this post by Kai Tietz-2
Kai Tietz wrote:

> 2011/11/18 Earnie <[hidden email]>:
>> Greg Chicares wrote:
>>> On 2011-11-18 15:03Z, Earnie wrote:
>>> [...
>>>> The attached files show the assembler difference between what is
>>>> documented as enabled by -O1 specified individually and adding -O1.
>>>> Notice the difference for xmlIsPubidChar_tab.
>>>
>>> In these source files (which I guess might match yours) respectively:
>>>   http://doxygen.reactos.org/da/d9c/chvalid_8h_source.html
>>>   http://doxygen.reactos.org/d8/d54/chvalid_8c_source.html
>>> I see:
>>>   XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
>>>             const unsigned char xmlIsPubidChar_tab[256] = {
>>> so I gather that there's an export-import decoration only on the
>>> declaration, not on the definition. A shot in the dark: does it do
>>> what you want if you decorate the definition too? It's been years
>>
>> Tried that already, no it doesn't matter.
>>
>>> since I messed with this stuff, but I seem to recall that some
>>> compilers wanted both to be decorated. I know that's not the
>>
>> Yea, that is what I thought to but my minimal test works either way.
>>
>>> "solution" you want, but it might point to a regression in the
>>> MinGW toolchain and possibly even produce a nice minimal testcase.
>>> Well, like I said, it's just a shot in the dark.
>>
>> But it would have been simple enough to convince the maintainers to the
>> patch.
>>
>
> On a first glance I would see the issue in definition of XMLPUBVAR.
> For dll-version build it gets defined to '__declspec(dllexport)'.  So
> the declaration in header for the variable becomes a definition
> itself, as here no 'extern' is provided.
>
> And this doesn't seem to be a compiler bug AFAICS.
>

I ensured that the calling program does indeed '__declspec(dllimport)
extern' the data.  The point here is the program works if -O0 is used
instead of -O1.  The files I attached earlier, which are pointed to by
Greg, are the files involved with exporting the data from the DLL and
show the difference when I specify the optimization flags that are
documented in GCC docs for -O1 versus specifying -O1.  One would think
that the two generated assembler files should be somewhat more
identical, especially with the assembler calls, and they are not.
Something else is happening when specifying -O1.

XMLPUBVAR is defined as '__declspec(dllexport)' when IN_LIBXML is
defined and is defined as '__declspec(dllimport) extern' when it is not
defined. IN_LIBXML is defined explicitly in the source files that create
the DLL.  The using programs do not define IN_LIBXML.

--
Earnie
-- https://sites.google.com/site/earnieboyd/

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Kai Tietz-2
In reply to this post by Kai Tietz-2
2011/11/18 Kai Tietz <[hidden email]>:

> 2011/11/18 Kai Tietz <[hidden email]>:
>> 2011/11/18 Earnie <[hidden email]>:
>>> Greg Chicares wrote:
>>>> On 2011-11-18 15:03Z, Earnie wrote:
>>>> [...
>>>>> The attached files show the assembler difference between what is
>>>>> documented as enabled by -O1 specified individually and adding -O1.
>>>>> Notice the difference for xmlIsPubidChar_tab.
>>>>
>>>> In these source files (which I guess might match yours) respectively:
>>>>   http://doxygen.reactos.org/da/d9c/chvalid_8h_source.html
>>>>   http://doxygen.reactos.org/d8/d54/chvalid_8c_source.html
>>>> I see:
>>>>   XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
>>>>             const unsigned char xmlIsPubidChar_tab[256] = {
>>>> so I gather that there's an export-import decoration only on the
>>>> declaration, not on the definition. A shot in the dark: does it do
>>>> what you want if you decorate the definition too? It's been years
>>>
>>> Tried that already, no it doesn't matter.
>>>
>>>> since I messed with this stuff, but I seem to recall that some
>>>> compilers wanted both to be decorated. I know that's not the
>>>
>>> Yea, that is what I thought to but my minimal test works either way.
>>>
>>>> "solution" you want, but it might point to a regression in the
>>>> MinGW toolchain and possibly even produce a nice minimal testcase.
>>>> Well, like I said, it's just a shot in the dark.
>>>
>>> But it would have been simple enough to convince the maintainers to the
>>> patch.
>>>
>>> --
>>> Earnie
>>> -- https://sites.google.com/site/earnieboyd/
>>
>> On a first glance I would see the issue in definition of XMLPUBVAR.
>> For dll-version build it gets defined to '__declspec(dllexport)'.  So
>> the declaration in header for the variable becomes a definition
>> itself, as here no 'extern' is provided.
>>
>> And this doesn't seem to be a compiler bug AFAICS.
>>
>> Kai
>
> 2011/11/18 Kai Tietz <[hidden email]>:
>> 2011/11/18 Earnie <[hidden email]>:
>>> Greg Chicares wrote:
>>>> On 2011-11-18 15:03Z, Earnie wrote:
>>>> [...
>>>>> The attached files show the assembler difference between what is
>>>>> documented as enabled by -O1 specified individually and adding -O1.
>>>>> Notice the difference for xmlIsPubidChar_tab.
>>>>
>>>> In these source files (which I guess might match yours) respectively:
>>>>   http://doxygen.reactos.org/da/d9c/chvalid_8h_source.html
>>>>   http://doxygen.reactos.org/d8/d54/chvalid_8c_source.html
>>>> I see:
>>>>   XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
>>>>             const unsigned char xmlIsPubidChar_tab[256] = {
>>>> so I gather that there's an export-import decoration only on the
>>>> declaration, not on the definition. A shot in the dark: does it do
>>>> what you want if you decorate the definition too? It's been years
>>>
>>> Tried that already, no it doesn't matter.
>>>
>>>> since I messed with this stuff, but I seem to recall that some
>>>> compilers wanted both to be decorated. I know that's not the
>>>
>>> Yea, that is what I thought to but my minimal test works either way.
>>>
>>>> "solution" you want, but it might point to a regression in the
>>>> MinGW toolchain and possibly even produce a nice minimal testcase.
>>>> Well, like I said, it's just a shot in the dark.
>>>
>>> But it would have been simple enough to convince the maintainers to the
>>> patch.
>>>
>>> --
>>> Earnie
>>> -- https://sites.google.com/site/earnieboyd/
>>
>> On a first glance I would see the issue in definition of XMLPUBVAR.
>> For dll-version build it gets defined to '__declspec(dllexport)'.  So
>> the declaration in header for the variable becomes a definition
>> itself, as here no 'extern' is provided.
>>
>> And this doesn't seem to be a compiler bug AFAICS.
>>
>> Kai
>
> The easiest solution for this is to invent a new macro XMLPUBVAR_DEF
> as '#define extern _-declspec(dllexport)' and use it for exported
> variables in headers.
>
> For test you could simply prefix in header before the forwarder
> declaration of the variable via PUBDEFVAR by
>
> #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
> extern
> #endif
>
> Kai

Well, correct fix would be to change in libxml/xmlexports.h the line 61
from '     #define XMLPUBVAR __declspec(dllexport)' to '     #define
XMLPUBVAR extern __declspec(dllexport)'

Regards,
Kai

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Kai Tietz-2
In reply to this post by Earnie Boyd
2011/11/18 Earnie <[hidden email]>:
> XMLPUBVAR is defined as '__declspec(dllexport)' when IN_LIBXML is
> defined and is defined as '__declspec(dllimport) extern' when it is not
> defined. IN_LIBXML is defined explicitly in the source files that create
> the DLL.  The using programs do not define IN_LIBXML.

Correct, this is exactly the issue.  The issue caused by the DLL
itself, not by the user.  As each time this header gets included by
the build of the DLL, as much TUs have their own variable (and an
empty one).  This would at least would be a cause why you are seeing
here an empty variable.  But well, maybe there is another issue too in
this library.

It would be interesting to see the export-table of the libxml DLL
itself.  Is there only one export and where it gets bound?  To data or
to bss?

> --
> Earnie

Kai

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Earnie Boyd
Kai Tietz wrote:

> 2011/11/18 Earnie <[hidden email]>:
>> XMLPUBVAR is defined as '__declspec(dllexport)' when IN_LIBXML is
>> defined and is defined as '__declspec(dllimport) extern' when it is not
>> defined. IN_LIBXML is defined explicitly in the source files that create
>> the DLL.  The using programs do not define IN_LIBXML.
>
> Correct, this is exactly the issue.  The issue caused by the DLL
> itself, not by the user.  As each time this header gets included by
> the build of the DLL, as much TUs have their own variable (and an
> empty one).  This would at least would be a cause why you are seeing
> here an empty variable.  But well, maybe there is another issue too in
> this library.
>

So doing:

#define XMLPUBVAR __declspec(dllexport) extern

corrects not only this issue but also removes a warning for another
variable.

> It would be interesting to see the export-table of the libxml DLL
> itself.  Is there only one export and where it gets bound?  To data or
> to bss?
>

How do I determine that?  Thanks Kai for persisting with this; now I'll
be able to provide libxml with a simple patch.

--
Earnie
-- https://sites.google.com/site/earnieboyd/

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

Kai Tietz-2
2011/11/18 Earnie <[hidden email]>:

> Kai Tietz wrote:
>> 2011/11/18 Earnie <[hidden email]>:
>>> XMLPUBVAR is defined as '__declspec(dllexport)' when IN_LIBXML is
>>> defined and is defined as '__declspec(dllimport) extern' when it is not
>>> defined. IN_LIBXML is defined explicitly in the source files that create
>>> the DLL.  The using programs do not define IN_LIBXML.
>>
>> Correct, this is exactly the issue.  The issue caused by the DLL
>> itself, not by the user.  As each time this header gets included by
>> the build of the DLL, as much TUs have their own variable (and an
>> empty one).  This would at least would be a cause why you are seeing
>> here an empty variable.  But well, maybe there is another issue too in
>> this library.
>>
>
> So doing:
>
> #define XMLPUBVAR __declspec(dllexport) extern
>
> corrects not only this issue but also removes a warning for another
> variable.
>
>> It would be interesting to see the export-table of the libxml DLL
>> itself.  Is there only one export and where it gets bound?  To data or
>> to bss?
>>
>
> How do I determine that?

Well, you can look into dump of 'objdump -x' for this DLL and see the
RVA-export for this export.  Then look up section-table in this dump
within what range this RVA is.  It is a bit copious, but well ...

> Thanks Kai for persisting with this; now I'll
> be able to provide libxml with a simple patch.

np

> --
> Earnie
> -- https://sites.google.com/site/earnieboyd/

Kai

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: libxml2-2.7.8

revelator
In reply to this post by Kai Tietz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Have you tried -fno-optimize-sibling-calls ? i took that from the
opensuse wine port and it seems to work.

Ralph
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOxvaoAAoJEIjGvG7Y4HU8OG0H/jJ3yqaRqzQscidR0kqBowgJ
SSv1mV2yKFQjjGBrnFNNPbCpxOzG6ULyB9RrbJ3jPdPGYU3UE9e8Ct8koZy18Ucn
nEV1gWraW1k6ELnApGvAScVNvIgisEDocmCmCV3xEtKc2Z7g0Xw3J51D1Q3EKwQy
oOqFdWe5QsSUVXgpbu038Hgm+cVX7qdt5APOpUgBdPVC26jYfCrKd8vWx7noJYj+
aY4WFh7vlIwSPunINHwM3N6fUXAfLIIg7Pu5BETbsuIqnYkfx6WT7vmt7fxDONYJ
zl6LthWQqUOPEPslBoZlS/C0Pkqyv/lwRdvVbBHadYnIKGE/rT4j6MIUdzJAal0=
=cvMW
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
12