-
-
Notifications
You must be signed in to change notification settings - Fork 105
170 lines (161 loc) · 5.78 KB
/
analysis_ports.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Analysis and Ports
on:
workflow_dispatch:
inputs:
start:
description: 'Start analysis and port workflow'
default: 'yes'
required: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# - name: Linux and clang-analyzer
# os: ubuntu-latest
# config: "--enable-checking --disable-flto"
# make_test: "yes"
# clang_analysis: "yes"
# - name: FreeBSD
# os: ubuntu-latest
# config: "no"
# make: "no"
# with_cross_platform_action: "yes"
# cross_platform_os: "freebsd"
# cross_platform_arch: "x86-64"
# cross_platform_version: "14.1"
# cross_platform_config: "--enable-checking --disable-flto --with-libevent"
# - name: OpenBSD
# os: ubuntu-latest
# config: "no"
# make: "no"
# with_cross_platform_action: "yes"
# cross_platform_os: "openbsd"
# cross_platform_arch: "x86-64"
# cross_platform_version: "7.5"
# cross_platform_config: "--enable-checking --disable-flto --with-libevent"
- name: NetBSD
os: ubuntu-latest
config: "no"
make: "no"
with_cross_platform_action: "yes"
cross_platform_os: "netbsd"
cross_platform_arch: "x86-64"
cross_platform_version: "10.0"
cross_platform_config: "--enable-checking --disable-flto --with-libevent=no"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: cross-platform-action on ${{ matrix.cross_platform_os }} ${{ matrix.cross_platform_version }}
if: ${{ matrix.with_cross_platform_action == 'yes' }}
uses: cross-platform-actions/action@v0.25.0
env:
CROSS_PLATFORM_OS: ${{ matrix.cross_platform_os }}
with:
environment_variables: CROSS_PLATFORM_OS
operating_system: ${{ matrix.cross_platform_os }}
architecture: ${{ matrix.cross_platform_arch }}
version: ${{ matrix.cross_platform_version }}
shell: bash
memory: 4G
cpu_count: 2
run: |
set -e -x
if test "$CROSS_PLATFORM_OS" = "freebsd"; then sudo pkg install -y autoconf libtool openssl libevent; fi
if test "$CROSS_PLATFORM_OS" = "openbsd"; then sudo pkg_add autoconf-2.71 libtool libevent; export AUTOCONF_VERSION="2.71"; fi
if test "$CROSS_PLATFORM_OS" = "netbsd"; then sudo pkgin -y install autoconf libtool; fi
echo "::group::configure"
echo "patch up simdzone for test"
cat <<EOF | (cd simdzone; patch -p1)
diff --git a/configure.ac b/configure.ac
index 20c2e55..4c8423d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,16 @@ AC_CONFIG_FILES([Makefile])
m4_include(m4/ax_check_compile_flag.m4)
m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_STDC])
-AC_CHECK_HEADER(endian.h, AC_DEFINE(HAVE_ENDIAN_H, 1, [Define to 1 if you have the <endian.h> header file.]))
+AC_CHECK_HEADERS([endian.h sys/endian.h],,, [AC_INCLUDES_DEFAULT])
+AC_CHECK_DECLS([bswap16,bswap32,bswap64], [], [], [
+AC_INCLUDES_DEFAULT
+#ifdef HAVE_ENDIAN_H
+#include <endian.h>
+#endif
+#ifdef HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#endif
+])
AC_ARG_ENABLE(westmere, AS_HELP_STRING([--disable-westmere],[Disable Westmere (SSE4.2) kernel]))
case "$enable_westmere" in
diff --git a/src/generic/endian.h b/src/generic/endian.h
index 7c9fdb3..f14bdb7 100644
--- a/src/generic/endian.h
+++ b/src/generic/endian.h
@@ -122,6 +122,7 @@
# endif
#endif
+#if !HAVE_DECL_BSWAP16
static really_inline uint16_t bswap16(uint16_t x)
{
// Copied from src/common/lib/libc/gen/bswap16.c in NetBSD
@@ -129,7 +130,9 @@ static really_inline uint16_t bswap16(uint16_t x)
// Public domain.
return ((x << 8) & 0xff00) | ((x >> 8) & 0x00ff);
}
+#endif
+#if !HAVE_DECL_BSWAP32
static really_inline uint32_t bswap32(uint32_t x)
{
// Copied from src/common/lib/libc/gen/bswap32.c in NetBSD
@@ -140,7 +143,9 @@ static really_inline uint32_t bswap32(uint32_t x)
( (x >> 8) & 0x0000ff00 ) |
( (x >> 24) & 0x000000ff );
}
+#endif
+#if !HAVE_DECL_BSWAP64
static really_inline uint64_t bswap64(uint64_t x)
{
// Copied from src/common/lib/libc/gen/bswap64.c in NetBSD
@@ -155,6 +160,7 @@ static really_inline uint64_t bswap64(uint64_t x)
( (x >> 40) & 0x000000000000ff00ull ) |
( (x >> 56) & 0x00000000000000ffull );
}
+#endif
# if BYTE_ORDER == LITTLE_ENDIAN
# define htobe(bits, x) bswap ## bits((x))
EOF
autoconf && autoheader
(cd simdzone && autoconf && autoheader)
libtoolize -c -i || glibtoolize -c -i
./configure ${{ matrix.cross_platform_config }}
echo "::endgroup::"
echo "::group::make"
make -j2
echo "::endgroup::"
echo "::group::make cutest; ./cutest"
make -j2 cutest
./cutest
echo "::endgroup::"
- name: configure
if: ${{ matrix.config != 'no' }}
run: |
set -e -x
if test `uname` = "Linux"; then sudo apt-get install libevent-dev; fi
autoconf && autoheader
(cd simdzone && autoconf && autoheader)
libtoolize -c -i || glibtoolize -c -i
./configure ${{ matrix.config }}
- name: make
if: ${{ matrix.make != 'no' }}
run: make -j2
- name: make cutest; ./cutest
if: ${{ matrix.make_test == 'yes' }}
run: |
set -e -x
make -j2 cutest
./cutest
- name: clang-analysis
if: ${{ matrix.clang_analysis == 'yes' }}
run: (cd tpkg/clang-analysis.tdir; bash clang-analysis.test)