You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Zeno Davatz <zd...@gmail.com> on 2011/02/04 17:25:42 UTC

MinGW and Apache

Hi

I got two fundamental questions nobody over at users@apache could answer:

1. Will a module that I compiled using MinGW on Windows load in Apache
2.2.17 that was compiled with nmake?

2. Is there any chance of getting Apache to compile against MinGW on
Windows? Will this be an official goal of the Apache foundation in the
near future?

Thank you for your Feedback.

Best
Zeno

Re: MinGW and Apache

Posted by Zeno Davatz <zd...@gmail.com>.
Dear William

Thank you for your reply.

On Sat, Feb 5, 2011 at 12:26 AM, William A. Rowe Jr.
<wr...@rowe-clan.net> wrote:
> On 2/4/2011 4:58 PM, Zeno Davatz wrote:
>>
>> http://dev.ywesee.com/wiki.php/Apache/Libapr-1
>>
>> The module finally compiles fine _but_ Apache does not start. Apaches
>> tells me that the Module can not be found. But the module is there and
>> it compiled fine. So something seems strange.
>
> Provided that httpd's bin/ dir is in your path (it needs to resolve all
> of the .dll files), you should be able to use the 'depends' utility
> against your module to see what symbols couldn't be resolved or which
> .dll's could not be loaded.  http://www.dependencywalker.com/

Yes, C:\Apache2.2\bin is in my Path.

I got the dependencywalker yesterday but I did not know of
depends.exe.Thank you for the hint! Also I have not yet figured out
how to search within that tool ;). Will do that shortly.

> Couldn't live without it :)  Just be sure to choose 32 or 64 bit flavors
> based on the binaries you are trying to load, there's no one-shoe-fits-all
> binary for depends.exe.

I will check this and get back to you. I am on 32-bit Windows Vista in
Virtualbox 4.0.2 on Gentoo-Linux with Kernel 2.6.37.

Best
Zeno

Re: MinGW and Apache

Posted by Zeno Davatz <zd...@gmail.com>.
On Sat, Feb 5, 2011 at 4:35 PM, Zeno Davatz <zd...@gmail.com> wrote:
> On Sat, Feb 5, 2011 at 12:26 AM, William A. Rowe Jr.
> <wr...@rowe-clan.net> wrote:
>> On 2/4/2011 4:58 PM, Zeno Davatz wrote:
>>>
>>> http://dev.ywesee.com/wiki.php/Apache/Libapr-1
>>>
>>> The module finally compiles fine _but_ Apache does not start. Apaches
>>> tells me that the Module can not be found. But the module is there and
>>> it compiled fine. So something seems strange.
>>
>> Provided that httpd's bin/ dir is in your path (it needs to resolve all
>> of the .dll files), you should be able to use the 'depends' utility
>> against your module to see what symbols couldn't be resolved or which
>> .dll's could not be loaded.  http://www.dependencywalker.com/
>
> Ok, Bingo your hint hit the blackspot! ;) dependencywalker tells me that
>
> Error: At least one required implicit or forwarded dependency was not found.
> Warning: At least one module has an unresolved import due to a missing
> export function in a delay-load dependent module.
>
> Basically it is missing the files: LIBAPR-1C.DLL, LIBAPR-1S.DLL,
> LIBAPRUTIL-1C.DLL, LIBHTTPD-C.DLL, LIBHTTPD-S.DLL
>
> Can I just copy the original DLLs I linked against to the the above
> location as it seems that every .a file needs a corresponding DLL-name
> even though the compilation worked or should I merge my .a (-c and -s)
> files back to one file as described here:

Ok, I done this. Now the error is gone but the Warning is still there:

Warning: At least one module has an unresolved import due to a missing
export function in a delay-load dependent module.

I checked this warning for the other modules as well (i.e. mod_proxy)
and dependency walker shows me this warning for that module as well.

Now I _can_ start Apache from the commandline typing httpd but I
_cannot_ start Apache via the GUI ;/

