[OpenAFS-win32-devel] 64 bit builds

Christian chanlists@googlemail.com
Sat, 23 Jul 2016 23:18:32 +0200


Dear all,

I am still working on finishing a buildbot for Windows. I have a Windows
7 x64 system now where I can compile binary packages for Windows 32 bit,
but not 64 bit. One odd issue is that even for the 32 bit packages, I
need to rename

C:\WinDDK\7600.16385.1\inc\api\sal.h

to tmp.h before the nmake /f NTMakefile install and rename it back
before the nmake /f NTMakefile wix.

The issue with the 64 bit compilation is that it breaks right in the
beginning with

C:\PROGRA~2\MICROS~1.0\VC\include\string.h(81) : warning C4391: 'size_t
strlen(const char *)': Falscher Rckgabetyp fr systeminterne Funktion.
Erwartet: 'unsigned int'
C:\PROGRA~2\MICROS~1.0\VC\include\string.h(254) : warning C4391: 'size_t
wcslen(const wchar_t *)': Falscher Rckgabetyp fr systeminterne
Funktion. Erwartet: 'unsigned int'
    link
/OUT:C:\openafs\OPENAF~1.31\obj\amd64_w2k\free\config\mkvers.exe /DEBUG
/PDB:C:\openafs\OPENAF~1.31\obj\amd64_w2k\free\config\mkvers.pdb 
/INCREMENTAL:NO /NOLOGO -subsystem:console,6.1  /FIXED:NO /VERBOSE:LIB
/MACHINE:AMD64 /MANIFEST kernel32.lib  ws2_32.lib mswsock.lib
advapi32.lib user32.lib version.lib
C:\openafs\OPENAF~1.31\obj\amd64_w2k\free\config\mkvers.obj
C:\openafs\OPENAF~1.31\obj\amd64_w2k\free\config\mkvers.obj : fatal
error LNK1112: Modul-Computertyp "X86" steht in Konflikt mit dem
Zielcomputertyp "x64".
NMAKE : fatal error U1077: "C:\PROGRA~2\MICROS~1.0\VC\bin\link.EXE":
Rückgabe-Code "0x458"
Stop.
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual
Studio 9.0\VC\Bin\amd64\nmake.EXE"": Rückgabe-Code "0x2"
Stop.

Translation: "Module computer type X86 is in conflict with target
computer type x64" is the relevant error message. The machine has VC2008
professional installed, the Windows SDK in version 6.1.5288.17011, the
windows driver kit 7600 and besides that all the recommended packages from

https://github.com/openafs/openafs/blob/master/README-WINDOWS

I compile with:

cd "C:\openafs\"
rd /s /q openafs-1.7.31
"C:\Program Files\7-Zip\7z.exe" x openafs-1.7.31-src.tar
"C:\Program Files\7-Zip\7z.exe" x openafs-1.7.31-doc.tar
copy ntbuild_64.bat "openafs-1.7.31\ntbuild.bat"
cmd /v
cd "openafs-1.7.31"
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" amd64
"C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\setenv.cmd" /2003 /x64
/release
NTBUILD.BAT free
nmake /f NTMakefile install >make_install_log.txt 2>&1

The relevant lines from ntbuild_64.bat are:

REM     SYS_NAME = AFS system name
REM Choose one of "i386_w2k", "amd64_w2k", or "i64_w2k"
SET SYS_NAME=amd64_w2k

REM Specify the minimum version of IE:
REM   0x501 for Windows XP 32 and above
REM   0x502 for Windows XP 64 and Server 2003 and above
SET _WIN32_IE=0x502

REM Specify the minimum version of the Windows SDK:
SET APPVER=6.1

REM C:\openafs\openafs-1.7.31
set AFSROOT=C:\openafs\OPENAF~1.31

REM                  "1500" for VC9 (VS2008)
set AFSVER_CL=1500

REM Location of Microsoft Visual C++ development folder (8.3 short name)
REM C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
set MSVCDIR=C:\PROGRA~2\MICROS~1.0\VC

REM Location of Microsoft Platform SDK (8.3 short name)
REM C:\Program Files\Microsoft SDKs\Windows\v7.0
set MSSDKDIR=C:\PROGRA~1\MICROS~3\Windows\v7.0

REM Location of npapi.h (from DDK or Platform SDK samples - 8.3 short name)
REM C:\WinDDK\7600.16385.1
set NTDDKDIR=C:\WinDDK\760016~1.1

REM Location of Microsoft IDN Normalization SDK
REM C:\Microsoft IDN Mitigation APIs
set MSIDNNLS=C:\MICROS~1

set WIX=c:\tools\wix.2.0.5325
set CYGWINDIR=c:\cygwin64
set PERL=c:\perl64\bin\perl.exe
SET SIGNTOOL=C:\winddk\7600.16385.0\bin\amd64\signtool.exe

If you can provide any advice, that would be great. I can provide
further details if desired. Thanks,

Christian