Re: [openssl-users] mingw 64-bit build of 1.1.0e

2017-03-13 Thread Matt Caswell


On 12/03/17 07:57, sisyph...@optusnet.com.au wrote:
>> But where did it find libz ?
> 
> Heh ... this compiler ships with libz.a (x86_64-w64-mingw32/lib/libz.a).
> I don't know how long they've been doing that - probably for years.
> Remove (or rename) that file and 'make' fails because -lz can't be
> resolved.

You can specify where to find libz with the following Configure options:

  --with-zlib-include=DIR
  --with-zlib-lib=LIB

Check the INSTALL file for details.


Matt

-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] mingw 64-bit build of 1.1.0e

2017-03-12 Thread Richard Levitte
In message <8CD5EEA9CC3F4643AAFC6D7DDF6EB449@OwnerPC311012> on Sun, 12 Mar 2017 
16:15:47 +1100, <sisyph...@optusnet.com.au> said:

sisyphus1> -Original Message- From: Richard Levitte
sisyphus1> Sent: Sunday, March 12, 2017 3:25 PM
sisyphus1> To: openssl-users@openssl.org
sisyphus1> Subject: Re: [openssl-users] mingw 64-bit build of 1.1.0e
sisyphus1> 
sisyphus1> > Just add -m64 on the config line, like this:
sisyphus1> >
sisyphus1> > ./config no-shared zlib -m64 -IC:/_64/msys_630/1.0/local/include \
sisyphus1> > -LC:/_64/msys_630/1.0/local/lib --prefix=C:/_64/msys_630/1.0/local
sisyphus1> >
sisyphus1> > This is weird, though...  what config target did you get when
sisyphus1> > configuring? Ideally, you should have gotten 'mingw64', which 
already
sisyphus1> > uses the -m64 flag, so what gives?  If you show us the config 
output,
sisyphus1> > maybe we can help you figure out what actually goes wrong...
sisyphus1> >
sisyphus1> 
sisyphus1> Hi Richard,
sisyphus1> 
sisyphus1> The command I originally tried was
sisyphus1> ./config no-shared zlib -IC:/_64/msys_630/1.0/local/include
sisyphus1> -LC:/_64/msys_630/1.0/local/lib --prefix=C:/_64/msys_630/1.0/local
sisyphus1> 
sisyphus1> For that command, the config is in the attached conf0.txt.

Thanks for the output, that explains to me what's happening.  More
precisely, these first two lines:

Operating system: x86_64-whatever-mingw
Configuring for mingw

I just had a look in the script 'config', and learned that it doesn't
do anything special with 'x86_64-whatever-mingw', except using its
last part ('mingw') as the target to 'Configure'...  which seems a bit
wrong in my mind, as I would expect (like you've noticed yourself)
that 'mingw64' would be a better target specifically on 'x86_64'.  So
it seems that the 'config' script is a bit lacking, and obviously
unusable in a 64-bit mingw environment.

Time for a fix, methinks.

Cheers,
Richard

-- 
Richard Levitte levi...@openssl.org
OpenSSL Project http://www.openssl.org/~levitte/
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] mingw 64-bit build of 1.1.0e

2017-03-11 Thread sisyphus1



-Original Message- 
From: sisyph...@optusnet.com.au



Did you just try:

perl Configure mingw64 no-shared zlib




Aaah ... that looks better.


[snip]


But where did it find libz ?


Heh ... this compiler ships with libz.a (x86_64-w64-mingw32/lib/libz.a).
I don't know how long they've been doing that - probably for years.
Remove (or rename) that file and 'make' fails because -lz can't be resolved.

Cheers,
Rob 


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] mingw 64-bit build of 1.1.0e

2017-03-11 Thread sisyphus1
-Original Message- 
From: Richard Levitte

Sent: Sunday, March 12, 2017 3:25 PM
To: openssl-users@openssl.org
Subject: Re: [openssl-users] mingw 64-bit build of 1.1.0e