Best
Zeno

Re: MinGW and Apache

Posted by Zeno Davatz <zd...@gmail.com>.
Dear William

On Sat, Feb 5, 2011 at 12:26 AM, William A. Rowe Jr.
<wr...@rowe-clan.net> wrote:
> On 2/4/2011 4:58 PM, Zeno Davatz wrote:
>>
>> http://dev.ywesee.com/wiki.php/Apache/Libapr-1
>>
>> The module finally compiles fine _but_ Apache does not start. Apaches
>> tells me that the Module can not be found. But the module is there and
>> it compiled fine. So something seems strange.
>
> Provided that httpd's bin/ dir is in your path (it needs to resolve all
> of the .dll files), you should be able to use the 'depends' utility
> against your module to see what symbols couldn't be resolved or which
> .dll's could not be loaded.  http://www.dependencywalker.com/

Ok, Bingo your hint hit the blackspot! ;) dependencywalker tells me that

Error: At least one required implicit or forwarded dependency was not found.
Warning: At least one module has an unresolved import due to a missing
export function in a delay-load dependent module.

Basically it is missing the files: LIBAPR-1C.DLL, LIBAPR-1S.DLL,
LIBAPRUTIL-1C.DLL, LIBHTTPD-C.DLL, LIBHTTPD-S.DLL

Can I just copy the original DLLs I linked against to the the above
location as it seems that every .a file needs a corresponding DLL-name
even though the compilation worked or should I merge my .a (-c and -s)
files back to one file as described here:

http://www.mail-archive.com/dev@apr.apache.org/msg11024.html

Just for the understanding I had to take apart the libapr-1.dll,
libaprutil-1.dll and the libhttpd.dll to make the compilation with
MinGW work via the .a files as described here:
http://dev.ywesee.com/wiki.php/Apache/Libapr-1

Thanks for the support so far. This seems to be not to far away.

Best
Zeno

Re: MinGW and Apache

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 2/4/2011 4:58 PM, Zeno Davatz wrote:
> 
> http://dev.ywesee.com/wiki.php/Apache/Libapr-1
> 
> The module finally compiles fine _but_ Apache does not start. Apaches
> tells me that the Module can not be found. But the module is there and
> it compiled fine. So something seems strange.

Provided that httpd's bin/ dir is in your path (it needs to resolve all
of the .dll files), you should be able to use the 'depends' utility
against your module to see what symbols couldn't be resolved or which
.dll's could not be loaded.  http://www.dependencywalker.com/

Couldn't live without it :)  Just be sure to choose 32 or 64 bit flavors
based on the binaries you are trying to load, there's no one-shoe-fits-all
binary for depends.exe.

RE: MinGW and Apache

Posted by "Plüm, Rüdiger, VF-Group" <ru...@vodafone.com>.
 

> -----Original Message-----
> From: Zeno Davatz [mailto:zdavatz@gmail.com] 
> Sent: Montag, 7. Februar 2011 15:18
> To: dev@httpd.apache.org
> Subject: Re: MinGW and Apache
> 
> Dear Günter
> 
> On Mon, Feb 7, 2011 at 1:53 PM, Guenter Knauf 
> <fu...@apache.org> wrote:
> 
> > Am 07.02.2011 12:06, schrieb Zeno Davatz:
> >>
> >> The above svn Link does not seem to work. I did download 
> the apr from
> >> another svn Link and there I could run buildconf successfully after
> >> installing Python on Windows.
> >>
> >> Configure hung though at some point.
> >
> > yes, I tried it too just now, and for me it broke at the 
> expat check:
> > checking Expat 1.0/1.1... no
> >  adding "-L/usr/local/lib" to LDFLAGS
> >  setting INCLUDES to "-I/usr/local/include"
> > checking Expat 1.95.x in /usr/local... no
> >  removed "-L/usr/local/lib" from LDFLAGS
> >  nulling INCLUDES
> > configuring package in xml/expat now
> > /bin/sh: /home/Administrator/apr/xml/expat/configure: No 
> such file or
> > directory
> > configure failed for xml/expat
> >
> > so we need to tell configure where to look for the expat libary;
> > or just copy over the expat folder from apr-util 1.x to 
> ./xml, then run
> > buildconf inside the expat folder, and try apr configure again ...
> > this worked for me so far, now just trying to compile ...
> 
> "svn co" does not work for me for the above URL. I can not 
> check out any code.

