[Box Backup] Cross-compilation with i586-mingw32msvc under Ubuntu Hard

Achim boxbackup@boxbackup.org
Sun, 22 Mar 2009 00:30:19 +0100


Hello Chris:

This time I got a lot further, but there are still some issues. Now the 
linker is complaining about undefined references to `_regfree' et al.

I have used PCRE 6.3 for this compilation, I will try the newer versions 
once we get the original configuration runnning.

Details are included below.

Cheers, Achim


---- snip ----

On 20/3/09 19:44, Chris Wilson wrote:
> Please could you give the output of the "patch" command so that we
> can see if e_os2.h is actually being patched or not?

$ patch -p1 < openssl-0.9.8b-mingw-cross.patch
patching file makefile.one
patching file ms/test.sh
patching file include/openssl/e_os2.h

$ make -f makefile.one
[..]
i586-mingw32msvc-gcc -o tmp/set_key.o  -Ioutinc -Itmp -O 
-DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_KRB5 
-DOPENSSL_NO_DYNAMIC_ENGINE      -c ./crypto/des/set_key.c
./crypto/des/set_key.c:68: error: static declaration of 
‘_hide_DES_check_key’ follows non-static declaration
./crypto/des/set_key.c:68: error: previous declaration of 
‘_hide_DES_check_key’ was here
make: *** [tmp/set_key.o] Error 1

> Please could you try again with trunk?

$ svn co https://www.boxbackup.org/svn/box/trunk/
Checked out revision 2461.

$ cd trunk

(since we don't have a "configure" file, run "./bootstrap")

$ ./bootstrap

$ ./configure --host=i586-mingw32msvc \
	CXXFLAGS="-mthreads -I/usr/local/i586-mingw32msvc/include" \
	LDFLAGS=" -mthreads -L/usr/local/i586-mingw32msvc/lib" \
	LIBS="-lcrypto -lws2_32 -lgdi32"

configure: WARNING: openssl/ssl.h: accepted by the compiler, rejected by 
the preprocessor!
configure: WARNING: openssl/ssl.h: proceeding with the compiler's result
[..]
checking regex.h usability... yes
checking regex.h presence... no
configure: WARNING: regex.h: accepted by the compiler, rejected by the 
preprocessor!
configure: WARNING: regex.h: proceeding with the compiler's result
checking for regex.h... yes
[..]
Regular expressions: yes
Large files:         no
Berkeley DB:         no
Readline:            no
Extended attributes: no

$ make

getopt_long.cpp: In function ‘int getopt_internal(int, char* const*, 
const char*, const option*, int*, int)’:
getopt_long.cpp:340: warning: deprecated conversion from string constant 
to ‘char*’
getopt_long.cpp:359: warning: deprecated conversion from string constant 
to ‘char*’
getopt_long.cpp:397: warning: deprecated conversion from string constant 
to ‘char*’
getopt_long.cpp:429: warning: deprecated conversion from string constant 
to ‘char*’
getopt_long.cpp:456: warning: deprecated conversion from string constant 
to ‘char*’
getopt_long.cpp:465: warning: deprecated conversion from string constant 
to ‘char*’
getopt_long.cpp:478: warning: deprecated conversion from string constant 
to ‘char*’
getopt_long.cpp:494: warning: deprecated conversion from string constant 
to ‘char*’
[..]
   [CXX]     Win32BackupService.cpp
   [CXX]     Win32ServiceFunctions.cpp
Win32ServiceFunctions.cpp:29: warning: deprecated conversion from string 
constant to ‘TCHAR*’
Win32ServiceFunctions.cpp: In function ‘int OurService(const char*)’:
Win32ServiceFunctions.cpp:182: warning: deprecated conversion from 
string constant to ‘CHAR*’
Win32ServiceFunctions.cpp:195: warning: deprecated conversion from 
string constant to ‘char*’
Win32ServiceFunctions.cpp: In function ‘int InstallService(const char*, 
const std::string&)’:
Win32ServiceFunctions.cpp:303: warning: deprecated conversion from 
string constant to ‘CHAR*’
   [CXX]     autogen_ClientException.cpp
   [CXX]     bbackupd.cpp
   [LINK]    ../../release/bin/bbackupd/bbackupd.exe
../../release/lib/common/common.a(ExcludeList.o): In function 
`~ExcludeList':
/usr/src/boxi/trunk/lib/common/ExcludeList.cpp:60: undefined reference 
to `_regfree'
/usr/src/boxi/trunk/lib/common/ExcludeList.cpp:60: undefined reference 
to `_regfree'
../../release/lib/common/common.a(ExcludeList.o):/usr/src/boxi/trunk/lib/common/ExcludeList.cpp:325: 
undefined reference to `_regfree'
../../release/lib/common/common.a(ExcludeList.o):/usr/src/boxi/trunk/lib/common/ExcludeList.cpp:375: 
undefined reference to `_regcomp'
../../release/lib/common/common.a(ExcludeList.o):/usr/src/boxi/trunk/lib/common/ExcludeList.cpp:198: 
undefined reference to `_regcomp'
../../release/lib/common/common.a(ExcludeList.o):/usr/src/boxi/trunk/lib/common/ExcludeList.cpp:203: 
undefined reference to `_regerror'
../../release/lib/common/common.a(ExcludeList.o):/usr/src/boxi/trunk/lib/common/ExcludeList.cpp:266: 
undefined reference to `_regexec'
collect2: ld returned 1 exit status
make[1]: *** [../../release/bin/bbackupd/bbackupd.exe] Error 1
make[1]: Leaving directory `/usr/src/boxi/trunk/bin/bbackupd'
make: *** [release/bin/bbackupd/bbackupd.exe] Error 2


This seems to be a regex/PCRE matter:

$ grep regex config.log
configure:10158: checking regex.h usability
configure:10199: checking regex.h presence
conftest.cpp:35:19: error: regex.h: No such file or directory
| #include <regex.h>
configure:10240: WARNING: regex.h: accepted by the compiler, rejected by 
the preprocessor!
configure:10242: WARNING: regex.h: proceeding with the compiler's result
configure:10267: checking for regex.h
ac_cv_header_regex_h=yes