File: smoke.sh

package info (click to toggle)
safeclib 3.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,832 kB
  • sloc: ansic: 52,639; makefile: 1,271; perl: 528; sh: 518
file content (415 lines) | stat: -rwxr-xr-x 15,595 bytes parent folder | download
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
#!/bin/sh
autoreconf
make=make

rm -rf src/*/.deps src/.deps tests/.deps 2>/dev/null

case `uname` in
Darwin) # macports compilers
    make=gmake

gmake -s -j4 clean
echo clang-mp-5.0 -fsanitize=address,undefined -fno-omit-frame-pointer --enable-debug --enable-unsafe --enable-norm-compat
CC="clang-mp-5.0 -fsanitize=address,undefined -fno-omit-frame-pointer" \
    ./configure --enable-debug --enable-unsafe --enable-norm-compat && \
    gmake -s -j4 check-log || exit
gmake -s -j4 clean
# full optim: failed -O2 in wcsnset_s WCHECK_SLACK, because the word after static str1
#             was reused. off-by-one
echo clang-mp-5.0 -march=native --disable-constraint-handler --enable-unsafe --enable-norm-compat
CC="clang-mp-5.0 -march=native" \
    ./configure --disable-constraint-handler --enable-unsafe --enable-norm-compat && \
    gmake -s -j4 check-log || exit
gmake -s -j4 clean
# disable -DFORTIFY_SOURCE=2, asan set it to 0 already
echo clang-mp-5.0 -g -O2 -fsanitize=address,undefined -fno-omit-frame-pointer --disable-shared --enable-unsafe --enable-norm-compat
CC="clang-mp-5.0" \
    CFLAGS="-g -O2 -fsanitize=address,undefined -fno-omit-frame-pointer" \
    ./configure --disable-shared --enable-unsafe --enable-norm-compat && \
    gmake -s -j4 check-log || exit
gmake -s -j4 clean
echo clang-mp-8.0 -fsanitize=address -fno-omit-frame-pointer --enable-debug --enable-unsafe --enable-norm-compat
CC="clang-mp-8.0 -fsanitize=address -fno-omit-frame-pointer" \
    ./configure --enable-debug --enable-unsafe --enable-norm-compat && \
    gmake -s -j4 check-log || exit
gmake -s -j4 clean
# since clang 5 with diagnose_if BOS compile-time checks
echo clang-mp-5.0 -std=c11 --enable-unsafe --enable-norm-compat
CC="clang-mp-5.0 -std=c11" \
    ./configure --enable-unsafe --enable-norm-compat && \
    gmake -s -j4 check-log || exit
    gmake -s -j4 -C tests tests-bos
    # many darwin kernel and libc leaks, esp. with locale and time.
    gmake -s -j4 check-valgrind
gmake -s -j4 clean
# relax compile-time errors to warnings
echo clang-mp-devel -DTEST_BOS --enable-debug --enable-warn-dmax --enable-unsafe --enable-norm-compat
CC="clang-mp-devel -DTEST_BOS" \
    ./configure --enable-debug --enable-warn-dmax --enable-unsafe --enable-norm-compat && \
    gmake -s -j4 check-log || exit
gmake -s -j4 clean
# also check against BOS compile-time errors
echo clang-mp-devel --enable-debug --enable-unsafe --enable-norm-compat
CC="clang-mp-devel" \
    ./configure --enable-debug --enable-unsafe --enable-norm-compat && \
    gmake -s -j4 check-log && make -s -j4 -C tests tests-bos || exit
gmake -s -j4 clean
CC="clang-mp-devel" ./configure --enable-error-dmax && \
    $make -s -j4 check-log && exit
gmake -s -j4 clean
echo clang-mp-4.0 -std=c99 --enable-debug --enable-unsafe --enable-norm-compat
CC="clang-mp-4.0 -std=c99" \
    ./configure --enable-debug --enable-unsafe --enable-norm-compat && \
    gmake -s -j4 check-log || exit
    gmake -s -j4 check-valgrind
gmake -s -j4 clean
echo gcc-mp-4.3 -ansi
CC="gcc-mp-4.3 -ansi" ./configure && \
    gmake -s -j4 check-log || exit
gmake -s -j4 clean
echo gcc-mp-4.3 -std=iso9899:199409
CC="gcc-mp-4.3 -std=iso9899:199409" ./configure && \
    gmake -s -j4 check-log || exit
gmake -s -j4 clean
echo "gcc-mp-6"
CC="gcc-mp-6" ./configure && \
    gmake -s -j4 check-log || exit
gmake -s -j4 clean
echo "gcc-mp-7  --enable-unsafe"
CC="gcc-mp-7" ./configure --enable-unsafe && \
    gmake -s -j4 check-log || exit
gmake -s -j4 clean
echo "gcc-mp-8 -march=native --enable-unsafe"
CC="gcc-mp-8 -march=native" ./configure --enable-unsafe && \
    gmake -s -j4 check-log || exit
gmake -s -j4 clean
echo "gcc-mp-9  --enable-unsafe"
CC="gcc-mp-9 -march=native" ./configure --enable-unsafe && \
    gmake -s -j4 check-log || exit
gmake -s -j4 clean
echo "gcc-mp-7 -march=native -Wa,-q --enable-unsafe"
CC="gcc-mp-7 -march=native -Wa,-q" ./configure --enable-unsafe && \
    gmake -s -j4 check-log || exit
gmake -s -j4 clean
echo "g++-mp-6 -std=c++11 --enable-unsafe --enable-norm-compat"
CC="g++-mp-6 -std=c++11" ./configure --enable-unsafe --enable-norm-compat && \
    gmake -s -j4 check-log || exit
echo gcc-mp-6 gcov
CC=gcc-mp-6 \
    ./configure --enable-gcov=gcov-mp-6 --disable-shared --enable-unsafe \
                --enable-norm-compat && \
    gmake -s -j4 gcov
gmake -s -j4 clean
#clang++ not
#CC="c++ -std=c++98" ./configure && \
    #    make -s -j4 check-log || exit

# port install arm-elf-gcc (with newlib, not glibc)
if [ -e /opt/local/bin/arm-elf-gcc-4.7 ]; then
    echo arm-elf-gcc-4.7 --enable-unsafe --host=arm-elf --disable-shared
    CC=arm-elf-gcc-4.7 ./configure --enable-unsafe --host=arm-elf --disable-shared && \
        gmake -s -j4 || exit;
    # $make -s -j4 check-log
    m -C tests tests
    for t in tests/t*_s; do
        b=$(basename $t)
        qemu-arm -L /opt/local/arm-elf $t | tee tests/$b.log
    done
    gmake -s -j4 clean
fi
if [ -e /opt/pgi/osx86-64/2019/bin/pgcc ]; then
    echo /opt/pgi/osx86-64/2019/bin/pgcc --enable-unsafe --enable-debug
    CC=/opt/pgi/osx86-64/2019/bin/pgcc ./configure --enable-unsafe --enable-debug && \
        gmake -s j4 && gmake check-log
        # fails on several not null slack with >RMAX
    gmake -s -j4 clean
fi

;;

Linux)
    make -s clean
    if test -n "`which clang`"; then
        echo clang -fsanitize=address -fno-omit-frame-pointer --enable-debug --enable-unsafe --enable-norm-compat
        CC="clang -fsanitize=address -fno-omit-frame-pointer" \
          ./configure --enable-debug --enable-unsafe --enable-norm-compat && \
            make -s -j4 check-log || exit
        make -s clean
    fi
    for clang in clang clang-{19,18,17,16,15,14,13,12,11,10,7,5.0}
    do
        if test -n `which $clang`; then
            echo $clang -march=native --disable-constraint-handler --enable-unsafe --enable-norm-compat
            CC="$clang -march=native" \
              ./configure --disable-constraint-handler --enable-unsafe --enable-norm-compat && \
                make -s -j4 check-log && make -s -j4 -C tests tests-bos
        fi
    done
    for clang in clang-{3.7,3.6,3.5,3.4}
    do
        if test -n "`which $clang`"; then
            echo $clang -std=c99 --enable-debug --enable-unsafe --enable-norm-compat
            if CC="#clang -std=c99" \
                 ./configure --enable-debug --enable-unsafe --enable-norm-compat; then
                make -s -j4 check-log || exit
            fi
            #    #TODO: valgrind broken with kpti
            #    #make -s -j4 check-valgrind
        fi
    done
    if test -n "`which gcc-4.4`"; then
        echo gcc-4.4 -ansi
        if CC="gcc-4.4 -ansi" ./configure; then
            make -s -j4 check-log || exit
        fi
        echo gcc-4.4 -std=iso9899:199409
        if CC="gcc-4.4 -std=iso9899:199409" ./configure; then
            make -s -j4 check-log || exit
        fi
    fi
    #CC="g++-6 -std=c++11" ./configure && \
        #    make -s -j4 check-log || exit
    for gcc in gcc-{15,14,13,12,11,10,9,8,7,6,5}
    do
        if test -n "`which $gcc`"; then
            if CC="$gcc" ./configure; then
                make -s -j4 check-log || exit
            fi
        fi
    done
    if test -n "`which clang-5.0`"; then
        # since clang 5 with diagnose_if BOS compile-time checks, but on linux it is flappy
        if CC="clang-5.0" \
          ./configure --enable-debug --enable-unsafe --enable-norm-compat; then
            make -s -j4 check-log && make -s -j4 -C tests tests-bos
        fi
    fi
    if test -n "`which clang`"; then
        if CC="clang -fsanitize=address,undefined -fno-omit-frame-pointer" \
          ./configure --enable-debug --enable-unsafe --enable-norm-compat; then
            make -s -j4 check-log || exit
        fi
        # retpoline and diagnose_if, skip compile-time errors
        CC="clang" LDFLAGS="-fuse-ld=lld" ./configure && \
            make -s -j4 check-log
        make -s clean
        # warn on compile-time errors and checks, but on linux it is flappy
        CC="clang" LDFLAGS="-fuse-ld=lld-7" ./configure --enable-warn-dmax && \
            make -s -j4 check-log && make -s -j4 -C tests tests-bos
        make -s clean
        # must error
        echo "clang -DTEST_BOS --enable-error-dmax. MUST error, ignore"
        CC="clang -DTEST_BOS" ./configure --enable-error-dmax && \
            make -s -j4 check-log && exit
        make -s clean
    fi
git clean -dxf src tests
autoreconf
echo "--disable-wchar -f Makefile.kernel"
./configure --disable-wchar && \
    make -s -j4 -f Makefile.kernel || exit
make -s -j4 -f Makefile.kernel clean
make -s clean
git clean -dxf src tests
autoreconf
echo gcc gcov
if ./configure --enable-gcov --disable-shared --enable-unsafe --enable-norm-compat; then
    $make -s -j4 gcov
    #    perl -pi -e's{Source:(\w+)/}{Source:}' src/*/*.gcov src/*.gcov && \
    #    gcov2perl src/*/*.gcov src/*.gcov && \
    #    cover -no-gcov
fi
make -s clean
echo c++ -std=c++11 --enable-unsafe --enable-norm-compat
if CC="c++ -std=c++11" ./configure --enable-unsafe --enable-norm-compat; then
    $make -s -j4 check-log || exit
fi
#CC="c++ -std=c++98" ./configure && \
#    make -s -j4 check-log || exit

# apt install gcc-arm-linux-gnueabihf gcc-7-multilib (with glibc, not newlib)
# and either:
#   apt-install linux-libc-dev (for asm/errno.h)
#   cd /usr/include/i386-linux-gnu; ln -s /usr/include/x86_64-linux-gnu/asm; cd -
# or:
#   cd /usr/include/i386-linux-gnu; ln -s /usr/include/asm-generic asm; cd -
if [ -e /usr/bin/arm-linux-gnueabihf-gcc ]; then
    echo "--enable-unsafe --enable-debug --host=arm-linux-gnueabihf"
    ./configure --enable-unsafe --enable-debug --host=arm-linux-gnueabihf && \
        make -s -j4 || exit;
    # $make -s -j4 check-log
    if [ ! -e /usr/arm-linux-gnueabihf/lib/libsafec-3.5.so.3 ]; then
        cd /usr/arm-linux-gnueabihf/lib/;
        sudo ln -s $OLDPWD/src/.libs/libsafec-3.5.so.3;
        cd -
    fi
    make -s -j4 -C tests tests;
    for t in tests/.libs/t*_s; do
        b=$(basename $t)
        qemu-arm -L /usr/arm-linux-gnueabihf $t | tee tests/$b.log
    done
fi

if [ -e /opt/pgi/linux86-64/2019/pgcc ]; then
    echo /opt/pgi/linux86-64/2019/bin/pgcc --enable-unsafe --enable-debug
    CC=/opt/pgi/linux86-64/2019/bin/pgcc ./configure --enable-unsafe --enable-debug && \
        make -s j4 && make check-log
        # fails on several not null slack wirh >RMAX
    make clean
fi

;;

MSYS_NT*)
# static, usually ours
echo "--disable-shared --enable-debug --enable-unsafe --enable-norm-compat"
./configure --disable-shared --enable-debug --enable-unsafe --enable-norm-compat && \
    make check-log || exit
# shared, might be the msvcrt overriding ours
echo "--enable-shared --enable-debug --enable-unsafe --enable-norm-compat"
./configure --enable-shared --enable-debug --enable-unsafe --enable-norm-compat && \
    make check-log || exit
# ensure we use the windows msvcrt sec_api
echo "-g -DTEST_MSVCRT --enable-shared --enable-debug --enable-unsafe"
CFLAGS="-g -DTEST_MSVCRT" ./configure --enable-shared --enable-debug --enable-unsafe && \
    make check-log || exit
exit
;;

CYGWIN_NT*)
./configure --enable-debug --enable-unsafe --enable-norm-compat && \
    make check-log || exit
./configure --enable-debug --enable-unsafe --enable-norm-compat --host=x86_64-w64-mingw32 && \
    make check-log || exit
exit
;;

esac

# platform independent (i.e. darwin, linux, bsd's with the 3 mingw cross compilers)
$make clean
if CC="cc -m32" ./configure; then
    $make -s -j4 check-log || exit
    $make clean
fi
./configure && \
    $make -s -j4 check-log || exit
./configure --disable-nullslack && \
    $make -s -j4 check-log || exit
./configure --disable-constraint-handler && \
    $make -s -j4 check-log || exit
./configure --disable-extensions && \
    $make -s -j4 check-log || exit
./configure --disable-wchar && \
    $make -s -j4 check-log || exit
./configure --disable-float && \
    $make -s -j4 check-log || exit
./configure --disable-float-exp && \
    $make -s -j4 check-log || exit
./configure --disable-long-long && \
    $make -s -j4 check-log || exit
./configure --disable-long-double && \
    $make -s -j4 check-log || exit
./configure --disable-printf-ptrdiff && \
    $make -s -j4 check-log || exit
./configure --disable-doc && \
    $make -s -j4 check-log || exit
./configure --disable-hardening && \
    $make -s -j4 check-log || exit
./configure --disable-shared && \
    $make -s -j4 check-log || exit
./configure --enable-debug && \
    $make -s -j4 check-log || exit
./configure --enable-unsafe && \
    $make -s -j4 check-log || exit
./configure --enable-norm-compat && \
    $make -s -j4 check-log || exit
./configure --enable-gcov && \
    $make -s -j4 check-log || exit
./configure --enable-memmax=262144 && \
    $make -s -j4 check-log || exit
./configure --enable-strmax=2056 && \
    $make -s -j4 check-log || exit
./configure --enable-warn-dmax && \
    $make -s -j4 check-log || exit
echo configure --enable-error-dmax must fail
./configure --enable-error-dmax && \
    $make -s -j4 check-log && exit

# different .deps format
git clean -dxf src tests
autoreconf
if test -n "`which x86_64-w64-mingw32-gcc`"; then
    #CC="x86_64-w64-mingw32-gcc"
    test -f libssp-0.dll.m64 && cp tests/libssp-0.dll
    ./configure --enable-unsafe --host=x86_64-w64-mingw32 && \
    $make -s -j4 && $make -s -j4 -C tests tests && \
    if [ `uname` = Linux ]; then
        cp src/.libs/*.dll . && \
        for t in tests/.libs/t_*.exe; do
            b=$(basename $t); wine $t | tee tests/$b.log; done
        rm *.dll
    fi
    git clean -dxf src tests
    autoreconf
fi
if test -n "`which i686-w64-mingw32-gcc`"; then
    test -f libssp-0.dll.m32 && cp tests/libssp-0.dll
    ./configure --enable-unsafe --host=i686-w64-mingw32 && \
    $make -s -j4  && $make -s -j4 -C tests tests && \
    if [ `uname` = Linux ]; then
        cp src/.libs/*.dll . && \
        for t in tests/t_*.exe; do
            b=$(basename $t .exe); wine $t | tee tests/$b.log;
        done
        rm *.dll
    fi
    $make clean
    CFLAGS="-g -gdwarf-2 -DTEST_MSVCRT" \
    ./configure --enable-unsafe --enable-debug --host=i686-w64-mingw32 && \
    $make -s -j4  && $make -s -j4 -C tests tests && \
    cp src/.libs/*.dll . && \
    for t in tests/t_*.exe; do
        b=$(basename $t .exe); wine $t | tee tests/$b.log;
    done
    $make clean
    git clean -dxf src tests
    autoreconf
fi
if test -n "`i386-mingw32-gcc`"; then
    #CC="i386-mingw32-gcc"
    test -f libssp-0.dll.m32 && cp tests/libssp-0.dll
    ./configure --enable-unsafe --host=i386-mingw32 && \
    $make -s -j4  && $make -s -j4 -C tests tests && \
    if [ `uname` = Linux ]; then
        cp src/.libs/*.dll . && \
        for t in tests/.libs/t_*.exe; do
          b=$(basename $t); wine $t | tee tests/$b.log; done
        rm *.dll
    fi
    $make clean
fi
git clean -dxf src tests
# if all clean, try out-of-tree build and distcheck
if [ -z "`git status --porcelain`" ]; then
    echo build from outside
    build-aux/autogen.sh
    mkdir .build && cd .build && \
        ../configure && $make check-log || exit
    cd ..
    rm -rf .build

    echo make distcheck
    build-aux/autogen.sh && \
        ./configure && $make distcheck
else
    echo "not clean srcdir, out-of-tree + make distcheck skipped"
    echo `git status --short`
fi
rm .slkm.ko.cmd .testslkm.ko.cmd  CaseFolding.txt test-upr.pl \
   tmpfopen tmpvwscanf tmpwscanf
rm -rf .tmp_versions/

autoreconf
./configure --enable-unsafe --enable-debug && \
    $make -s -j4 check-log || exit