Try http://svn.apache.org/repos/asf/apr/apr/trunk

Regards

Rüdiger

Re: MinGW and Apache

Posted by Zeno Davatz <zd...@gmail.com>.
Dear Günter

On Mon, Feb 7, 2011 at 1:53 PM, Guenter Knauf <fu...@apache.org> wrote:

> Am 07.02.2011 12:06, schrieb Zeno Davatz:
>>
>> The above svn Link does not seem to work. I did download the apr from
>> another svn Link and there I could run buildconf successfully after
>> installing Python on Windows.
>>
>> Configure hung though at some point.
>
> yes, I tried it too just now, and for me it broke at the expat check:
> checking Expat 1.0/1.1... no
>  adding "-L/usr/local/lib" to LDFLAGS
>  setting INCLUDES to "-I/usr/local/include"
> checking Expat 1.95.x in /usr/local... no
>  removed "-L/usr/local/lib" from LDFLAGS
>  nulling INCLUDES
> configuring package in xml/expat now
> /bin/sh: /home/Administrator/apr/xml/expat/configure: No such file or
> directory
> configure failed for xml/expat
>
> so we need to tell configure where to look for the expat libary;
> or just copy over the expat folder from apr-util 1.x to ./xml, then run
> buildconf inside the expat folder, and try apr configure again ...
> this worked for me so far, now just trying to compile ...

"svn co" does not work for me for the above URL. I can not check out any code.

Best
Zeno

Re: MinGW and Apache

Posted by Guenter Knauf <fu...@apache.org>.
Zeno,
Am 07.02.2011 12:06, schrieb Zeno Davatz:
> The above svn Link does not seem to work. I did download the apr from
> another svn Link and there I could run buildconf successfully after
> installing Python on Windows.
>
> Configure hung though at some point.
yes, I tried it too just now, and for me it broke at the expat check:
checking Expat 1.0/1.1... no
   adding "-L/usr/local/lib" to LDFLAGS
   setting INCLUDES to "-I/usr/local/include"
checking Expat 1.95.x in /usr/local... no
   removed "-L/usr/local/lib" from LDFLAGS
   nulling INCLUDES
configuring package in xml/expat now
/bin/sh: /home/Administrator/apr/xml/expat/configure: No such file or 
directory
configure failed for xml/expat

so we need to tell configure where to look for the expat libary;
or just copy over the expat folder from apr-util 1.x to ./xml, then run 
buildconf inside the expat folder, and try apr configure again ...
this worked for me so far, now just trying to compile ...

Gün.



Re: MinGW and Apache

Posted by Zeno Davatz <zd...@gmail.com>.
Dear Günter

On Mon, Feb 7, 2011 at 11:43 AM, Guenter Knauf <fu...@apache.org> wrote:

>> Can you point me to your steps where you done so?
>
> no since I didnt recently; but anyway this has to be done step by step; 1st
> we need to compile APR/APU with MinGW; I think that we did some changes a
> while back so that at least APR 2.0 can be compiled with MinGW, but I'm not
> sure if we changed any 1.x versions too ...
> if I have some spare minutes I give it a try again, and also test how it
> goes with httpd 2.3.x now, but I doubt that this works without
> modifications, and I doubt even more that 2.2.x compiles.
>
> If you want to help with testing I'd suggest that you start with APR 2.0
> which is yet unreleased (no need for APU since we merged APR and APU with
> 2.0), so you have to either work from SVN, or take a snapshot:
> http://svn-master.apache.org/snapshots/apr/
> then just launch latest MSYS bash and call
> ./configure
> any problems should then be posted to the APR list (I saw that you posted
> there already as well)

