From ffa6e0c7a575184bc171b72a7ff3715bde460163 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 7 Aug 2015 21:11:13 -0400 Subject: [PATCH] arm-none-eabi --- Configurations/10-main.conf | 20 ++++++++++++++++++++ Configure | 6 +++++- configure-arm-none-eabi.sh | 22 ++++++++++++++++++++++ crypto/pkcs7/bio_pk7.c | 3 ++- e_os.h | 2 +- include/openssl/e_os2.h | 6 ++++++ 6 files changed, 56 insertions(+), 3 deletions(-) mode change 100644 => 100755 Configurations/10-main.conf create mode 100755 configure-arm-none-eabi.sh mode change 100644 => 100755 crypto/pkcs7/bio_pk7.c mode change 100644 => 100755 e_os.h mode change 100644 => 100755 include/openssl/e_os2.h diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf old mode 100644 new mode 100755 index 15af87ea1..401354bff --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -21,6 +21,26 @@ thread_cflag => "(unknown)", }, +### arm-none-eabi Configurations + "arm-none-eabi" => { + inherit_from => [ "gcc" ], + cflags => "-Wall -DOPENSSL_SYS_NONE", + debug_cflags => "-O0 -g -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG", + release_cflags => "-O3", + lflags => "-ldl", + + bn_ops => "BN_LLONG", + + cpuid_obj => "", # TODO?: "armcap.o armv4cpuid.o", + bn_obj => "", # TODO: "bn_asm.o armv4-mont.o armv4-gf2m.o" + ec_obj => "", # TODO: "ecp_nistz256.o ecp_nistz256-armv4.o" + aes_obj => "aes_cbc.o aes-armv4.o bsaes-armv7.o aesv8-armx.o", + sha1_obj => "sha256-armv4.o sha512-armv4.o", + modes_obj => "", # TODO: "ghash-armv4.o ghashv8-armx.o" + + perlasm_scheme => "void", + }, + #### VOS Configurations "vos-gcc" => { cc => "gcc", diff --git a/Configure b/Configure index fb20e85c5..586b28073 100755 --- a/Configure +++ b/Configure @@ -1674,8 +1674,12 @@ while () } } $sdirs = 0 unless /\\$/; - s/fips // if (/^DIRS=/ && !$fips); + s/apps // if (/^DIRS=/ && $disabled{"apps"}); + s/demos // if (/^DIRS=/ && $disabled{"demos"}); s/engines // if (/^DIRS=/ && $disabled{"engine"}); + s/fips // if (/^DIRS=/ && !$fips); + s/ssl // if (/^DIRS=/ && $disabled{"tls1"}); + s/test // if (/^DIRS=/ && $disabled{"test"}); s/ccgost// if (/^ENGDIRS=/ && $disabled{"gost"}); s/^VERSION=.*/VERSION=$version/; s/^MAJOR=.*/MAJOR=$major/; diff --git a/configure-arm-none-eabi.sh b/configure-arm-none-eabi.sh new file mode 100755 index 000000000..aa638fbcf --- /dev/null +++ b/configure-arm-none-eabi.sh @@ -0,0 +1,22 @@ +#!/bin/sh +CC=gcc ./Configure --prefix=build \ + --cross-compile-prefix=arm-none-eabi- \ + no-apps \ + no-bio \ + no-comp \ + no-demos \ + no-des \ + no-dgram \ + no-engine \ + no-rand \ + no-sock \ + no-syslog \ + no-test \ + no-threads \ + no-tls1 \ + no-ui \ + no-x509 \ + arm-none-eabi \ + -mcpu=cortex-m3 \ + -march=armv7-m \ + -mthumb diff --git a/crypto/pkcs7/bio_pk7.c b/crypto/pkcs7/bio_pk7.c old mode 100644 new mode 100755 index 31aef83d5..31c7c40c1 --- a/crypto/pkcs7/bio_pk7.c +++ b/crypto/pkcs7/bio_pk7.c @@ -57,7 +57,8 @@ #include #include -#if !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_VXWORKS) +#if !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_VXWORKS) && \ + !defined(OPENSSL_SYS_NONE) # include #endif #include diff --git a/e_os.h b/e_os.h old mode 100644 new mode 100755 index 4c1b4aa1d..e180db0b7 --- a/e_os.h +++ b/e_os.h @@ -510,7 +510,7 @@ struct servent *PASCAL getservbyname(const char *, const char *); # define SHUTDOWN(fd) { shutdown((fd),0); closesocket(fd); } # define SHUTDOWN2(fd) { shutdown((fd),2); closesocket(fd); } -# else +# elsif !defined(OPENSSL_NO_SOCK) # ifndef NO_SYS_PARAM_H # include diff --git a/include/openssl/e_os2.h b/include/openssl/e_os2.h old mode 100644 new mode 100755 index 177b0981e..1b525677d --- a/include/openssl/e_os2.h +++ b/include/openssl/e_os2.h @@ -70,6 +70,12 @@ extern "C" { # define OPENSSL_SYS_UNIX +/* ---------------------- No Operating System (e.g. arm-none-eabi --------- */ + +# if defined(OPENSSL_SYS_NONE) +# undef OPENSSL_SYS_UNIX +# endif + /* ---------------------- NetWare ----------------------------------------- */ # if defined(NETWARE) && !defined(OPENSSL_SYS_NETWARE) # undef OPENSSL_SYS_UNIX