Just add -m64 on the config line, like this:

./config no-shared zlib -m64 -IC:/_64/msys_630/1.0/local/include \
-LC:/_64/msys_630/1.0/local/lib --prefix=C:/_64/msys_630/1.0/local

This is weird, though...  what config target did you get when configuring? 
Ideally, you should have gotten 'mingw64', which already uses the -m64 
flag, so what gives?  If you show us the config output, maybe we can help 
you figure out what actually goes wrong...




Hi Richard,

The command I originally tried was
./config no-shared 
zlib -IC:/_64/msys_630/1.0/local/include -LC:/_64/msys_630/1.0/local/lib --prefix=C:/_64/msys_630/1.0/local


For that command, the config is in the attached conf0.txt.

If I add the '-m64' switch, then the output (see conf1.txt) changes very 
little.
According to diff, the only change is the insertion of '-m64' in the "CFLAG" 
line.


Having included the '-m64' switch, if I then proceed to run 'make', I very 
quickly get a long list of assembler error messages pertaining to push, pop, 
pushf and popf:


crypto/aes/aes-586.s: Assembler messages:
crypto/aes/aes-586.s:969: Error: invalid instruction suffix for `push'
...
crypto/aes/aes-586.s:970: Error: invalid instruction suffix for `pop'
...
crypto/aes/aes-586.s:2233: Error: invalid instruction suffix for `pushf'
...
crypto/aes/aes-586.s:2350: Error: invalid instruction suffix for `popf'
...

(Adding the no-asm switch to ./config works around that particular problem.)

Matt suggested running 'perl Configure mingw64 no-shared zlib'.
The config output for it is in the attached conf2.txt, and is much more in 
keeping with expectations.


I'm quite happy to continue building openssl by running that perl command.
I'm also happy to assist with investigating the problem that led to my 
original post.


Cheers,
Rob

Operating system: x86_64-whatever-mingw
Configuring for mingw
Configuring OpenSSL version 1.1.0e (0x1010005fL)
   no-asan [default]  OPENSSL_NO_ASAN
   no-crypto-mdebug [default]  OPENSSL_NO_CRYPTO_MDEBUG
   no-crypto-mdebug-backtrace [default]  OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
   no-dynamic-engine [forced]
   no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128
   no-egd  [default]  OPENSSL_NO_EGD
   no-fuzz-afl [default]  OPENSSL_NO_FUZZ_AFL
   no-fuzz-libfuzzer [default]  OPENSSL_NO_FUZZ_LIBFUZZER
   no-heartbeats   [default]  OPENSSL_NO_HEARTBEATS
   no-md2  [default]  OPENSSL_NO_MD2 (skip dir)
   no-msan [default]  OPENSSL_NO_MSAN
   no-rc5  [default]  OPENSSL_NO_RC5 (skip dir)
   no-sctp [default]  OPENSSL_NO_SCTP
   no-shared   [option]
   no-ssl-trace[default]  OPENSSL_NO_SSL_TRACE
   no-ssl3 [default]  OPENSSL_NO_SSL3
   no-ssl3-method  [default]  OPENSSL_NO_SSL3_METHOD
   no-ubsan[default]  OPENSSL_NO_UBSAN
   no-unit-test[default]  OPENSSL_NO_UNIT_TEST
   no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS
   no-zlib-dynamic [default]
Configuring for mingw
CC=gcc
CFLAG
   =-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall -O
3 -fomit-frame-pointer -D_MT  -IC:/_64/msys_630/1.0/local/include
SHARED_CFLAG  =-D_WINDLL
DEFINES   =ZLIB DSO_WIN32 NDEBUG OPENSSL_THREADS
OPENSSL_NO_DYNAMIC_ENGINE OPENSSL_PIC OPENSSL_BN_ASM_PART_WORDS
OPENSSL_IA32_SSE2 OPENSSL_BN_ASM_MONT OPENSSL_BN_ASM_GF2m SHA1_ASM
SHA256_ASM SHA512_ASM RC4_ASM MD5_ASM RMD160_ASM AES_ASM VPAES_ASM
WHIRLPOOL_ASM GHASH_ASM ECP_NISTZ256_ASM PADLOCK_ASM POLY1305_ASM
LFLAG =
PLIB_LFLAG=
EX_LIBS
 =-lz -lws2_32 -lgdi32 -lcrypt32 -LC:/_64/msys_630/1.0/local/lib