The above svn Link does not seem to work. I did download the apr from
another svn Link and there I could run buildconf successfully after
installing Python on Windows.

Configure hung though at some point.

I will try to post the error to the apr-List.

Best
Zeno

Re: MinGW and Apache

Posted by Guenter Knauf <fu...@apache.org>.
Hi Zeno,
Am 07.02.2011 11:15, schrieb Zeno Davatz:
>>> On Sat, Feb 5, 2011 at 12:15 AM, Guenter Knauf<fu...@apache.org>    wrote:
>> Again, here I meant to get httpd / APR / APU compiled with MinGW.
>
> Can you point me to your steps where you done so?
no since I didnt recently; but anyway this has to be done step by step; 
1st we need to compile APR/APU with MinGW; I think that we did some 
changes a while back so that at least APR 2.0 can be compiled with 
MinGW, but I'm not sure if we changed any 1.x versions too ...
if I have some spare minutes I give it a try again, and also test how it 
goes with httpd 2.3.x now, but I doubt that this works without 
modifications, and I doubt even more that 2.2.x compiles.

If you want to help with testing I'd suggest that you start with APR 2.0 
which is yet unreleased (no need for APU since we merged APR and APU 
with 2.0), so you have to either work from SVN, or take a snapshot:
http://svn-master.apache.org/snapshots/apr/
then just launch latest MSYS bash and call
./configure
any problems should then be posted to the APR list (I saw that you 
posted there already as well)

Gün.



Re: MinGW and Apache

Posted by Zeno Davatz <zd...@gmail.com>.
Dear Günter

Thank you for your reply.

On Mon, Feb 7, 2011 at 11:01 AM, Guenter Knauf <fu...@apache.org> wrote:

>> On Sat, Feb 5, 2011 at 12:15 AM, Guenter Knauf<fu...@apache.org>  wrote:
>>>
>>> Am 04.02.2011 23:58, schrieb Zeno Davatz:
>>> did you 1st check that your MinGW Apache runs fine without mod_ruby?
>>
>> That is the point I do not yet fully understand. At the moment I am
>> using the default Apache for Windows Version 2.2.17 compiled with
>> Microsoft Visual Studio (normal msi-Installer). But my Ruby and
>> mod_ruby for Windows where both compiled using MinGW-gcc-3.4.5.
>
> this is where I misunderstood you: I thought that you were also tying to get
> httpd / APR / APU compiled with MinGW, and not only mod_ruby.
>
>> I tried that. Does not make a difference. I tried both MinGW-gcc-4.5
>> and MinGW-gcc3.4.5
>
> Here I meant to compile httpd / APR / APU with MSYS/MinGW. I believe that
> now with latest MSYS chances increased that a normal configure build works;
> just a few days back I had to compile binutils for Win32, and while this was
> a pain some years back when I last looked at it now it worked great (though
> this might not only be because of MSYS improvements, but also binutils
> changes).
>
>>>> If you point me towards the people I will try to get in touch to push
>>>> this a bit forward. I am also willing to back it up financially to a
>>>> certain extent.
>>>
>>> I'm interested into it, and you may contact me.
>
> Again, here I meant to get httpd / APR / APU compiled with MinGW.

Can you point me to your steps where you done so?

>> Can you try to follow my steps I listed here and tell me if the Module
>> loads for you at startup?. Actually you can download the mod_ruby.so
>> compiled with MinGW from below link:
>>
>> http://dev.ywesee.com/wiki.php/Apache/Libapr-1
>
> thats not possible since the DLLs you linked against are missing in the
> archive.

Ok, I updated the Makefile. With this Makefile the compilation worked
with MinGW.

https://gist.github.com/814202

I also copied the DLLs according to .a filenames. So my bin directory
now has theses DLLs as well:

libapr-1c.dll
libapr-1s.dll

