diff options
-rw-r--r-- | .github/workflows/linux.yml | 7 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | crypto/CMakeLists.txt | 2 | ||||
-rw-r--r-- | crypto/Makefile.am | 3 | ||||
-rw-r--r-- | crypto/arch/mips/crypto_arch.h | 21 | ||||
-rw-r--r-- | include/arch/mips/opensslconf.h | 22 | ||||
-rwxr-xr-x | scripts/test | 15 | ||||
-rw-r--r-- | ssl/CMakeLists.txt | 2 | ||||
-rw-r--r-- | ssl/Makefile.am | 3 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/Makefile.am | 2 |
11 files changed, 62 insertions, 19 deletions
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index d57e3bc..8334ae6 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml | |||
@@ -23,7 +23,7 @@ jobs: | |||
23 | fail-fast: false | 23 | fail-fast: false |
24 | matrix: | 24 | matrix: |
25 | os: ["ubuntu-22.04", "ubuntu-24.04"] | 25 | os: ["ubuntu-22.04", "ubuntu-24.04"] |
26 | arch: ["native", "arm32", "arm64", "mingw32", "mingw64", "mips64"] | 26 | arch: ["native", "arm32", "arm64", "mingw32", "mingw64", "mips32", "mips64"] |
27 | compiler: ["gcc"] | 27 | compiler: ["gcc"] |
28 | include: | 28 | include: |
29 | - os: "ubuntu-22.04" | 29 | - os: "ubuntu-22.04" |
@@ -32,12 +32,15 @@ jobs: | |||
32 | - os: "ubuntu-24.04" | 32 | - os: "ubuntu-24.04" |
33 | arch: "native" | 33 | arch: "native" |
34 | compiler: "clang" | 34 | compiler: "clang" |
35 | - os: "ubuntu-24.04" # loong64 | ||
36 | arch: "loong64" | ||
37 | compiler: "gcc" | ||
35 | steps: | 38 | steps: |
36 | - name: "Checkout repository" | 39 | - name: "Checkout repository" |
37 | uses: actions/checkout@v4 | 40 | uses: actions/checkout@v4 |
38 | 41 | ||
39 | - name: "Run tests" | 42 | - name: "Run tests" |
40 | run: ./scripts/test | 43 | run: ./scripts/test || (status=$?; cat tests/test-suite.log; exit $status) |
41 | env: | 44 | env: |
42 | ARCH: "${{ matrix.arch }}" | 45 | ARCH: "${{ matrix.arch }}" |
43 | CC: "${{ matrix.compiler }}" | 46 | CC: "${{ matrix.compiler }}" |
@@ -239,6 +239,8 @@ include/openssl/*.h | |||
239 | 239 | ||
240 | /crypto/* | 240 | /crypto/* |
241 | !/crypto/Makefile.am.* | 241 | !/crypto/Makefile.am.* |
242 | !/crypto/arch/ | ||
243 | !/crypto/arch/mips/* | ||
242 | !/crypto/compat/ | 244 | !/crypto/compat/ |
243 | /crypto/compat/* | 245 | /crypto/compat/* |
244 | !/crypto/compat/arc4random.h | 246 | !/crypto/compat/arc4random.h |
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index a714059..64bccd8 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt | |||
@@ -781,7 +781,7 @@ elseif(HOST_MIPS64) | |||
781 | target_include_directories(crypto_obj PRIVATE arch/mips64) | 781 | target_include_directories(crypto_obj PRIVATE arch/mips64) |
782 | target_include_directories(crypto_obj PRIVATE bn/arch/mips64) | 782 | target_include_directories(crypto_obj PRIVATE bn/arch/mips64) |
783 | elseif(HOST_MIPS) | 783 | elseif(HOST_MIPS) |
784 | # XXX - can this go away? the directory doesn't exist... | 784 | target_include_directories(crypto_obj PRIVATE arch/mips) |
785 | target_include_directories(crypto_obj PRIVATE bn/arch/mips) | 785 | target_include_directories(crypto_obj PRIVATE bn/arch/mips) |
786 | elseif(HOST_POWERPC) | 786 | elseif(HOST_POWERPC) |
787 | target_include_directories(crypto_obj PRIVATE arch/powerpc) | 787 | target_include_directories(crypto_obj PRIVATE arch/powerpc) |
diff --git a/crypto/Makefile.am b/crypto/Makefile.am index 0952494..d1c5b76 100644 --- a/crypto/Makefile.am +++ b/crypto/Makefile.am | |||
@@ -403,10 +403,11 @@ endif | |||
403 | noinst_HEADERS += arch/loongarch64/crypto_arch.h | 403 | noinst_HEADERS += arch/loongarch64/crypto_arch.h |
404 | noinst_HEADERS += bn/arch/loongarch64/bn_arch.h | 404 | noinst_HEADERS += bn/arch/loongarch64/bn_arch.h |
405 | 405 | ||
406 | # XXX - do we still need this? | ||
407 | if HOST_MIPS | 406 | if HOST_MIPS |
407 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/mips/ | ||
408 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/mips/ | 408 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/mips/ |
409 | endif | 409 | endif |
410 | noinst_HEADERS += arch/mips/crypto_arch.h | ||
410 | noinst_HEADERS += bn/arch/mips/bn_arch.h | 411 | noinst_HEADERS += bn/arch/mips/bn_arch.h |
411 | 412 | ||
412 | if HOST_MIPS64 | 413 | if HOST_MIPS64 |
diff --git a/crypto/arch/mips/crypto_arch.h b/crypto/arch/mips/crypto_arch.h new file mode 100644 index 0000000..274879c --- /dev/null +++ b/crypto/arch/mips/crypto_arch.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* $OpenBSD$ */ | ||
2 | /* | ||
3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | ||
4 | * | ||
5 | * Permission to use, copy, modify, and distribute this software for any | ||
6 | * purpose with or without fee is hereby granted, provided that the above | ||
7 | * copyright notice and this permission notice appear in all copies. | ||
8 | * | ||
9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | */ | ||
17 | |||
18 | #ifndef HEADER_CRYPTO_ARCH_H | ||
19 | #define HEADER_CRYPTO_ARCH_H | ||
20 | |||
21 | #endif | ||
diff --git a/include/arch/mips/opensslconf.h b/include/arch/mips/opensslconf.h index f17d3d2..a5d26b6 100644 --- a/include/arch/mips/opensslconf.h +++ b/include/arch/mips/opensslconf.h | |||
@@ -1,15 +1,22 @@ | |||
1 | #include <openssl/opensslfeatures.h> | 1 | #include <openssl/opensslfeatures.h> |
2 | /* crypto/opensslconf.h.in */ | 2 | /* crypto/opensslconf.h.in */ |
3 | 3 | ||
4 | #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) | 4 | #if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR) |
5 | #define OPENSSLDIR "/etc/ssl" | 5 | #define OPENSSLDIR "/etc/ssl" |
6 | #endif | 6 | #endif |
7 | 7 | ||
8 | #undef OPENSSL_UNISTD | ||
9 | #define OPENSSL_UNISTD <unistd.h> | ||
10 | |||
11 | #undef OPENSSL_EXPORT_VAR_AS_FUNCTION | 8 | #undef OPENSSL_EXPORT_VAR_AS_FUNCTION |
12 | 9 | ||
10 | #ifndef OPENSSL_FILE | ||
11 | #ifdef OPENSSL_NO_FILENAMES | ||
12 | #define OPENSSL_FILE "" | ||
13 | #define OPENSSL_LINE 0 | ||
14 | #else | ||
15 | #define OPENSSL_FILE __FILE__ | ||
16 | #define OPENSSL_LINE __LINE__ | ||
17 | #endif | ||
18 | #endif | ||
19 | |||
13 | #if defined(HEADER_IDEA_H) && !defined(IDEA_INT) | 20 | #if defined(HEADER_IDEA_H) && !defined(IDEA_INT) |
14 | #define IDEA_INT unsigned int | 21 | #define IDEA_INT unsigned int |
15 | #endif | 22 | #endif |
@@ -68,13 +75,6 @@ | |||
68 | #undef EIGHT_BIT | 75 | #undef EIGHT_BIT |
69 | #endif | 76 | #endif |
70 | 77 | ||
71 | #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) | ||
72 | #define CONFIG_HEADER_RC4_LOCL_H | ||
73 | /* if this is defined data[i] is used instead of *data, this is a %20 | ||
74 | * speedup on x86 */ | ||
75 | #define RC4_INDEX | ||
76 | #endif | ||
77 | |||
78 | #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) | 78 | #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) |
79 | #define CONFIG_HEADER_BF_LOCL_H | 79 | #define CONFIG_HEADER_BF_LOCL_H |
80 | #undef BF_PTR | 80 | #undef BF_PTR |
diff --git a/scripts/test b/scripts/test index 1fb02eb..a93fe90 100755 --- a/scripts/test +++ b/scripts/test | |||
@@ -132,6 +132,21 @@ elif [ "$ARCH" = "arm32" -o "$ARCH" = "arm64" ]; then | |||
132 | 132 | ||
133 | file apps/openssl/.libs/openssl | 133 | file apps/openssl/.libs/openssl |
134 | 134 | ||
135 | elif [ "$ARCH" = "loong64" ]; then | ||
136 | sudo apt install -y qemu-user-static binfmt-support g++-14-loongarch64-linux-gnu | ||
137 | sudo ln -sf /usr/loongarch64-linux-gnu/lib64/ld-linux-loongarch-lp64d.so.1 /lib64 | ||
138 | |||
139 | CC=loongarch64-linux-gnu-gcc-14 | ||
140 | CXX=loongarch64-linux-gnu++-14 | ||
141 | AR=loongarch64-linux-gnu-ar | ||
142 | STRIP=loongarch64-linux-gnu-strip-14 | ||
143 | RANLIB=loongarch64-linux-gnu-ranlib | ||
144 | |||
145 | ./configure --host=loongarch64-linux-gnu | ||
146 | LD_LIBRARY_PATH=/usr/loongarch64-linux-gnu/lib make -j 4 check | ||
147 | |||
148 | file apps/openssl/openssl | ||
149 | |||
135 | elif [ "$ARCH" = "mips32" -o "$ARCH" = "mips64" ]; then | 150 | elif [ "$ARCH" = "mips32" -o "$ARCH" = "mips64" ]; then |
136 | sudo apt-get install -y qemu-user-static binfmt-support | 151 | sudo apt-get install -y qemu-user-static binfmt-support |
137 | 152 | ||
diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt index 5baa5bc..cd7e335 100644 --- a/ssl/CMakeLists.txt +++ b/ssl/CMakeLists.txt | |||
@@ -122,7 +122,7 @@ elseif(HOST_LOONGARCH64) | |||
122 | elseif(HOST_MIPS64) | 122 | elseif(HOST_MIPS64) |
123 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/mips64) | 123 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/mips64) |
124 | elseif(HOST_MIPS) | 124 | elseif(HOST_MIPS) |
125 | # XXX - can this go away? the directory doesn't exist... | 125 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/mips) |
126 | elseif(HOST_POWERPC) | 126 | elseif(HOST_POWERPC) |
127 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/powerpc) | 127 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/powerpc) |
128 | elseif(HOST_POWERPC64) | 128 | elseif(HOST_POWERPC64) |
diff --git a/ssl/Makefile.am b/ssl/Makefile.am index 8beb65a..2c84bff 100644 --- a/ssl/Makefile.am +++ b/ssl/Makefile.am | |||
@@ -136,9 +136,10 @@ libssl_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/loongarch64/ | |||
136 | endif | 136 | endif |
137 | noinst_HEADERS += $(top_srcdir)/crypto/arch/loongarch64/crypto_arch.h | 137 | noinst_HEADERS += $(top_srcdir)/crypto/arch/loongarch64/crypto_arch.h |
138 | 138 | ||
139 | # XXX - do we still need this? | ||
140 | if HOST_MIPS | 139 | if HOST_MIPS |
140 | libssl_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/mips/ | ||
141 | endif | 141 | endif |
142 | noinst_HEADERS += $(top_srcdir)/crypto/arch/mips/crypto_arch.h | ||
142 | 143 | ||
143 | if HOST_MIPS64 | 144 | if HOST_MIPS64 |
144 | libssl_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/mips64/ | 145 | libssl_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/mips64/ |
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 72e36d4..d7cc499 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt | |||
@@ -33,7 +33,7 @@ elseif(HOST_LOONGARCH64) | |||
33 | elseif(HOST_MIPS64) | 33 | elseif(HOST_MIPS64) |
34 | include_directories(../crypto/arch/mips64) | 34 | include_directories(../crypto/arch/mips64) |
35 | elseif(HOST_MIPS) | 35 | elseif(HOST_MIPS) |
36 | # XXX - can this go away? the directory doesn't exist... | 36 | include_directories(../crypto/arch/mips) |
37 | elseif(HOST_POWERPC) | 37 | elseif(HOST_POWERPC) |
38 | include_directories(../crypto/arch/powerpc) | 38 | include_directories(../crypto/arch/powerpc) |
39 | elseif(HOST_POWERPC64) | 39 | elseif(HOST_POWERPC64) |
diff --git a/tests/Makefile.am b/tests/Makefile.am index 217f445..b58de21 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am | |||
@@ -40,8 +40,8 @@ if HOST_LOONGARCH64 | |||
40 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/arch/loongarch64/ | 40 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/arch/loongarch64/ |
41 | endif | 41 | endif |
42 | 42 | ||
43 | # XXX - do we still need this? | ||
44 | if HOST_MIPS | 43 | if HOST_MIPS |
44 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/arch/mips/ | ||
45 | endif | 45 | endif |
46 | 46 | ||
47 | if HOST_MIPS64 | 47 | if HOST_MIPS64 |