summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2017-02-11 14:58:43 (GMT)
committer Chris Young <chris@unsatisfactorysoftware.co.uk>2017-02-11 14:58:43 (GMT)
commit042d9f4c0d1dd37d1cfc24413e7c8211f86fe0c8 (patch)
tree634019b325c4c0d18c4ebc85db84149610a5d6d2
parent69bc0ecf5598487fd5c2179d47ea3293ec6b6c04 (diff)
parent3928d1228db27b45e4b2c69ce49febce494d9857 (diff)
downloadtoolchains-042d9f4c0d1dd37d1cfc24413e7c8211f86fe0c8.tar.gz
toolchains-042d9f4c0d1dd37d1cfc24413e7c8211f86fe0c8.tar.bz2
Merge branch 'chris/openssl-ppc'
Optimise AmigaOS 4 OpenSSL build for PowerPC
-rw-r--r--sdk/Makefile7
-rw-r--r--sdk/recipes/patches/openssl/Configure.p2
-rw-r--r--sdk/recipes/patches/openssl/ppc-amigaos/crypto.Makefile.p11
-rw-r--r--sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p35
4 files changed, 53 insertions, 2 deletions
diff --git a/sdk/Makefile b/sdk/Makefile
index 2f8801d..b5a6d29 100644
--- a/sdk/Makefile
+++ b/sdk/Makefile
@@ -90,6 +90,7 @@ ifeq ($(TARGET),arm-unknown-riscos)
SDK_ITEMS := $(addprefix $(BUILDSTEPS)/, $(COMMON_SDK_ITEMS) libjpeg-turbo.d)
EXTRAARGS_LIBCARES := --disable-shared
EXTRAARGS_LIBCURL := --enable-nonblocking --enable-ares --with-random="/dev/urandom" $(LIBCURL_DISABLES)
+ EXTRAARGS_OPENSSL := no-asm
endif
ifeq ($(TARGET),m68k-atari-mint)
@@ -98,6 +99,7 @@ ifeq ($(TARGET),m68k-atari-mint)
EXTRAARGS_LIBCURL := --enable-optimize --enable-nonblocking --enable-ares --with-random="/dev/urandom" --disable-manual --disable-curldebug --disable-thread --disable-threaded-resolver
EXTRAARGS_LIBICONV := --enable-extra-encodings
LIBICONV_ENV := CFLAGS="-DPATH_MAX=1024"
+ EXTRAARGS_OPENSSL := no-asm
endif
ifeq ($(TARGET),m5475-atari-mint)
@@ -106,6 +108,7 @@ ifeq ($(TARGET),m5475-atari-mint)
EXTRAARGS_LIBCURL := --enable-optimize --enable-nonblocking --enable-ares --with-random="/dev/urandom" --disable-manual --disable-curldebug --disable-thread --disable-threaded-resolver
EXTRAARGS_LIBICONV := --enable-extra-encodings
LIBICONV_ENV := CFLAGS="-DPATH_MAX=1024"
+ EXTRAARGS_OPENSSL := no-asm
endif
ifeq ($(TARGET),ppc-amigaos)
@@ -119,6 +122,7 @@ ifeq ($(TARGET),i686-w64-mingw32)
EXTRAARGS_LIBCARES := --disable-shared
EXTRAARGS_LIBCURL := --enable-nonblocking --enable-ares --disable-ldap --without-random
LIBCURL_ENV := CFLAGS="-DCARES_STATICLIB" LIBS="-lgdi32"
+ EXTRAARGS_OPENSSL := no-asm
endif
ifeq ($(TARGET),m68k-unknown-amigaos)
@@ -129,6 +133,7 @@ ifeq ($(TARGET),m68k-unknown-amigaos)
LIBJPEG_ENV := LDFLAGS="-lm"
LIBJPEG_TURBO_ENV := LDFLAGS="-lm"
LIBCURL_ENV := LIBS="-lm"
+ EXTRAARGS_OPENSSL := no-asm
endif
ifeq ($(SDK_ITEMS),)
@@ -339,7 +344,7 @@ $(BUILDSTEPS)/openssl.d: $(BUILDSTEPS)/builddir.d $(BUILDSTEPS)/zlib.d $(BUILDST
ifneq ($(realpath $(RECIPES)/patches/openssl/$(TARGET)),)
for p in `ls $(RECIPES)/patches/openssl/$(TARGET)/*.p` ; do $(PATCH) -d $(BUILDDIR)/openssl/openssl-$(VERSION_OPENSSL) -p0 <$$p ; done
endif
- cd $(BUILDDIR)/openssl/openssl-$(VERSION_OPENSSL) && $(env) ./Configure --prefix=$(GCCSDK_INSTALL_ENV) $(TARGET) no-shared no-asm no-threads
+ cd $(BUILDDIR)/openssl/openssl-$(VERSION_OPENSSL) && $(env) ./Configure --prefix=$(GCCSDK_INSTALL_ENV) $(TARGET) no-shared no-threads $(EXTRAARGS_OPENSSL)
cd $(BUILDDIR)/openssl/openssl-$(VERSION_OPENSSL) && $(env) make install
touch $@
diff --git a/sdk/recipes/patches/openssl/Configure.p b/sdk/recipes/patches/openssl/Configure.p
index 9d4ba20..e9cde6c 100644
--- a/sdk/recipes/patches/openssl/Configure.p
+++ b/sdk/recipes/patches/openssl/Configure.p
@@ -8,7 +8,7 @@
+"m68k-atari-mint","m68k-atari-mint-gcc:-DB_ENDIAN -DTERMIOS -DNO_SYSLOG -DNO_SYS_UN_H -DOPENSSL_USE_IPV6=0 -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG DES_RISC1::::::::::::::::::::m68k-atari-mint-ranlib",
+"m5475-atari-mint","m5475-atari-mint-gcc:-DB_ENDIAN -DTERMIOS -DNO_SYSLOG -DNO_SYS_UN_H -DOPENSSL_USE_IPV6=0 -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG DES_RISC1::::::::::::::::::::m5475-atari-mint-ranlib",
+"m68k-unknown-amigaos","m68k-unknown-amigaos-gcc:-DB_ENDIAN -DOPENSSL_SYS_AMIGAOS3 -DNO_SYSLOG -DHAVE_FORK=0 -DNO_SYS_PARAM_H -DNO_SYS_UN_H -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-lnet -lm:BN_LLONG DES_RISC1::::::::::::::::::::m68k-unknown-amigaos-ranlib",
-+"ppc-amigaos","ppc-amigaos-gcc:-DB_ENDIAN -DOPENSSL_SYS_AMIGAOS4 -DNO_SYSLOG -DHAVE_FORK=0 -DNO_SYS_PARAM_H -DNO_SYS_UN_H -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG DES_RISC1::::::::::::::::::::ppc-amigaos-ranlib",
++"ppc-amigaos","ppc-amigaos-gcc:-DB_ENDIAN -DOPENSSL_SYS_AMIGAOS4 -DNO_SYSLOG -DHAVE_FORK=0 -DNO_SYS_PARAM_H -DNO_SYS_UN_H -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG RC4_CHAR RC4_CHUNK:${ppc32_asm}:linux32::::::ppc-amigaos-ranlib",
+"i686-w64-mingw32", "gcc:-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
+
#### SCO/Caldera targets.
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.Makefile.p b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.Makefile.p
new file mode 100644
index 0000000..3a9bf62
--- a/dev/null
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.Makefile.p
@@ -0,0 +1,11 @@
+--- crypto/Makefile 2017-01-26 13:22:03.000000000 +0000
++++ crypto/Makefile 2017-02-08 00:05:03.883009508 +0000
+@@ -71,7 +71,7 @@ uplink-x86.s: $(TOP)/ms/uplink-x86.pl
+
+ x86_64cpuid.s: x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
+ ia64cpuid.s: ia64cpuid.S; $(CC) $(CFLAGS) -E ia64cpuid.S > $@
+-ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
++ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) > $@
+ pariscid.s: pariscid.pl; $(PERL) pariscid.pl $(PERLASM_SCHEME) $@
+ alphacpuid.s: alphacpuid.pl
+ (preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p
new file mode 100644
index 0000000..eaaab73
--- a/dev/null
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p
@@ -0,0 +1,35 @@
+--- crypto/ppccap.c 2017-01-26 13:22:03.000000000 +0000
++++ crypto/ppccap.c 2017-02-08 17:48:09.982015412 +0000
+@@ -73,6 +73,7 @@ void sha512_block_data_order(void *ctx,
+ sha512_block_ppc(ctx, inp, len);
+ }
+
++#ifndef OPENSSL_SYS_AMIGAOS4
+ static sigjmp_buf ill_jmp;
+ static void ill_handler(int sig)
+ {
+@@ -157,3 +158,24 @@ void OPENSSL_cpuid_setup(void)
+ sigaction(SIGILL, &ill_oact, NULL);
+ sigprocmask(SIG_SETMASK, &oset, NULL);
+ }
++#else
++#include <proto/exec.h>
++void OPENSSL_cpuid_setup(void)
++{
++ uint32 family, vec;
++
++ IExec->GetCPUInfoTags(GCIT_Family, &family, GCIT_VectorUnit, &vec, TAG_DONE);
++
++ OPENSSL_ppccap_P = 0; //PPC_FPU
++
++ if((family == CPUFAMILY_PA6T) || (family == CPUFAMILY_E5500))
++ OPENSSL_ppccap_P |= PPC_FPU64;
++
++ if((vec == VECTORTYPE_ALTIVEC) &&
++ (LIB_IS_AT_LEAST(SysBase, 51, 12)))
++ {
++ OPENSSL_ppccap_P |= PPC_ALTIVEC;
++ }
++}
++#endif
++