libhttpd-c.dll
libhttpd-s.dll

libaprutil-1.dll
libaprutil-1c.dll

That made the errors in Dependency-Walker go away.

I am also able to start httpd with mod_ruby.so from the commandline
but not via the GUI. That seems very strange.

Best
Zeno

Re: MinGW and Apache

Posted by Guenter Knauf <fu...@apache.org>.
Hi Zeno,
Am 05.02.2011 10:09, schrieb Zeno Davatz:
> Dear Günter
>
> On Sat, Feb 5, 2011 at 12:15 AM, Guenter Knauf<fu...@apache.org>  wrote:
>> Am 04.02.2011 23:58, schrieb Zeno Davatz:
>> did you 1st check that your MinGW Apache runs fine without mod_ruby?
>
> That is the point I do not yet fully understand. At the moment I am
> using the default Apache for Windows Version 2.2.17 compiled with
> Microsoft Visual Studio (normal msi-Installer). But my Ruby and
> mod_ruby for Windows where both compiled using MinGW-gcc-3.4.5.
this is where I misunderstood you: I thought that you were also tying to 
get httpd / APR / APU compiled with MinGW, and not only mod_ruby.

> I tried that. Does not make a difference. I tried both MinGW-gcc-4.5
> and MinGW-gcc3.4.5
Here I meant to compile httpd / APR / APU with MSYS/MinGW. I believe 
that now with latest MSYS chances increased that a normal configure 
build works; just a few days back I had to compile binutils for Win32, 
and while this was a pain some years back when I last looked at it now 
it worked great (though this might not only be because of MSYS 
improvements, but also binutils changes).

>>> If you point me towards the people I will try to get in touch to push
>>> this a bit forward. I am also willing to back it up financially to a
>>> certain extent.
>>
>> I'm interested into it, and you may contact me.
Again, here I meant to get httpd / APR / APU compiled with MinGW.

> Can you try to follow my steps I listed here and tell me if the Module
> loads for you at startup?. Actually you can download the mod_ruby.so
> compiled with MinGW from below link:
>
> http://dev.ywesee.com/wiki.php/Apache/Libapr-1
thats not possible since the DLLs you linked against are missing in the 
archive.

Gün.



Re: MinGW and Apache

Posted by Zeno Davatz <zd...@gmail.com>.
Dear Günter

On Sat, Feb 5, 2011 at 12:15 AM, Guenter Knauf <fu...@apache.org> wrote:
> Am 04.02.2011 23:58, schrieb Zeno Davatz:
>>
>> I gave it a try (it took some time ;): These are the steps I took to
>> compile mod_ruby.so with MinGW-gcc.3.4.5 against Apache 2.2.17 on
>> Windows.
>>
>> http://dev.ywesee.com/wiki.php/Apache/Libapr-1
>>
>> The module finally compiles fine _but_ Apache does not start. Apaches
>> tells me that the Module can not be found. But the module is there and
>> it compiled fine. So something seems strange.
>>
>> I am grateful for any hints.
>
> did you 1st check that your MinGW Apache runs fine without mod_ruby?

That is the point I do not yet fully understand. At the moment I am
using the default Apache for Windows Version 2.2.17 compiled with
Microsoft Visual Studio (normal msi-Installer). But my Ruby and
mod_ruby for Windows where both compiled using MinGW-gcc-3.4.5.

>> Both Ruby and mod_ruby where compiled with MinGW-gcc-3.4.5.
>
> I would recommend that you get latest MSYS/MinGW which has gcc 4.5 now.

I tried that. Does not make a difference. I tried both MinGW-gcc-4.5
and MinGW-gcc3.4.5

>> If you point me towards the people I will try to get in touch to push
>> this a bit forward. I am also willing to back it up financially to a
>> certain extent.
>
> I'm interested into it, and you may contact me.

Can you try to follow my steps I listed here and tell me if the Module
loads for you at startup?. Actually you can download the mod_ruby.so
compiled with MinGW from below link:

