From c71bb2fb9237de8dbba5f2b8bb6ffe56010310f5 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 11 Feb 2017 16:18:02 +0000 Subject: m68k optimised version of OpenSSL --- .../m68k-unknown-amigaos/crypto.bn.bn_div.c.p | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p (limited to 'sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p') diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p new file mode 100644 index 0000000..0d5492f --- /dev/null +++ b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p @@ -0,0 +1,25 @@ +--- crypto/bn/bn_div.c 2017-01-26 13:22:03.000000000 +0000 ++++ crypto/bn/bn_div.c 2017-02-11 16:06:29.437010335 +0000 +@@ -175,6 +175,22 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, cons + q; \ + }) + # define REMAINDER_IS_ALREADY_CALCULATED ++# elif defined(__mc68020__) ++ /* Same rationale as for i386. On the 68020-60/CPU32 the divu ++ * instruction will take a 64 bit dividend in a register pair ++ * and overwrite that pair with the remainder:quotient. ++ * Howard Chu ++ */ ++# undef bn_div_words ++# define bn_div_words(n0,n1,d0) \ ++ ({ asm volatile ( \ ++ "divu.l %4,%2:%3" \ ++ : "=d"(rem), "=d"(q) \ ++ : "0"(n0), "1"(n1), "d"(d0) \ ++ : "cc"); \ ++ q; \ ++ }) ++# define REMAINDER_IS_ALREADY_CALCULATED + # endif /* __ */ + # endif /* __GNUC__ */ + # endif /* OPENSSL_NO_ASM */ -- cgit v1.2.3 From 944f657356371302cb25a42660e4643d72003b5e Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 23 Nov 2017 13:57:59 +0000 Subject: fix m68k amigaos toolchain build --- m68k-unknown-amigaos/Makefile | 2 +- .../openssl/Configurations-50-amigaos.conf.p | 5 +-- .../m68k-unknown-amigaos/crypto.bio.b_sock2.c.p | 36 ++++++++++++++++++++++ .../m68k-unknown-amigaos/crypto.bn.Makefile.p | 12 -------- .../m68k-unknown-amigaos/crypto.bn.bn_div.c | 25 +++++++++++++++ .../m68k-unknown-amigaos/crypto.bn.bn_div.c.p | 25 --------------- .../m68k-unknown-amigaos/crypto.rand.Makefile.p | 14 --------- .../m68k-unknown-amigaos/crypto.rand.rand_unix.c.p | 11 ------- .../m68k-unknown-amigaos/crypto.ui.ui_openssl.c.p | 21 +++++++++++++ .../m68k-unknown-amigaos/include.openssl.e_os2.h.p | 11 +++++++ .../patches/openssl/m68k-unknown-amigaos/no-term.p | 24 --------------- 11 files changed, 97 insertions(+), 89 deletions(-) create mode 100644 sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bio.b_sock2.c.p delete mode 100644 sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.Makefile.p create mode 100644 sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c delete mode 100644 sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p delete mode 100644 sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.rand.Makefile.p delete mode 100644 sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.rand.rand_unix.c.p create mode 100644 sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.ui.ui_openssl.c.p create mode 100644 sdk/recipes/patches/openssl/m68k-unknown-amigaos/include.openssl.e_os2.h.p delete mode 100644 sdk/recipes/patches/openssl/m68k-unknown-amigaos/no-term.p (limited to 'sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p') diff --git a/m68k-unknown-amigaos/Makefile b/m68k-unknown-amigaos/Makefile index 24d3ff5..cd544b8 100644 --- a/m68k-unknown-amigaos/Makefile +++ b/m68k-unknown-amigaos/Makefile @@ -25,7 +25,7 @@ UPSTREAM_MPC_VERSION := 0.8.2 UPSTREAM_MPC_TARBALL := mpc-$(UPSTREAM_MPC_VERSION).tar.gz UPSTREAM_MPC_URI := http://www.multiprecision.org/mpc/download/$(UPSTREAM_MPC_TARBALL) -UPSTREAM_CLIB2_VERSION := 1_213 +UPSTREAM_CLIB2_VERSION := 1_214 UPSTREAM_CLIB2_TARBALL := V$(UPSTREAM_CLIB2_VERSION).tar.gz UPSTREAM_CLIB2_URI := https://github.com/adtools/clib2/archive/$(UPSTREAM_CLIB2_TARBALL) diff --git a/sdk/recipes/patches/openssl/Configurations-50-amigaos.conf.p b/sdk/recipes/patches/openssl/Configurations-50-amigaos.conf.p index 3a12454..23a635b 100644 --- a/sdk/recipes/patches/openssl/Configurations-50-amigaos.conf.p +++ b/sdk/recipes/patches/openssl/Configurations-50-amigaos.conf.p @@ -1,6 +1,6 @@ --- /dev/null 2017-10-10 15:19:45.611896396 +0100 +++ Configurations/50-amigaos.conf 2017-10-17 15:42:25.304921197 +0100 -@@ -0,0 +1,29 @@ +@@ -0,0 +1,30 @@ +%targets = ( + + "ppc-amigaos" => { @@ -20,11 +20,12 @@ + "m68k-unknown-amigaos" => { + inherit_from => [ "BASE_unix" ], + cc => "m68k-unknown-amigaos-gcc", -+ cflags => picker(default => "-DB_ENDIAN -DTERMIOS -DNO_SYS_UN_H -DNO_SYSLOG -m68020", ++ cflags => picker(default => "-DB_ENDIAN -DTERMIOS -DNO_SYS_UN_H -DNO_SYS_PARAM_H -DNO_SYSLOG -m68020 -std=c99", + debug => "-O0 -g", + release => "-O3 ", + threads("-D_REENTRANT")), + thread_scheme => "(unknown)", ++ ex_libs => add("-lm -lnet"), + sys_id => "AMIGAOS3", + bn_ops => "BN_LLONG", + ranlib => "m68k-unknown-amigaos-ranlib", diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bio.b_sock2.c.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bio.b_sock2.c.p new file mode 100644 index 0000000..1d506af --- /dev/null +++ b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bio.b_sock2.c.p @@ -0,0 +1,36 @@ +--- crypto/bio/b_sock2.c.orig 2017-11-23 12:39:17.912640213 +0000 ++++ crypto/bio/b_sock2.c 2017-11-23 12:41:56.350294762 +0000 +@@ -94,6 +94,7 @@ + } + } + ++#if defined(TCP_NODELAY) + if (options & BIO_SOCK_NODELAY) { + if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) != 0) { + SYSerr(SYS_F_SETSOCKOPT, get_last_socket_error()); +@@ -101,6 +102,7 @@ + return 0; + } + } ++#endif + + if (connect(sock, BIO_ADDR_sockaddr(addr), + BIO_ADDR_sockaddr_size(addr)) == -1) { +--- crypto/bio/b_sock2.c.orig 2017-11-23 12:43:56.318461652 +0000 ++++ crypto/bio/b_sock2.c 2017-11-23 12:44:36.139861658 +0000 +@@ -193,6 +193,7 @@ + } + } + ++#if defined(TCP_NODELAY) + if (options & BIO_SOCK_NODELAY) { + if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) != 0) { + SYSerr(SYS_F_SETSOCKOPT, get_last_socket_error()); +@@ -200,6 +201,7 @@ + return 0; + } + } ++#endif + + # ifdef IPV6_V6ONLY + if ((options & BIO_SOCK_V6_ONLY) && BIO_ADDR_family(addr) == AF_INET6) { diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.Makefile.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.Makefile.p deleted file mode 100644 index 8d3bfc6..0000000 --- a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.Makefile.p +++ /dev/null @@ -1,12 +0,0 @@ ---- crypto/bn/Makefile 2017-01-26 13:22:03.000000000 +0000 -+++ crypto/bn/Makefile 2017-02-11 15:24:31.133017711 +0000 -@@ -60,6 +60,9 @@ lib: $(LIBOBJ) - $(RANLIB) $(LIB) || echo Never mind. - @touch lib - -+bn_m68k.o: asm/bn_m68k.s -+ $(CC) $(CFLAGS) -c -o $@ asm/bn_m68k.s -+ - bn-586.s: asm/bn-586.pl ../perlasm/x86asm.pl - $(PERL) asm/bn-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ - co-586.s: asm/co-586.pl ../perlasm/x86asm.pl diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c new file mode 100644 index 0000000..0d5492f --- /dev/null +++ b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c @@ -0,0 +1,25 @@ +--- crypto/bn/bn_div.c 2017-01-26 13:22:03.000000000 +0000 ++++ crypto/bn/bn_div.c 2017-02-11 16:06:29.437010335 +0000 +@@ -175,6 +175,22 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, cons + q; \ + }) + # define REMAINDER_IS_ALREADY_CALCULATED ++# elif defined(__mc68020__) ++ /* Same rationale as for i386. On the 68020-60/CPU32 the divu ++ * instruction will take a 64 bit dividend in a register pair ++ * and overwrite that pair with the remainder:quotient. ++ * Howard Chu ++ */ ++# undef bn_div_words ++# define bn_div_words(n0,n1,d0) \ ++ ({ asm volatile ( \ ++ "divu.l %4,%2:%3" \ ++ : "=d"(rem), "=d"(q) \ ++ : "0"(n0), "1"(n1), "d"(d0) \ ++ : "cc"); \ ++ q; \ ++ }) ++# define REMAINDER_IS_ALREADY_CALCULATED + # endif /* __ */ + # endif /* __GNUC__ */ + # endif /* OPENSSL_NO_ASM */ diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p deleted file mode 100644 index 0d5492f..0000000 --- a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p +++ /dev/null @@ -1,25 +0,0 @@ ---- crypto/bn/bn_div.c 2017-01-26 13:22:03.000000000 +0000 -+++ crypto/bn/bn_div.c 2017-02-11 16:06:29.437010335 +0000 -@@ -175,6 +175,22 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, cons - q; \ - }) - # define REMAINDER_IS_ALREADY_CALCULATED -+# elif defined(__mc68020__) -+ /* Same rationale as for i386. On the 68020-60/CPU32 the divu -+ * instruction will take a 64 bit dividend in a register pair -+ * and overwrite that pair with the remainder:quotient. -+ * Howard Chu -+ */ -+# undef bn_div_words -+# define bn_div_words(n0,n1,d0) \ -+ ({ asm volatile ( \ -+ "divu.l %4,%2:%3" \ -+ : "=d"(rem), "=d"(q) \ -+ : "0"(n0), "1"(n1), "d"(d0) \ -+ : "cc"); \ -+ q; \ -+ }) -+# define REMAINDER_IS_ALREADY_CALCULATED - # endif /* __ */ - # endif /* __GNUC__ */ - # endif /* OPENSSL_NO_ASM */ diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.rand.Makefile.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.rand.Makefile.p deleted file mode 100644 index 623f599..0000000 --- a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.rand.Makefile.p +++ /dev/null @@ -1,14 +0,0 @@ ---- crypto/rand/Makefile 2017-03-29 18:44:57.752006689 +0100 -+++ crypto/rand/Makefile 2017-03-29 18:45:23.976006610 +0100 -@@ -18,9 +18,9 @@ APPS= - - LIB=$(TOP)/libcrypto.a - LIBSRC=md_rand.c randfile.c rand_lib.c rand_err.c rand_egd.c \ -- rand_win.c rand_unix.c rand_os2.c rand_nw.c -+ rand_win.c rand_unix.c rand_os2.c rand_nw.c rand_amiga.c - LIBOBJ=md_rand.o randfile.o rand_lib.o rand_err.o rand_egd.o \ -- rand_win.o rand_unix.o rand_os2.o rand_nw.o -+ rand_win.o rand_unix.o rand_os2.o rand_nw.o rand_amiga.o - - SRC= $(LIBSRC) - diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.rand.rand_unix.c.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.rand.rand_unix.c.p deleted file mode 100644 index 2caae57..0000000 --- a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.rand.rand_unix.c.p +++ /dev/null @@ -1,11 +0,0 @@ ---- crypto/rand/rand_unix.c 2017-01-26 13:22:03.000000000 +0000 -+++ crypto/rand/rand_unix.c 2017-03-29 17:42:59.932017575 +0100 -@@ -116,7 +116,7 @@ - #include - #include "rand_lcl.h" - --#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)) -+#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_AMIGAOS4) || defined(OPENSSL_SYS_AMIGAOS3)) - - # include - # include diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.ui.ui_openssl.c.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.ui.ui_openssl.c.p new file mode 100644 index 0000000..0448499 --- /dev/null +++ b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.ui.ui_openssl.c.p @@ -0,0 +1,21 @@ +--- crypto/ui/ui_openssl.c.orig 2017-11-23 13:22:15.760078583 +0000 ++++ crypto/ui/ui_openssl.c 2017-11-23 13:21:40.534382076 +0000 +@@ -99,6 +99,18 @@ + + #endif + ++#if defined(OPENSSL_SYS_AMIGAOS3) ++#undef TERMIOS ++#undef TERMIO ++#undef SGTTY ++struct termios { int foo; }; ++# define TTY_STRUCT struct termios ++# define TTY_FLAGS foo ++# define TTY_get(tty,data) /* tcgetattr(tty,data) */ -1 ++# define TTY_set(tty,data) /* tcsetattr(tty,TCSANOW,data) */ 0 ++# define ECHO 0 ++#endif ++ + #ifdef TERMIOS + # include + # define TTY_STRUCT struct termios diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/include.openssl.e_os2.h.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/include.openssl.e_os2.h.p new file mode 100644 index 0000000..6ea1ec8 --- /dev/null +++ b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/include.openssl.e_os2.h.p @@ -0,0 +1,11 @@ +--- include/openssl/e_os2.h.orig 2017-11-21 23:09:39.684814614 +0000 ++++ include/openssl/e_os2.h 2017-11-21 23:10:32.501369938 +0000 +@@ -223,6 +223,8 @@ + # define OSSL_SSIZE_MAX SSIZE_MAX + # elif defined(_POSIX_SSIZE_MAX) + # define OSSL_SSIZE_MAX _POSIX_SSIZE_MAX ++# else ++# define OSSL_SSIZE_MAX INT_MAX + # endif + # endif + diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/no-term.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/no-term.p deleted file mode 100644 index 890cef3..0000000 --- a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/no-term.p +++ /dev/null @@ -1,24 +0,0 @@ ---- crypto/ui/ui_openssl.c.orig 2011-03-08 22:37:51.000000000 +0000 -+++ crypto/ui/ui_openssl.c 2011-03-08 22:39:00.000000000 +0000 -@@ -218,6 +218,12 @@ - - #endif - -+#if defined(OPENSSL_SYS_AMIGAOS3) -+#undef TERMIOS -+#undef TERMIO -+#undef SGTTY -+#endif -+ - #ifdef TERMIOS - # include - # define TTY_STRUCT struct termios -@@ -266,7 +272,7 @@ - typedef int sig_atomic_t; - #endif - --#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(MAC_OS_GUSI_SOURCE) || defined(OPENSSL_SYS_NETWARE) -+#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(MAC_OS_GUSI_SOURCE) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_AMIGAOS3) - /* - * This one needs work. As a matter of fact the code is unoperational - * and this is only a trick to get it compiled. -- cgit v1.2.3 From 1ebcfcb08774c1ddf1d69725376f3088833b30a2 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 23 Jul 2018 23:10:07 +0100 Subject: Wrong file extenson meant bn_div optimisation wasn't being applied. --- .../m68k-unknown-amigaos/crypto.bn.bn_div.c | 25 ---------------------- .../m68k-unknown-amigaos/crypto.bn.bn_div.c.p | 25 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c create mode 100644 sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p (limited to 'sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p') diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c deleted file mode 100644 index 0d5492f..0000000 --- a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c +++ /dev/null @@ -1,25 +0,0 @@ ---- crypto/bn/bn_div.c 2017-01-26 13:22:03.000000000 +0000 -+++ crypto/bn/bn_div.c 2017-02-11 16:06:29.437010335 +0000 -@@ -175,6 +175,22 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, cons - q; \ - }) - # define REMAINDER_IS_ALREADY_CALCULATED -+# elif defined(__mc68020__) -+ /* Same rationale as for i386. On the 68020-60/CPU32 the divu -+ * instruction will take a 64 bit dividend in a register pair -+ * and overwrite that pair with the remainder:quotient. -+ * Howard Chu -+ */ -+# undef bn_div_words -+# define bn_div_words(n0,n1,d0) \ -+ ({ asm volatile ( \ -+ "divu.l %4,%2:%3" \ -+ : "=d"(rem), "=d"(q) \ -+ : "0"(n0), "1"(n1), "d"(d0) \ -+ : "cc"); \ -+ q; \ -+ }) -+# define REMAINDER_IS_ALREADY_CALCULATED - # endif /* __ */ - # endif /* __GNUC__ */ - # endif /* OPENSSL_NO_ASM */ diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p new file mode 100644 index 0000000..0d5492f --- /dev/null +++ b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p @@ -0,0 +1,25 @@ +--- crypto/bn/bn_div.c 2017-01-26 13:22:03.000000000 +0000 ++++ crypto/bn/bn_div.c 2017-02-11 16:06:29.437010335 +0000 +@@ -175,6 +175,22 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, cons + q; \ + }) + # define REMAINDER_IS_ALREADY_CALCULATED ++# elif defined(__mc68020__) ++ /* Same rationale as for i386. On the 68020-60/CPU32 the divu ++ * instruction will take a 64 bit dividend in a register pair ++ * and overwrite that pair with the remainder:quotient. ++ * Howard Chu ++ */ ++# undef bn_div_words ++# define bn_div_words(n0,n1,d0) \ ++ ({ asm volatile ( \ ++ "divu.l %4,%2:%3" \ ++ : "=d"(rem), "=d"(q) \ ++ : "0"(n0), "1"(n1), "d"(d0) \ ++ : "cc"); \ ++ q; \ ++ }) ++# define REMAINDER_IS_ALREADY_CALCULATED + # endif /* __ */ + # endif /* __GNUC__ */ + # endif /* OPENSSL_NO_ASM */ -- cgit v1.2.3