Created
September 6, 2023 21:34
-
-
Save andypost/bfeb0f21637a0a2463c00151eb429e69 to your computer and use it in GitHub Desktop.
Build of unit 1.31.0 using clang16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker run --rm -it -u 0:0 --cap-add=SYS_PTRACE --privileged --platform=linux/aarch64 --network host --pull=always -v /data/nd/aports:/mnt -e APORTSDIR=/mnt -w /mnt --entrypoint='' alpinelinux/alpine-gitlab-ci:latest-aarch64 /bin/ash | |
latest-aarch64: Pulling from alpinelinux/alpine-gitlab-ci | |
... | |
Digest: sha256:b2020e43f7d89e9477823e427ba4b11e48db41b9a2987acf667e1b56d4f767b1 | |
Status: Downloaded newer image for alpinelinux/alpine-gitlab-ci:latest-aarch64 | |
/mnt # cd community/unit | |
/mnt/community/unit # apk upgrade | |
fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/aarch64/APKINDEX.tar.gz | |
(1/2) Upgrading pkgconf (2.0.2-r0 -> 2.0.3-r0) | |
(2/2) Upgrading nghttp2-libs (1.55.1-r0 -> 1.56.0-r0) | |
Executing busybox-1.36.1-r6.trigger | |
OK: 227 MiB in 68 packages | |
/mnt/community/unit # vi /etc/apk/repositories | |
/mnt/community/unit # apk upgrade | |
fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/aarch64/APKINDEX.tar.gz | |
OK: 227 MiB in 68 packages | |
/mnt/community/unit # abuild -F deps unpack prepare | |
>>> unit: Installing for build: clang linux-headers openssl-dev>3 perl-dev php81-dev php81-embed php82-dev php82-embed python3-dev ruby-dev | |
WARNING: opening /root/packages//community: No such file or directory | |
WARNING: opening /root/packages//main: No such file or directory | |
(1/62) Installing clang16-headers (16.0.6-r3) | |
(2/62) Installing libffi (3.4.4-r3) | |
(3/62) Installing xz-libs (5.4.4-r0) | |
(4/62) Installing libxml2 (2.11.5-r0) | |
(5/62) Installing llvm16-libs (16.0.6-r6) | |
(6/62) Installing clang16-libs (16.0.6-r3) | |
(7/62) Installing llvm16-linker-tools (16.0.6-r6) | |
(8/62) Installing clang16 (16.0.6-r3) | |
(9/62) Installing linux-headers (6.4-r0) | |
(10/62) Installing openssl-dev (3.1.2-r0) | |
(11/62) Installing libbz2 (1.0.8-r6) | |
(12/62) Installing perl (5.38.0-r0) | |
(13/62) Installing perl-utils (5.38.0-r0) | |
(14/62) Installing perl-dev (5.38.0-r0) | |
(15/62) Installing php81-common (8.1.23-r0) | |
(16/62) Installing argon2-libs (20190702-r5) | |
(17/62) Installing ncurses-terminfo-base (6.4_p20230722-r0) | |
(18/62) Installing libncursesw (6.4_p20230722-r0) | |
(19/62) Installing libedit (20230828.3.1-r3) | |
(20/62) Installing php81 (8.1.23-r0) | |
(21/62) Installing m4 (1.4.19-r3) | |
(22/62) Installing autoconf (2.71-r2) | |
(23/62) Installing bsd-compat-headers (0.7.2-r5) | |
(24/62) Installing libformw (6.4_p20230722-r0) | |
(25/62) Installing libmenuw (6.4_p20230722-r0) | |
(26/62) Installing libpanelw (6.4_p20230722-r0) | |
(27/62) Installing libncurses++ (6.4_p20230722-r0) | |
(28/62) Installing ncurses-dev (6.4_p20230722-r0) | |
(29/62) Installing libedit-dev (20230828.3.1-r3) | |
(30/62) Installing zlib-dev (1.3-r0) | |
(31/62) Installing libpcre2-16 (10.42-r1) | |
(32/62) Installing libpcre2-32 (10.42-r1) | |
(33/62) Installing pcre2-dev (10.42-r1) | |
(34/62) Installing re2c (3.1-r0) | |
(35/62) Installing php81-dev (8.1.23-r0) | |
(36/62) Installing php81-embed (8.1.23-r0) | |
(37/62) Installing php82-common (8.2.10-r1) | |
(38/62) Installing php82 (8.2.10-r1) | |
(39/62) Installing php82-dev (8.2.10-r1) | |
(40/62) Installing php82-embed (8.2.10-r1) | |
(41/62) Installing gdbm (1.23-r1) | |
(42/62) Installing mpdecimal (2.5.1-r2) | |
(43/62) Installing readline (8.2.1-r2) | |
(44/62) Installing sqlite-libs (3.43.0-r0) | |
(45/62) Installing python3 (3.11.5-r0) | |
(46/62) Installing python3-pycache-pyc0 (3.11.5-r0) | |
(47/62) Installing pyc (0.1-r0) | |
(48/62) Installing python3-pyc (3.11.5-r0) | |
(49/62) Installing python3-dev (3.11.5-r0) | |
(50/62) Installing yaml (0.2.5-r2) | |
(51/62) Installing ruby-libs (3.2.2-r0) | |
(52/62) Installing libucontext (1.2-r2) | |
(53/62) Installing ruby (3.2.2-r0) | |
(54/62) Installing ruby-rdoc (3.2.2-r0) | |
(55/62) Installing libgmpxx (6.3.0-r0) | |
(56/62) Installing gmp-dev (6.3.0-r0) | |
(57/62) Installing libucontext-dev (1.2-r2) | |
(58/62) Installing ruby-dev (3.2.2-r0) | |
(59/62) Installing .makedepends-unit (20230906.212859) | |
(60/62) Installing perl-error (0.17029-r2) | |
(61/62) Installing perl-git (2.42.0-r0) | |
(62/62) Installing git-perl (2.42.0-r0) | |
Executing busybox-1.36.1-r6.trigger | |
OK: 692 MiB in 130 packages | |
>>> unit: Fetching https://unit.nginx.org/download/unit-1.31.0.tar.gz | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 883k 100 883k 0 0 1052k 0 --:--:-- --:--:-- --:--:-- 1067k | |
>>> unit: Fetching fix-clang.patch::https://github.com/ac000/unit/commit/1827b766ff236560c3624550bda031cc89807506.patch | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 4268 100 4268 0 0 6199 0 --:--:-- --:--:-- --:--:-- 6285 | |
>>> unit: Checking sha512sums... | |
unit-1.31.0.tar.gz: OK | |
unit.initd: OK | |
unit.confd: OK | |
unit.logrotate: OK | |
phpver.patch: OK | |
fix-clang.patch: OK | |
>>> unit: Unpacking /var/cache/distfiles/unit-1.31.0.tar.gz... | |
>>> unit: phpver.patch | |
patching file auto/modules/php | |
>>> unit: fix-clang.patch | |
patching file src/nxt_socket_msg.h | |
/mnt/community/unit # abuild -F build | |
configuring Unit 1.31.0 for Linux 6.2.0-32-generic aarch64 | |
checking for C compiler: clang | |
+ using Clang C compiler | |
+ Alpine clang version 16.0.6 | |
building an "echo" program | |
checking for endianness ... not found | |
checking for int size ... not found | |
checking for long size ... not found | |
checking for long long size ... not found | |
checking for void * size ... not found | |
checking for size_t size ... not found | |
checking for off_t size ... not found | |
checking for time_t size ... not found | |
checking for C99 variadic macro ... not found | |
checking for GCC variadic macro ... not found | |
checking for GCC __builtin_expect() ... not found | |
checking for GCC __builtin_unreachable() ... not found | |
checking for GCC __builtin_prefetch() ... not found | |
checking for GCC __builtin_clz() ... not found | |
checking for GCC __builtin_popcount() ... not found | |
checking for GCC __attribute__ visibility ... not found | |
checking for GCC __attribute__ aligned ... not found | |
checking for GCC __attribute__ malloc ... not found | |
checking for GCC __attribute__ packed ... not found | |
checking for GCC __attribute__ unused ... not found | |
checking for GCC builtin atomic operations ... not found | |
checking for Solaris builtin atomic operations ... not found | |
checking for xlC builtin atomic operations ... not found | |
./configure: error: no atomic operations found. | |
>>> ERROR: unit: build failed | |
/mnt/community/unit # cat src/unit-1.31.0/build/autoconf.err | |
---------------------------------------- | |
checking for C compiler: clang | |
Alpine clang version 16.0.6 | |
---------------------------------------- | |
checking for endianness | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
#include <stdint.h> | |
#include <stdio.h> | |
int main(void) { | |
int i = 0x11223344; | |
uint8_t *p; | |
p = (uint8_t *)&i; | |
if (*p == 0x44) | |
printf("little endian"); | |
else | |
printf("big endian"); | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for int size | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
#include <stdio.h> | |
int main(void) { | |
printf("%d", (int) sizeof(int)); | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for long size | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
#include <stdio.h> | |
int main(void) { | |
printf("%d", (int) sizeof(long)); | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for long long size | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
#include <stdio.h> | |
int main(void) { | |
printf("%d", (int) sizeof(long long)); | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for void * size | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
#include <stdio.h> | |
int main(void) { | |
printf("%d", (int) sizeof(void *)); | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for size_t size | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
#include <stdio.h> | |
int main(void) { | |
printf("%d", (int) sizeof(size_t)); | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for off_t size | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
#define _FILE_OFFSET_BITS 64 | |
#include <unistd.h> | |
#include <stdio.h> | |
int main(void) { | |
printf("%d", (int) sizeof(off_t)); | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for time_t size | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
#include <time.h> | |
#include <stdio.h> | |
int main(void) { | |
printf("%d", (int) sizeof(time_t)); | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for C99 variadic macro | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
#include <stdio.h> | |
#define set(dummy, ...) sprintf(__VA_ARGS__) | |
int main(void) { | |
char buf[4]; | |
buf[0] = '0'; | |
set(0, buf, "%d", 1); | |
if (buf[0] == '1') | |
return 0; | |
return 1; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for GCC variadic macro | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
#include <stdio.h> | |
#define set(dummy, args...) sprintf(args) | |
int main(void) { | |
char buf[4]; | |
buf[0] = '0'; | |
set(0, buf, "%d", 1); | |
if (buf[0] == '1') | |
return 0; | |
return 1; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for GCC __builtin_expect() | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
int main(int argc, char *const *argv) { | |
if ((__typeof__(argc == 0)) | |
__builtin_expect((argc == 0), 0)) | |
return 0; | |
return 1; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for GCC __builtin_unreachable() | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
int main(void) { | |
__builtin_unreachable(); | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for GCC __builtin_prefetch() | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
int main(void) { | |
__builtin_prefetch(0); | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for GCC __builtin_clz() | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
int main(void) { | |
if (__builtin_clz(1) == 31) | |
return 0; | |
return 1; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for GCC __builtin_popcount() | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
int main(void) { | |
if (__builtin_popcount(5) == 2) | |
return 0; | |
return 1; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for GCC __attribute__ visibility | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
int n __attribute__ ((visibility("default"))); | |
int main(void) { | |
return 1; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for GCC __attribute__ aligned | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
int n __attribute__ ((aligned(64))); | |
int main(void) { | |
return 1; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for GCC __attribute__ malloc | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
#include <stdlib.h> | |
void *f(void) __attribute__ ((__malloc__)); | |
void *f(void) { | |
return malloc(1); | |
} | |
int main(void) { | |
if (f() != NULL) { | |
return 1; | |
} | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for GCC __attribute__ packed | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
struct s { | |
char c; | |
int i; | |
} __attribute__ ((__packed__)); | |
int main(void) { | |
return 1; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for GCC __attribute__ unused | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
static void f(void) __attribute__ ((__unused__)); | |
static void f(void) | |
{ | |
return; | |
} | |
int main(void) { | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for GCC builtin atomic operations | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
int main(void) { | |
long n = 0; | |
if (!__sync_bool_compare_and_swap(&n, 0, 3)) | |
return 1; | |
if (__sync_fetch_and_add(&n, 1) != 3) | |
return 1; | |
if (__sync_lock_test_and_set(&n, 5) != 4) | |
return 1; | |
if (n != 5) | |
return 1; | |
if (__sync_or_and_fetch(&n, 2) != 7) | |
return 1; | |
if (__sync_and_and_fetch(&n, 5) != 5) | |
return 1; | |
__sync_lock_release(&n); | |
if (n != 0) | |
return 1; | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for Solaris builtin atomic operations | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
#include <atomic.h> | |
int main(void) { | |
ulong_t n = 0; | |
if (atomic_cas_ulong(&n, 0, 3) != 0) | |
return 1; | |
if (atomic_add_long_nv(&n, 1) != 4) | |
return 1; | |
if (atomic_swap_ulong(&n, 5) != 4) | |
return 1; | |
if (n != 5) | |
return 1; | |
if (atomic_or_ulong_nv(&n, 2) != 7) | |
return 1; | |
if (atomic_and_ulong_nv(&n, 5) != 5) | |
return 1; | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- | |
---------------------------------------- | |
checking for xlC builtin atomic operations | |
clang-16: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument] | |
---------- | |
int main(void) { | |
int n = 0; | |
int o = 0; | |
if (!__compare_and_swap(&n, &o, 3)) | |
return 1; | |
if (__fetch_and_add(&n, 1) != 3) | |
return 1; | |
if (__fetch_and_swap(&n, 5) != 4) | |
return 1; | |
if (n != 5) | |
return 1; | |
__isync(); | |
__lwsync(); | |
return 0; | |
} | |
---------- | |
clang -Os -fstack-clash-protection -Wformat -Werror=format-security -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -o build/autotest build/autotest.c | |
---------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment