This document is an outline of the doomsday pitfalls one will encounter
when 32- and 64- bit installations of Apache are attempted within the
same directory structure.

1.      Header files generated at ./configure time.

        The ./configure script for Apache httpd calls the respective
        ./configure scripts for libapr [ $(top_srcdir)/srclib/apr ] and
        libapr-util [ $(top_srcdir)]/srclib/apr-util ]. These scripts
        will generate the following header files from their respective
        *.h.in templates:

        $(top_srcdir)/srclib/apr/include/apr.h.in ->
                $(top_srcdir)/srclib/apr/apr.h
        $(top_srcdir)/srclib/apr-util/include/apu.h.in ->
                $(top_srcdir)/srclib/apr-util/include/apu.h

        Depending on the bitness of the build [ 32- or 64- bit ], the file
        $(top_srcdir)/srclib/apr/apr.h will contain different values for
        the macros it defines [ diff -wu apr.h.32 apr.h.64 ]:

        --- apr.h.32    2007-03-16 01:04:16.000000000 -0400
        +++ apr.h.64    2007-03-13 23:36:57.000000000 -0400
        @@ -262,15 +262,15 @@
        typedef  int             apr_int32_t;
        typedef  unsigned int    apr_uint32_t;
                                                        
        -typedef  long long            apr_int64_t;
        -typedef  unsigned long long   apr_uint64_t;
        +typedef  long            apr_int64_t;
        +typedef  unsigned long   apr_uint64_t;
        
        typedef  size_t          apr_size_t;
        typedef  ssize_t         apr_ssize_t;
        typedef  off_t           apr_off_t;
        typedef  socklen_t       apr_socklen_t;
        
        -#define APR_SIZEOF_VOIDP 4
        +#define APR_SIZEOF_VOIDP 8
        
        /* Are we big endian? */
        #define APR_IS_BIGENDIAN       0
        @@ -344,25 +344,25 @@
        * to find the logic for this definition search for "ssize_t_fmt" in
        * configure.in.
        */
        -#define APR_SSIZE_T_FMT "d"
        +#define APR_SSIZE_T_FMT "ld"
        
        /* And APR_SIZE_T_FMT */
        -#define APR_SIZE_T_FMT "d"
        +#define APR_SIZE_T_FMT "ld"
        
        /* And APR_OFF_T_FMT */
        -#define APR_OFF_T_FMT APR_INT64_T_FMT
        +#define APR_OFF_T_FMT "ld"
        
        /* And APR_PID_T_FMT */
        #define APR_PID_T_FMT "ld"
        
        /* And APR_INT64_T_FMT */
        -#define APR_INT64_T_FMT "lld"
        +#define APR_INT64_T_FMT "ld"
        
        /* And APR_UINT64_T_FMT */
        -#define APR_UINT64_T_FMT "llu"
        +#define APR_UINT64_T_FMT "lu"
        
        /* And APR_UINT64_T_HEX_FMT */
        -#define APR_UINT64_T_HEX_FMT "llx"
        +#define APR_UINT64_T_HEX_FMT "lx"
        
        /* Does the proc mutex lock threads too */
        #define APR_PROC_MUTEX_IS_GLOBAL      0