APPS_OBJ  =win32_init.o
CPUID_OBJ =x86cpuid.o
UPLINK_OBJ=
BN_ASM=bn-586.o co-586.o x86-mont.o x86-gf2m.o
EC_ASM=ecp_nistz256.o ecp_nistz256-x86.o
DES_ENC   =des-586.o crypt586.o
AES_ENC   =aes-586.o vpaes-x86.o aesni-x86.o
BF_ENC=bf-586.o
CAST_ENC  =c_enc.o
RC4_ENC   =rc4-586.o
RC5_ENC   =rc5-586.o
MD5_OBJ_ASM   =md5-586.o
SHA1_OBJ_ASM  =sha1-586.o sha256-586.o sha512-586.o
RMD160_OBJ_ASM=rmd-586.o
CMLL_ENC  =cmll-x86.o
MODES_OBJ =ghash-x86.o
PADLOCK_OBJ   =e_padlock-x86.o
CHACHA_ENC=chacha-x86.o
POLY1305_OBJ  =poly1305-x86.o
BLAKE2_OBJ=
PROCESSOR =
RANLIB=ranlib
ARFLAGS   =
PERL  =/usr/bin/perl

THIRTY_TWO_BIT mode
BN_LLONG mode

Configured for mingw.

Operating system: x86_64-whatever-mingw
Configuring for mingw
Configuring OpenSSL version 1.1.0e (0x1010005fL)
   no-asan [default]  OPENSSL_NO_ASAN
   no-crypto-mdebug [default]  OPENSSL_NO_CRYPTO_MDEBUG
   no-crypto-mdebug-backtrace [default]  OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
   no-dynamic-engine [forced]
   no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128
   no-egd  [default]  OPENSSL_NO_EGD
   no-fuzz-afl   

Re: [openssl-users] mingw 64-bit build of 1.1.0e

2017-03-11 Thread Richard Levitte
Just add -m64 on the config line, like this:

./config no-shared zlib -m64 -IC:/_64/msys_630/1.0/local/include \
-LC:/_64/msys_630/1.0/local/lib --prefix=C:/_64/msys_630/1.0/local

This is weird, though...  what config target did you get when
configuring?  Ideally, you should have gotten 'mingw64', which already
uses the -m64 flag, so what gives?  If you show us the config output,
maybe we can help you figure out what actually goes wrong...

Cheers,
Richard

In message <947E3E0C7B5E4C5A97C3506B97EBC133@OwnerPC311012> on Sat, 11 Mar 2017 
22:21:05 +1100,  said:

sisyphus1> Hi,
sisyphus1> 
sisyphus1> Having a spot of bother trying to build a static openssl-1.1.0e using
sisyphus1> a
sisyphus1> mingw-w64 64-bit compiler - namely, gcc version 6.3.0
sisyphus1> (x86_64-posix-sjlj-rev1, Built by MinGW-W64 project).
sisyphus1> 
sisyphus1> In the msys2 shell, I run:
sisyphus1> 
sisyphus1> ./config no-shared
sisyphus1> zlib -IC:/_64/msys_630/1.0/local/include
sisyphus1> -LC:/_64/msys_630/1.0/local/lib --prefix=C:/_64/msys_630/1.0/local
sisyphus1> && make && make test && make install
sisyphus1> 
sisyphus1> Works beautifully ... except that libssl.a and libcrypto.a turn out 
to
sisyphus1> be
sisyphus1> 32-bit builds !!
sisyphus1> That is, the built library works fine with the same vendor's 32-bit
sisyphus1> compiler
sisyphus1> (gcc version 6.3.0 (i686-posix-sjlj-rev1, Built by MinGW-W64
sisyphus1> project)), but
sisyphus1> the x64 compiler that built the damned things regards them as
sisyphus1> incompatible.
sisyphus1> 
sisyphus1> I'm thinking that I just need to specify an -m64 switch in there. How
sisyphus1> do I
sisyphus1> do that ?
sisyphus1> 
sisyphus1> I did try adding the 'os/compiler:mingw64' to the ./config args, but
sisyphus1> that
sisyphus1> resulted in:
sisyphus1> 
sisyphus1> $ ./config no-shared
sisyphus1> zlib -IC:/_64/msys_630/1.0/local/include
sisyphus1> -LC:/_64/msys_630/1.0/local/lib --prefix=C:/_64/msys_630/1.0/local
sisyphus1> os/compiler:mingw64 && make && make test && make install
sisyphus1> Operating system: x86_64-whatever-mingw
sisyphus1> Configuring for mingw
sisyphus1> Configuring OpenSSL version 1.1.0e (0x1010005fL)
sisyphus1> target already defined - mingw (offending arg: os/compiler:mingw64)
sisyphus1> 
sisyphus1> Having spent quite a few hours just getting to this diagnosis, I've
sisyphus1> now
sisyphus1> settled for simply asking the dumb question.
sisyphus1> (Sorry.)
sisyphus1> 
sisyphus1> Cheers,
sisyphus1> Rob 
sisyphus1> 
sisyphus1> 
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] mingw 64-bit build of 1.1.0e

2017-03-11 Thread sisyphus1
-Original Message- 
From: Matt Caswell

Sent: Sunday, March 12, 2017 11:13 AM
To: openssl-users@openssl.org
Subject: Re: [openssl-users] mingw 64-bit build of 1.1.0e




On 12/03/17 00:06, sisyph...@optusnet.com.au wrote:


Disconcertingly, the summary at the end of ./config still announces 
"THIRTY_TWO_BIT mode" but, at the end of the build, I definitely have the 
X64 libraries that I wanted.


Did you just try:

perl Configure mingw64 no-shared zlib



Aaah ... that looks better.
I now get "SIXTY_FOUR_BIT mode".
And I don't have to do 'no-asm' which (I forgot to mention) I had to do with 
my previous incantation.

Also, I can clear the CC environment variable.

I added '--prefix=C:/_64/msys_630/1.0/local' to ensure that the built 
library would be installed where I wanted it. That, too, worked fine.


But where did it find libz ?
I don't see anything in the command that will point to any of the libz 
installations that I know of.


Thanks, Matt !!

Cheers,
Rob 


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] mingw 64-bit build of 1.1.0e

2017-03-11 Thread Matt Caswell


On 12/03/17 00:06, sisyph...@optusnet.com.au wrote:
> -Original Message- From: sisyph...@optusnet.com.au
> Sent: Saturday, March 11, 2017 10:21 PM
> To: openssl-users@openssl.org
> Subject: [openssl-users] mingw 64-bit build of 1.1.0e
> 
>> In the msys2 shell, I run:
>>
>> ./config no-shared zlib -IC:/_64/msys_630/1.0/local/include
>> -LC:/_64/msys_630/1.0/local/lib --prefix=C:/_64/msys_630/1.0/local &&
>> make && make test && make install
>>
>> Works beautifully ... except that libssl.a and libcrypto.a turn out to
>> be 32-bit builds !!
>> That is, the built library works fine with the same vendor's 32-bit
>> compiler (gcc version 6.3.0 (i686-posix-sjlj-rev1, Built by MinGW-W64
>> project)), but the x64 compiler that built the damned things regards
>> them as incompatible.
>>
>> I'm thinking that I just need to specify an -m64 switch in there. How
>> do I do that ?
> 
> After another couple of hours fossicking about, I did it by firstly
> setting the CC environment variable to 'gcc -m64'. (I would normally do
> that by specifying 'CC="gcc -m64"' as part of the ./config command, but
> ./config found that to be objectionable, so I pre-set it in a separate
> command prior to running ./config.)
> And I added '-m64' as a ./config arg.
> 
> I don't know if *both* of those steps were necessary, but it did the trick.
> 
> Disconcertingly, the summary at the end of ./config still announces
> "THIRTY_TWO_BIT mode" but, at the end of the build, I definitely have
> the X64 libraries that I wanted.

