[FASTCGI] [PATCH] support WIN64 with several fixes.

"星野 喬" hoshino at labs.cybozu.co.jp
Tue Nov 24 23:57:34 EST 2009


Hello,

I posted x64 patch for 2.4.0 several months ago
and now recreated it for current snapshot (2.4.1-SNAP-0910052249).
For convinience, it consists five files attached to thie email.


Each patch description:

1-align-x64.patch
* Fixed functions to support both 32/64 bit build.
  AlignInt8(), AlignPtr8().
  This modification is essential for Windows 64bit build.

2-socklen.patch
* Fixed socklen_t detection failure problem in configure script 
  for Linux.

3-gcc44.patch
* Fixed for gcc-4.4 build on Linux.

4-vc9.patch
* Converted Win32/*.{dsw,dsp} files to Win32/*.{sln,vcproj} files
  (Visual Studio 2008 solution/project files) and
  added platform "x64" for 64bit build.
* Removed almost all build warnings on Visual Studio 2008.
  with PreprocessorDefinitions:
  _CRT_SECURE_NO_WARNINGS and _SCL_SECURE_NO_WARNINGS.

5-build-warnings.patch
* Fixed type size problem (pointer, size_t, etc.)
  to support both 32/64 bit build
  using intptr_t, uintptr_t, etc.
* Fixed to check range of each numeric variable with ASSERT()
  before using type cast for demotion(narrowing).
* Replaced several standard functions to recommended ones.
  getpid() --> _getpid(), and so on.
* Removed almost all build warnings on Linux.


Current status:

* Tested the patches on Windows Server 2008 SP1 (64bit).
  with apache httpd 2.2.14 (32bit) and mod_fastcgi-SNAP-0910052141.
  Both 32/64 bit sample executables are working.
  We could not build and test two samples: threaded and log-dump.
* Tested the patches on CentOS 5.4 (64bit) with gcc-4.3.4.
  For 32bit build, we used gcc -m32 option.
  Both 32/64 bit sample executables are working except log-dump.
  We could not find out the usage of log-dump
  so that we could not test it.


How to build:

1. For Windows

1-1. Extract fastcgi-2.4.1-SNAP-0910052249.tar.gz.

> tar xzf fastcgi-2.4.1-SNAP-0910052249.tar.gz

1-2. Apply patch files.

> cd fastcgi-2.4.1-SNAP-0910052249
> patch -p1 < ../1-align-x64.patch
> patch -p1 < ../2-socklen.patch
> patch -p1 < ../3-gcc44.patch
> patch -p1 < ../4-vc9.patch
> patch -p1 < ../5-build-warnings.patch

1-3. Open fastcgi-2.4.0/Win32/FastCGI.sln with Visual Studio 2008 and build.

Debug and Release build on Win32 and x64 are supported.

Build with 'nmake' is not supported, since we could not find out
suitable project converter and we can use 'devenv' command line instead.

2. For Linux

2-1. Do the same process as (1-1).
2-2. Do the same process as (1-2).

2-3. Remake configure script.

> libtoolize -c -f
> aclocal
> autoheader
> automake -a -c -f
> autoconf

2-4. Configure and make

> ./configure
> make
> make install

If you need, NDEBUG preprocessor definition should be specified
to eliminate ASSERT check for release build.


Sincerely,
Hoshino

---
HOSHINO Takashi <hoshino at labs.cybozu.co.jp>
Cybozu Labs, Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1-align-x64.patch
Type: application/octet-stream
Size: 1036 bytes
Desc: not available
URL: <http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20091125/9c2e6444/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2-socklen.patch
Type: application/octet-stream
Size: 692 bytes
Desc: not available
URL: <http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20091125/9c2e6444/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3-gcc44.patch
Type: application/octet-stream
Size: 258 bytes
Desc: not available
URL: <http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20091125/9c2e6444/attachment-0007.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4-vc9.patch
Type: application/octet-stream
Size: 129953 bytes
Desc: not available
URL: <http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20091125/9c2e6444/attachment-0008.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5-build-warnings.patch
Type: application/octet-stream
Size: 38000 bytes
Desc: not available
URL: <http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20091125/9c2e6444/attachment-0009.obj>


More information about the FastCGI-developers mailing list