2.      Makefile include files generated at ./configure time.

        The ./configure script also generates Makefile include files
        [ files to be included by Makefiles ]. In particular, the
        $(top_scrdir)/build directory is relevant to the bitness of the
        build. This directory is a component of the Apache installation,
        and it contains files relevant to the build of Apache modules.

        $(top_srcdir)/build/config_vars.mk

        A fragment of the differences between the 32-bit config_vars.mk
        and the 64-bit config_vars.mk is included here [ for brevity ]:

        --- config_vars.mk.32   2007-03-17 13:36:37.000000000 -0400
        +++ config_vars.mk.64   2007-03-13 23:42:27.000000000 -0400
        @@ -1,21 +1,21 @@
        exp_exec_prefix = /usr/apache2.2
        rel_exec_prefix =
        -exp_bindir = /usr/apache2.2/bin
        -rel_bindir = bin
        -exp_sbindir = /usr/apache2.2/sbin
        -rel_sbindir = sbin
        -exp_libdir = /usr/apache2.2/lib
        -rel_libdir = lib
        -exp_libexecdir = /usr/apache2.2/modules
        -rel_libexecdir = modules
        +exp_bindir = /usr/apache2.2/bin/amd64
        +rel_bindir = bin/amd64
        +exp_sbindir = /usr/apache2.2/sbin/amd64
        +rel_sbindir = sbin/amd64
        +exp_libdir = /usr/apache2.2/lib/amd64
        +rel_libdir = lib/amd64
        +exp_libexecdir = /usr/apache2.2/modules/amd64
        +rel_libexecdir = modules/amd64
        exp_mandir = /usr/apache2.2/man
        rel_mandir = man
        exp_sysconfdir = /etc/apache2.2
        rel_sysconfdir = /etc/apache2.2

        [ ... snip ... ]

        @@ -171,13 +171,13 @@
        prefix = /usr/apache2.2
        AWK = /usr/gnu/bin/amd64/gawk
        CC = /opt/SunStudio-11.0/SUNWspro/prod/bin/c99
        -CPP = /opt/SunStudio-11.0/SUNWspro/prod/bin/c99 -Xc -errshort=full 
-errfmt=error -errwarn=%none -xO3 -s -features=extinl -xjobs=2 
-xregs=no%frameptr -xprefetch=auto -xprefetch_auto_type=indirect_array_access 
-xprefetch_level=3 -xbuiltin=%all -xcsi -xinline=%auto 
-xustr=ascii_utf16_ushort 
-z combreloc -z redlocsym -z nodefaultlib -z now -z rescan -z absexec -xipo=0 
-xldscope=symbolic -xrestrict=%all -xF=%none -xalias_level=std -xsafe=mem 
-xthreadvar -lc -lpthread -lposix4 -lrt -mt -D_REENTRANT -D__EXTENSIONS__=1 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_POSIX_PTHREAD_SEMANTICS 
-D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L -D__XOPEN_OR_POSIX -D_STRICT_STDC 
-D_STRICT_STDC__ -D_STDC_C99 -DAPR_BUCKET_DEBUG=1 -DAPR_RING_DEBUG=1 
-DAPR_POOL_DEBUG=1 -DSOLARIS -DSOLARIS10 -DSOLARIS2=10 -DNDEBUG -KPIC 
-xtarget=pentium4 -xarch=sse2 -xchip=pentium4 -xcache=8/64/4:256/128/8 -xO3 -s 
-E -D_REENTRANT
        +CPP = /opt/SunStudio-11.0/SUNWspro/prod/bin/c99 -Xc -errshort=full 
-errfmt=error -errwarn=%none -xO3 -s -features=extinl -xjobs=2 
-xregs=no%frameptr -xprefetch=auto -xprefetch_auto_type=indirect_array_access 
-xprefetch_level=3 -xbuiltin=%all -xcsi -xinline=%auto 
-xustr=ascii_utf16_ushort 
-z combreloc -z redlocsym -z nodefaultlib -z now -z rescan -z absexec -xipo=0 
-xldscope=symbolic -xrestrict=%all -xF=%none -xalias_level=std -xsafe=mem 
-xthreadvar -lc -lpthread -lposix4 -lrt -mt -D_REENTRANT -D__EXTENSIONS__=1 
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_POSIX_PTHREAD_SEMANTICS 
-D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L -D__XOPEN_OR_POSIX -D_STRICT_STDC 
-D_STRICT_STDC__ -D_STDC_C99 -DAPR_BUCKET_DEBUG=1 -DAPR_RING_DEBUG=1 
-DAPR_POOL_DEBUG=1 -DSOLARIS -DSOLARIS10 -DSOLARIS2=10 -DNDEBUG -KPIC 
-xtarget=opteron -xarch=amd64 -xchip=opteron -xcache=8/64/4:256/128/8 -xO3 -s 
-E 
-D_REENTRANT

3.      Conclusion.

        As demonstrated by the minimal examples above, concurrent bitness
        installations of the Apache httpd server must take into consideration
        the bitness of the build. The construction of the Apache distribution
        is bitness dependent.

--Stefan

-- 
Stefan Teleman
Sun Microsystems, Inc.
Stefan.Teleman at Sun.COM


Reply via email to