Did you just try:

perl Configure mingw64 no-shared zlib


Matt

-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] mingw 64-bit build of 1.1.0e

2017-03-11 Thread sisyphus1
-Original Message- 
From: sisyph...@optusnet.com.au

Sent: Saturday, March 11, 2017 10:21 PM
To: openssl-users@openssl.org
Subject: [openssl-users] mingw 64-bit build of 1.1.0e


In the msys2 shell, I run:

./config no-shared 
zlib -IC:/_64/msys_630/1.0/local/include -LC:/_64/msys_630/1.0/local/lib --prefix=C:/_64/msys_630/1.0/local 
&& make && make test && make install


Works beautifully ... except that libssl.a and libcrypto.a turn out to be 
32-bit builds !!
That is, the built library works fine with the same vendor's 32-bit 
compiler (gcc version 6.3.0 (i686-posix-sjlj-rev1, Built by MinGW-W64 
project)), but the x64 compiler that built the damned things regards them 
as incompatible.


I'm thinking that I just need to specify an -m64 switch in there. How do I 
do that ?


After another couple of hours fossicking about, I did it by firstly setting 
the CC environment variable to 'gcc -m64'. (I would normally do that by 
specifying 'CC="gcc -m64"' as part of the ./config command, but ./config 
found that to be objectionable, so I pre-set it in a separate command prior 
to running ./config.)

And I added '-m64' as a ./config arg.

I don't know if *both* of those steps were necessary, but it did the trick.

Disconcertingly, the summary at the end of ./config still announces 
"THIRTY_TWO_BIT mode" but, at the end of the build, I definitely have the 
X64 libraries that I wanted.


Cheers,
Rob 


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


[openssl-users] mingw 64-bit build of 1.1.0e

2017-03-11 Thread sisyphus1

Hi,

Having a spot of bother trying to build a static openssl-1.1.0e using a
mingw-w64 64-bit compiler - namely, gcc version 6.3.0
(x86_64-posix-sjlj-rev1, Built by MinGW-W64 project).

In the msys2 shell, I run:

./config no-shared
zlib -IC:/_64/msys_630/1.0/local/include -LC:/_64/msys_630/1.0/local/lib 
--prefix=C:/_64/msys_630/1.0/local
&& make && make test && make install

Works beautifully ... except that libssl.a and libcrypto.a turn out to be
32-bit builds !!
That is, the built library works fine with the same vendor's 32-bit compiler
(gcc version 6.3.0 (i686-posix-sjlj-rev1, Built by MinGW-W64 project)), but
the x64 compiler that built the damned things regards them as incompatible.

I'm thinking that I just need to specify an -m64 switch in there. How do I
do that ?

I did try adding the 'os/compiler:mingw64' to the ./config args, but that
resulted in:

$ ./config no-shared
zlib -IC:/_64/msys_630/1.0/local/include -LC:/_64/msys_630/1.0/local/lib 
--prefix=C:/_64/msys_630/1.0/local
os/compiler:mingw64 && make && make test && make install
Operating system: x86_64-whatever-mingw
Configuring for mingw
Configuring OpenSSL version 1.1.0e (0x1010005fL)
target already defined - mingw (offending arg: os/compiler:mingw64)

Having spent quite a few hours just getting to this diagnosis, I've now
settled for simply asking the dumb question.
(Sorry.)

Cheers,
Rob 


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users