[openssl-dev] Building VC-WIN32 with VS2012 and above breaks older CPU compatability

Andy Polyakov appro at openssl.org
Fri Aug 26 21:04:51 UTC 2016


>> When building with Visual Studio 2008 SSE is disabled by default. When
>> building with Visual Studio 2012 and above you must supply a new flag
>> /arch:IA32 to not build with SSE. Would it be acceptable to update the
>> Configure process to add the /arch:IA32 if Visual Studio 2012 or
>> greater is detected? This applies to the normal C code. We ran into
>> issues when running on an AMD Geode processor.
>>
>> I tested changing the VC-32.pl on OpenSSL 1.0.2g and it worked well,
>> but I see the whole build process has changed in Current. I wanted to
>> find out if this is an acceptable change before I figure out the new
>> Configure process and submit a patch.
>>
> 
> Something like this will work
> 
> diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
> index 2838c3d..4b33156 100644
> --- a/Configurations/10-main.conf
> +++ b/Configurations/10-main.conf
> @@ -23,18 +23,24 @@ sub vc_win64a_info {
>  my $vc_win32_info = {};
>  sub vc_win32_info {
>      unless (%$vc_win32_info) {
> +        my $arch="";
> +        if (`nmake /? 2>&1` =~ /Version ([0-9]+\.[0-9]+)/ && $1 >= 11.0) {

If anything one should check for cl version, not nmake.

> +            $arch="/arch:IA32";
> +        }

So suggestion is to impose /arch:ia32 on all users. Well, I personally
have lesser problem with that (as most most performance-critical
assembly code paths will be compiled anyway, processor capabilities
detected at run-time, and inappropriate paths will be avoided), but I'm
not sure if all users would appreciate it. Note that it's possible to
set CL environment variable to add options of your preference without
modifying anything. Maybe that would be more adequate option to
customize builds for specific needs. In worst case it would be
appropriate to tie this option to no-sse2 configuration option, but not
unconditionally...



More information about the openssl-dev mailing list