« Spidermonkey PHP Extension patches | Main | Cyrus SASL Static Plugin Patch »

Jan 20, 2010

FastCGI development kit patches to support WIN64 with several fixes

These patches enable windows 64bit library build of FastCGI Development Kit with Visual Studio 2008 for current snapshot (2.4.1-SNAP-0910052249).

Original tarball is available on the official site: http://www.fastcgi.com/dist/fcgi-2.4.1-SNAP-0910052249.tar.gz

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.

---
HOSHINO Takashi

TrackBack

TrackBack URL for this entry:
http://bb.lekumo.jp/t/trackback/404050/22971491

Listed below are links to weblogs that reference FastCGI development kit patches to support WIN64 with several fixes:

Comments

Post a comment