First steps in building with MSVC 14 / Visual Studio 2015

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

First steps in building with MSVC 14 / Visual Studio 2015

Damjan Jovanovic
Hi

I am not just working on the Win64 port, but also had a brief look at
building AOO with the newer MSVC 14 in Visual Studio 2015.

I used Cygwin64 but did a 32 bit AOO build. (You can do that now; my 64 bit
patches fixed the issues we had with Cygwin64 before.)

First step was patching oowintool to detect the new MSVC, by adding its
registry keys, but that wasn't sufficient and I had to use
--with-frame-home, --with-psdk-home, and co. I discovered I have different
MSVC registry keys for 32 bit and 64 bit; oowintool currently looks at the
current bitness keys first and on Cygwin64 falls back to 32 bit keys if
missing, but I think it needs to only look at keys in the AOO bitness.

Then oowintool is called to copy CRT files from MSVC, and needed more
patching copy the right files, with the new version numbers.

It turns out as of MSVC 14, Microsoft requires us link each binary with a
total of 4 C/C++ runtime libraries (https://docs.microsoft.com/en
-us/cpp/c-runtime-library/crt-library-features): the old MSVCRT.LIB which
has now become a CRT initialization library, the old MSVCPRT.LIB which
implements the C++ standard library, the new UCRT.LIB which is their new
C99 standard library, and the new VCRUNTIME.LIB which deals with exception
handling, RTTI and debugging. I guess the small mercy is that we would only
gain runtime dependencies on UCRTBASE.DLL and VCRUNTIME<version>.DLL, the
other 2 are statically linked. I hacked our dmake makefiles to link with
the new libraries by default. We'll also need to update our installer to
install the redistributable versions of these DLLs.

It also turns out that there is now this new Windows development component,
the "Windows Kit" under C:\Program Files (x86)\Windows Kits\<version>, that
you have to use, which contains the C standard header files and UCRT.LIB. I
had to hack SOLARINC and ILIB in my winenv.set.sh to add those, but we
should do that better somehow.

Anyway with those changes the build started. It successfully built a few
modules including ext_libraries/apr, then broke in main/solenv due to
PATH_MAX no longer existing in limits.h, but when I patched that, it
compiled and linked the solenv tools successfully. It broke further, in
ext_libraries/gtest, due to C++ template issues that don't seem easy to
fix. Maybe a newer version of Google Test would help; for now
--disable-unit-tests got me further, then it broke in main/python, which I
am now stuck at.

I don't think porting our code to use MSVC 14 will be that difficult. It
looks like just a few issues at the module level. Python may be hard to
fix, as it is fussy about the CRT libraries (the Python documentation says
it requires MSVCP90).

The patches need refinement before being committed. These "Windows Kits"
needs further research. Also would anyone be interested in helping?

Damjan
Reply | Threaded
Open this post in threaded view
|

Re: First steps in building with MSVC 14 / Visual Studio 2015

Pedro Giffuni
Hi Damjan;

Glad to see this progress! To build python with newer versions of MSVC,
you may have to change the BUILD_DIR to "PCbuild".

Look at main/python/makefile.mk line 125.

Cheers,

Pedro.

ps. As a reminder, the ASF has access to MSDN in case someone wants to help.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: First steps in building with MSVC 14 / Visual Studio 2015

Matthias Seidel
In reply to this post by Damjan Jovanovic
Hi Damjan,

Am 13.03.2018 um 18:15 schrieb Damjan Jovanovic:
> I used Cygwin64 but did a 32 bit AOO build. (You can do that now; my 64 bit
> patches fixed the issues we had with Cygwin64 before.)

I will try that later, I would love to go to Cygwin64 for all my builds...

If it works, we can finally update the MWiki section for Cygwin64:
https://wiki.openoffice.org/wiki/Documentation/Building_Guide_AOO/Step_by_step#Testing_build_with_Cygwin_64_bit

Regards,
   Matthias



smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: First steps in building with MSVC 14 / Visual Studio 2015

Pedro Giffuni
In reply to this post by Pedro Giffuni
Hi again;

On 03/13/18 13:10, Pedro Giffuni wrote:
> Hi Damjan;
>
> Glad to see this progress! To build python with newer versions of
> MSVC, you may have to change the BUILD_DIR to "PCbuild".
>
> Look at main/python/makefile.mk line 125.
>

I committed a small adjustment in r1826694, to clarify better the situation.

I don't have a way of testing the windows build so feel free to revert
if I managed to break things in some spectacular way :-/.

Cheers,

Pedro.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: First steps in building with MSVC 14 / Visual Studio 2015

Matthias Seidel
Hi Pedro,

Am 14.03.2018 um 03:39 schrieb Pedro Giffuni:

> Hi again;
>
> On 03/13/18 13:10, Pedro Giffuni wrote:
>> Hi Damjan;
>>
>> Glad to see this progress! To build python with newer versions of
>> MSVC, you may have to change the BUILD_DIR to "PCbuild".
>>
>> Look at main/python/makefile.mk line 125.
>>
>
> I committed a small adjustment in r1826694, to clarify better the
> situation.
>
> I don't have a way of testing the windows build so feel free to revert
> if I managed to break things in some spectacular way :-/.
My latest builds for Windows (with Cygwin64) were successful. ;-)

If anyone wants to test:
https://home.apache.org/~mseidel/AOO-builds/AOO-420-Test/

Regards,
   Matthias

>
> Cheers,
>
> Pedro.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


smime.p7s (5K) Download Attachment