Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: 0.10.0
    • Component/s: Build
    • Labels:
      None

      Description

      With the initial changes associated with this bug, I've been able to have partial success building log4cxx using MinGW-3.2.0-rc-3. The apr-1.1.0.patch file has been updated to fix issues that were preventing APR from compiling. There were a lot of compile issues related to wide-char locales, streams and consoles. It is likely best to added to utf-8 build initially.

      To attempt a build:

      set path=\mingw\bin;%PATH%
      ant -Dcompiler=gcc -Dhas.wchar_t=0

      Currently thread.cpp will fail with a method doesn't match prototype error on Thread::run (though the method looks exactly like the prototype). If you stub that out by putting a empty body in thread.h and #if'ing the real implementation. You will proceed to link and get a decent number of unsatisified references of Win32 API methods that are apparently not provided by the MinGW libraries. It may be possible to either only build a subset of the appenders or supply the missing methods, but I'm not going to take the time right now.

        Activity

        Hide
        Curt Arnold added a comment -

        Was able to successfully do an autotools build with MSYS 1.0.10, msysDTK 1.0.1 and MinGW 5.1.3 (all from http://www.mingw.org) with a little help from Cygwin since I didn't have python or svn installed under MSYS.

        1. Build APR from trunk. The current APR release 1.2.12 is missing some MinGW specific changes to configure.in, otherwise you will get an "Cannot determine shared memory..." message from configuration.

        Download cppunit-1.12.0.tar.gz and expat-2.0.1.tar.gz and place into MSYS user directory.

        in cygwin:

        cd /cygdrive/c/msys/1.0/home/USERNAME
        svn co https://svn.apache.org/repos/asf/apr/apr/trunk apr
        svn co https://svn.apache.org/repos/asf/apr/apr-util/trunk apr-util
        svn co https://svn.apache.org/repos/asf/logging/log4cxx/trunk log4cxx
        cd apr
        ./buildconf
        cd ../apr-util
        ./buildconf

        If python and svn are installed for MSYS, you could replace the initial cd with "cd ~", the following must be under MSYS

        cd ~/apr
        ./configure
        make install
        cd ..
        tar -xvzf expat-2.0.1.tar.gz
        cd exp*
        ./configure
        make install
        cd ../apr-util
        ./configure --with-apr=/usr/local/apr --with-expat=/usr/local
        make install
        cd ..
        tar -xvzf cppunit-1.12.0.tar.gz
        cd cpp*
        ./configure
        make install
        cd ../log4cxx
        ./autogen.shmake in
        ./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --with-cppunit=/usr/local --with-expat=/usr/local --with-logchar=wchar_t
        make install

        Show
        Curt Arnold added a comment - Was able to successfully do an autotools build with MSYS 1.0.10, msysDTK 1.0.1 and MinGW 5.1.3 (all from http://www.mingw.org ) with a little help from Cygwin since I didn't have python or svn installed under MSYS. 1. Build APR from trunk. The current APR release 1.2.12 is missing some MinGW specific changes to configure.in, otherwise you will get an "Cannot determine shared memory..." message from configuration. Download cppunit-1.12.0.tar.gz and expat-2.0.1.tar.gz and place into MSYS user directory. in cygwin: cd /cygdrive/c/msys/1.0/home/USERNAME svn co https://svn.apache.org/repos/asf/apr/apr/trunk apr svn co https://svn.apache.org/repos/asf/apr/apr-util/trunk apr-util svn co https://svn.apache.org/repos/asf/logging/log4cxx/trunk log4cxx cd apr ./buildconf cd ../apr-util ./buildconf If python and svn are installed for MSYS, you could replace the initial cd with "cd ~", the following must be under MSYS cd ~/apr ./configure make install cd .. tar -xvzf expat-2.0.1.tar.gz cd exp* ./configure make install cd ../apr-util ./configure --with-apr=/usr/local/apr --with-expat=/usr/local make install cd .. tar -xvzf cppunit-1.12.0.tar.gz cd cpp* ./configure make install cd ../log4cxx ./autogen.shmake in ./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --with-cppunit=/usr/local --with-expat=/usr/local --with-logchar=wchar_t make install
        Hide
        Curt Arnold added a comment -

        Using the current CVS head of APR (rev 494236) appears to eliminate almost all compilations problems with MinGW with the exception of the declaration for APR_INT64_C and APR_UINT64_C since gcc does not support the i64 suffix on constants and wants LL instead (which MSVC 6 does not support).

        I have been able to pass unit tests using MSYS and an autotools based build, however it only seems to build a log4cxx static library. I could not find any log4cxx.dll for example in the build tree. I was hoping to use the link commands from that to figure out why the Ant builds continue to fail with unresolved references to library members that appear to be present in the specified libraries.

        The gcclinkerr.tar.gz contains a batch file (and an include/apr.h with the APR_INT64_C change) that should demonstrate the link issues that I'm encountering with MinGW with hopes that someone can tell me what is missing so I can fix the Ant build. To reproduce the problem (in a Windows shell with MinGW's gcc on path):

        svn co http://svn.apache.org/repos/asf/apr/apr/trunk TESTDIR
        cd TESTDIR
        tar -xvzf gcclinkerr.tar.gz
        build.bat

        Should result in a link failure with
        Info: resolving _iob by linking to __imp__iob (auto-import)
        getopt.o(.text+0x49): In function `apr_getopt_init':
        C:/ls-svn/aprfoo/misc/unix/getopt.c:49: variable '_iob' can't be auto-imported.
        Please read the documentation for ld's --enable-auto-import for details.
        filestat.o(.text+0x220): In function `resolve_prot':
        C:/ls-svn/aprfoo/file_io/win32/filestat.c:114: undefined reference to `GetEffect
        iveRightsFromAclW'
        filestat.o(.text+0x29a):C:/ls-svn/aprfoo/file_io/win32/filestat.c:127: undefined
        reference to `GetEffectiveRightsFromAclW'
        filestat.o(.text+0x30c):C:/ls-svn/aprfoo/file_io/win32/filestat.c:135: undefined
        reference to `GetEffectiveRightsFromAclW'
        filestat.o(.text+0x71d): In function `more_finfo':
        C:/ls-svn/aprfoo/file_io/win32/filestat.c:243: undefined reference to `GetNamedS
        ecurityInfoW'
        filestat.o(.text+0x7d3):C:/ls-svn/aprfoo/file_io/win32/filestat.c:253: undefined
        reference to `GetNamedSecurityInfoA'
        filestat.o(.text+0x874):C:/ls-svn/aprfoo/file_io/win32/filestat.c:260: undefined
        reference to `GetSecurityInfo'
        sendrecv.o(.text+0x93f): In function `apr_socket_sendfile':
        C:/ls-svn/aprfoo/network_io/win32/sendrecv.c:367: undefined reference to `Transm
        itFile@28'
        start.o(.text+0x225): In function `apr_app_initialize':
        C:/ls-svn/aprfoo/misc/win32/start.c:119: undefined reference to `CommandLineToAr
        gvW'
        nmth000000.o(.idata$4+0x0): undefined reference to `nm__iob'
        collect2: ld returned 1 exit status

        Show
        Curt Arnold added a comment - Using the current CVS head of APR (rev 494236) appears to eliminate almost all compilations problems with MinGW with the exception of the declaration for APR_INT64_C and APR_UINT64_C since gcc does not support the i64 suffix on constants and wants LL instead (which MSVC 6 does not support). I have been able to pass unit tests using MSYS and an autotools based build, however it only seems to build a log4cxx static library. I could not find any log4cxx.dll for example in the build tree. I was hoping to use the link commands from that to figure out why the Ant builds continue to fail with unresolved references to library members that appear to be present in the specified libraries. The gcclinkerr.tar.gz contains a batch file (and an include/apr.h with the APR_INT64_C change) that should demonstrate the link issues that I'm encountering with MinGW with hopes that someone can tell me what is missing so I can fix the Ant build. To reproduce the problem (in a Windows shell with MinGW's gcc on path): svn co http://svn.apache.org/repos/asf/apr/apr/trunk TESTDIR cd TESTDIR tar -xvzf gcclinkerr.tar.gz build.bat Should result in a link failure with Info: resolving _ iob by linking to __imp __iob (auto-import) getopt.o(.text+0x49): In function `apr_getopt_init': C:/ls-svn/aprfoo/misc/unix/getopt.c:49: variable '_iob' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details. filestat.o(.text+0x220): In function `resolve_prot': C:/ls-svn/aprfoo/file_io/win32/filestat.c:114: undefined reference to `GetEffect iveRightsFromAclW' filestat.o(.text+0x29a):C:/ls-svn/aprfoo/file_io/win32/filestat.c:127: undefined reference to `GetEffectiveRightsFromAclW' filestat.o(.text+0x30c):C:/ls-svn/aprfoo/file_io/win32/filestat.c:135: undefined reference to `GetEffectiveRightsFromAclW' filestat.o(.text+0x71d): In function `more_finfo': C:/ls-svn/aprfoo/file_io/win32/filestat.c:243: undefined reference to `GetNamedS ecurityInfoW' filestat.o(.text+0x7d3):C:/ls-svn/aprfoo/file_io/win32/filestat.c:253: undefined reference to `GetNamedSecurityInfoA' filestat.o(.text+0x874):C:/ls-svn/aprfoo/file_io/win32/filestat.c:260: undefined reference to `GetSecurityInfo' sendrecv.o(.text+0x93f): In function `apr_socket_sendfile': C:/ls-svn/aprfoo/network_io/win32/sendrecv.c:367: undefined reference to `Transm itFile@28' start.o(.text+0x225): In function `apr_app_initialize': C:/ls-svn/aprfoo/misc/win32/start.c:119: undefined reference to `CommandLineToAr gvW' nmth000000.o(.idata$4+0x0): undefined reference to ` nm __iob' collect2: ld returned 1 exit status
        Hide
        Curt Arnold added a comment -

        thread.cpp problem was resolved as issue LOGCXX-116.

        MinGW builds can be attempted using either autotools build with the appropriate MSYS, MSYS-Dev and MinGW or the Ant build which uses the same header file as the Microsoft C++ builds. The autotools builds currently sets logchar to UTF-8 while the Microsoft C++ header file specifies UTF-16. The builds may differ in other ways, but those are currently unknown.

        Removed obsolete check for pthread.h or "Microsoft" threads from configure.in in rev 492712. With that patch, build will process until an unresolved reference errors (apparently missing expat) while linking simplesocketserver. More to follow.

        Show
        Curt Arnold added a comment - thread.cpp problem was resolved as issue LOGCXX-116 . MinGW builds can be attempted using either autotools build with the appropriate MSYS, MSYS-Dev and MinGW or the Ant build which uses the same header file as the Microsoft C++ builds. The autotools builds currently sets logchar to UTF-8 while the Microsoft C++ header file specifies UTF-16. The builds may differ in other ways, but those are currently unknown. Removed obsolete check for pthread.h or "Microsoft" threads from configure.in in rev 492712. With that patch, build will process until an unresolved reference errors (apparently missing expat) while linking simplesocketserver. More to follow.

          People

          • Assignee:
            Curt Arnold
            Reporter:
            Curt Arnold
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development