OpenSSL 1.0.2u
#1
OpenSSL 1.0.2u
I've been trying to build this under IRIX 6.2 and CC. It fails with:


Code:
cc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include  -DOPENSSL_THREADS -D_SGI_MP_SOURCE -DDSO_DLFCN -DHAVE_DLFCN_H -n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -c sha256.c
        cc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include  -DOPENSSL_THREADS -D_SGI_MP_SOURCE -DDSO_DLFCN -DHAVE_DLFCN_H -n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -c sha512.c
don't know how to make sha1-mips.o (bu42).


Has anyone else come across this? It's an Indy, hence the mips3. Thanks.
02girl
O2

Trade Count: (0)
Posts: 34
Threads: 6
Joined: May 2020
Find Reply
04-21-2021, 09:21 AM
#2
RE: OpenSSL 1.0.2u
The "don't know how to make" message is coming from 'make' rather than the compiler.  So the actual problem is higher up the toolchain, possibly much earlier than this error message.

Are you using GNU make (if so, which version) or SGI's make (which probably won't work).  What was your "configure" command line for this package and did it report any errors?  I can't tell at this point if it is simply a problem of trying to use a GNU-style Makefile with SGI make or a mis-configuration that caused a faulty Makefile to be created.

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
04-21-2021, 07:44 PM
#3
RE: OpenSSL 1.0.2u
This could also be caused by a buggy config script and on irix I try to make a point nowadays to disable inefficient or insecure ciphers. Does help the build process go faster.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
04-21-2021, 08:26 PM
#4
RE: OpenSSL 1.0.2u
Considering the following defines in use:

Code:
-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM

Code:
don't know how to make sha1-mips.o (bu42).

... the implementation is probably looking for optimized assembly versions of some bits and pieces but there's no sha1-mips.s
jan-jaap
SGI Collector

Trade Count: (0)
Posts: 1,048
Threads: 37
Joined: Jun 2018
Location: Netherlands
Website Find Reply
04-22-2021, 12:46 PM
#5
RE: OpenSSL 1.0.2u
(04-22-2021, 12:46 PM)jan-jaap Wrote:  ... the implementation is probably looking for optimized assembly versions of some bits and pieces but there's no sha1-mips.s

True, but that's a generated file.  So its absence would point to a failure of the configuration process.

OpenSSL ships crypto/sha/sha1-mips.pl which is a Perl script that will spit out the appropriate MIPS assembly for a variety of processors and ABIs.  (The last comment on it in the Git repo is from 6 years ago saying "Fix irix-cc build" so there's reason for optimism!)  My notes from building an earlier OpenSSL release on IRIX 6.5.22 suggest that the system Perl interpreter couldn't handle the scripts and I had to use Perl from Freeware or Nekoware.  Since O2girl is building an even newer OpenSLL on an even older IRIX release, she may need to do likewise.

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
04-22-2021, 03:31 PM
#6
RE: OpenSSL 1.0.2u
Forgot how Irix make is not gmake. Thanks for that. Perl5 from freeware seems to work. I looked for sha1-mips.pl, it's not there, but the failure is now at


Code:
gmake[2]: Entering directory `/usr/people/blah/openssl-1.0.2u/crypto/des'
cc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include  -DOPENSSL_THREADS -D_SGI_MP_SOURCE -DDSO_DLFCN -DHAVE_DLFCN_H -n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM  -c -o set_key.o set_key.c
cc-1143 cc: ERROR File = /usr/include/math.h, Line = 731
  Declaration is incompatible with "char *initstate(unsigned int, char *, int)"
          (declared at line 207 of "/usr/include/stdlib.h").

  extern char * initstate(unsigned int, char *, size_t);
                ^

1 error detected in the compilation of "set_key.c".
gmake[2]: *** [set_key.o] Error 2
02girl
O2

Trade Count: (0)
Posts: 34
Threads: 6
Joined: May 2020
Find Reply
04-23-2021, 06:39 PM
#7
RE: OpenSSL 1.0.2u
(04-23-2021, 06:39 PM)02girl Wrote:  
Code:
extern char * initstate(unsigned int, char *, size_t);

Yeah, at some point in the last 25 years they changed the third arg to initstate from int to size_t - they shouldn't have, but they did. It's a known problem on older versions of IRIX.

Project: Temporarily lost at sea
Plan: World domination! Or something...
vishnu
Tezro, Octane2, 2 x Onyx4

Trade Count: (0)
Posts: 1,245
Threads: 41
Joined: Dec 2017
Location: Minneapolis, Minnesota USA
Find Reply
04-24-2021, 05:32 AM
#8
RE: OpenSSL 1.0.2u
Can I just drop in a stdlib.h from 6.5? And the math lib? Or does this break other things?
02girl
O2

Trade Count: (0)
Posts: 34
Threads: 6
Joined: May 2020
Find Reply
04-30-2021, 05:47 AM
#9
RE: OpenSSL 1.0.2u
(04-30-2021, 05:47 AM)02girl Wrote:  Can I just drop in a stdlib.h from 6.5? And the math lib? Or does this break other things?


I would:

1. See how both are included (math.h and stdlib.h)
2. Check typedef of size_t (should be unsigned long)

Since unsigned long and signed int have different value ranges (because of the sign), do:

3. Check the code you are trying to compile for the type of arguments passed to initstate.
4. Depending on 3., include the signature with int or size_t


Have fun
TruHobbyist
Developer

Trade Count: (0)
Posts: 195
Threads: 21
Joined: May 2018
Find Reply
04-30-2021, 01:13 PM
#10
RE: OpenSSL 1.0.2u
I managed to compile 0.9.8a after a lot of effort. Turns out des has the problem with math.h but you can compile openssl without des. Which breaks ssh1, but who cares. Also found the openssl application won't compile, but the library seems OK for ssh use after a little patching. ECDSA works.
02girl
O2

Trade Count: (0)
Posts: 34
Threads: 6
Joined: May 2020
Find Reply
05-08-2021, 07:48 PM


Forum Jump:


Users browsing this thread: 2 Guest(s)