http://dev.ywesee.com/wiki.php/Apache/Libapr-1

Best
Zeno

Re: MinGW and Apache

Posted by Guenter Knauf <fu...@apache.org>.
Hi Zeno,
Am 04.02.2011 23:58, schrieb Zeno Davatz:
> I gave it a try (it took some time ;): These are the steps I took to
> compile mod_ruby.so with MinGW-gcc.3.4.5 against Apache 2.2.17 on
> Windows.
>
> http://dev.ywesee.com/wiki.php/Apache/Libapr-1
>
> The module finally compiles fine _but_ Apache does not start. Apaches
> tells me that the Module can not be found. But the module is there and
> it compiled fine. So something seems strange.
>
> I am grateful for any hints.
did you 1st check that your MinGW Apache runs fine without mod_ruby?

> Both Ruby and mod_ruby where compiled with MinGW-gcc-3.4.5.
I would recommend that you get latest MSYS/MinGW which has gcc 4.5 now.

> If you point me towards the people I will try to get in touch to push
> this a bit forward. I am also willing to back it up financially to a
> certain extent.
I'm interested into it, and you may contact me.

greets, Günter.



Re: MinGW and Apache

Posted by Zeno Davatz <zd...@gmail.com>.
Dear William

Thank you for the reply.

On Fri, Feb 4, 2011 at 7:46 PM, William A. Rowe Jr. <wr...@rowe-clan.net> wrote:

>> I got two fundamental questions nobody over at users@apache could answer:
>>
>> 1. Will a module that I compiled using MinGW on Windows load in Apache
>> 2.2.17 that was compiled with nmake?
>
> It aught to, against a 2.2.17 that uses msvcrt.dll - if it is built for
> msvcr### where ### is another MS fad, then all bets are off, but you should
> give it a try.  If you use only apr functions in that module to alloc/free
> memory, set envvars, or perform file io (no FILE/fd magic) then it should,
> irrespective of which compilers/linkers were used.

I gave it a try (it took some time ;): These are the steps I took to
compile mod_ruby.so with MinGW-gcc.3.4.5 against Apache 2.2.17 on
Windows.

http://dev.ywesee.com/wiki.php/Apache/Libapr-1

The module finally compiles fine _but_ Apache does not start. Apaches
tells me that the Module can not be found. But the module is there and
it compiled fine. So something seems strange.

I am grateful for any hints.

Both Ruby and mod_ruby where compiled with MinGW-gcc-3.4.5.

mod_ruby.so compiled with nmake together with Ruby compiled with nmake
loads just fine in Apache 2.2.17 for Windows.

>> 2. Is there any chance of getting Apache to compile against MinGW on
>> Windows? Will this be an official goal of the Apache foundation in the
>> near future?
>
> We don't have Foundation/project goals in the way you are thinking... but
> there are a few committers who are interested in the subject, none of whom
> have found the time to invest in closing the circle.

If you point me towards the people I will try to get in touch to push
this a bit forward. I am also willing to back it up financially to a
certain extent.

Best
Zeno

Re: MinGW and Apache

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 2/4/2011 10:25 AM, Zeno Davatz wrote:
> Hi
> 
> I got two fundamental questions nobody over at users@apache could answer:
> 
> 1. Will a module that I compiled using MinGW on Windows load in Apache
> 2.2.17 that was compiled with nmake?

It aught to, against a 2.2.17 that uses msvcrt.dll - if it is built for
msvcr### where ### is another MS fad, then all bets are off, but you should
give it a try.  If you use only apr functions in that module to alloc/free
memory, set envvars, or perform file io (no FILE/fd magic) then it should,
irrespective of which compilers/linkers were used.

> 2. Is there any chance of getting Apache to compile against MinGW on
> Windows? Will this be an official goal of the Apache foundation in the
> near future?

We don't have Foundation/project goals in the way you are thinking... but
there are a few committers who are interested in the subject, none of whom
have found the time to invest in closing the circle.