ClickHouse/base/glibc-compatibility/musl
Azat Khuzhin 0fe1f070fa Fix getauxval() in glibc-compatibility
getauxval() from glibc-compatibility did not work always correctly:

- it does not work after setenv(), and this breaks vsyscalls,
  like sched_getcpu() [1] (and BaseDaemon.cpp always set TZ if timezone
  is defined, which is true for CI [2]).

  [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1163404
  [2]: https://github.com/ClickHouse/ClickHouse/pull/32928#issuecomment-1015762717

- another think that is definitely broken is LSan (Leak Sanitizer), it
  relies on worked getauxval() but it does not work if __environ is not
  initialized yet (there is even a commit about this).

  And because of, at least, one leak had been introduced [3]:

    [3]: https://github.com/ClickHouse/ClickHouse/pull/33840

Fix this by using /proc/self/auxv.

And let's see how many issues will LSan find...

I've verified this patch manually by printing AT_BASE and compared it
with output of LD_SHOW_AUXV.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-26 12:56:27 +03:00
..
aarch64 libs/ → base/ 2020-02-14 17:48:30 +03:00
x86_64 Implemented unwind info for __syscall function 2020-03-03 05:29:51 +03:00
__math_divzero.c libs/ → base/ 2020-02-14 17:48:30 +03:00
__math_divzerof.c libs/ → base/ 2020-02-14 17:48:30 +03:00
__math_invalid.c libs/ → base/ 2020-02-14 17:48:30 +03:00
__math_invalidf.c libs/ → base/ 2020-02-14 17:48:30 +03:00
__math_oflow.c libs/ → base/ 2020-02-14 17:48:30 +03:00
__math_oflowf.c libs/ → base/ 2020-02-14 17:48:30 +03:00
__math_uflow.c libs/ → base/ 2020-02-14 17:48:30 +03:00
__math_uflowf.c libs/ → base/ 2020-02-14 17:48:30 +03:00
__math_xflow.c libs/ → base/ 2020-02-14 17:48:30 +03:00
__math_xflowf.c libs/ → base/ 2020-02-14 17:48:30 +03:00
__polevll.c Add powf and powl to glibc-compatibility 2020-12-21 02:54:05 +03:00
accept4.c glibc-compatibility: Add accept4() from musl 1.2.1. 2020-11-24 17:55:02 +03:00
atomic.h libs/ → base/ 2020-02-14 17:48:30 +03:00
clock_getres.c Fix glibc compatibility 2020-03-23 19:51:06 +03:00
clock_gettime.c Remove weak aliases from musl 2020-03-03 04:59:57 +03:00
clock_nanosleep.c Remove weak aliases from musl 2020-03-03 04:59:57 +03:00
COPYRIGHT libs/ → base/ 2020-02-14 17:48:30 +03:00
epoll.c glibc-compatibility: Add epoll_create1() from musl 1.2.1. 2020-11-24 17:55:02 +03:00
eventfd.c glibc-compatibility: Add eventfd(), eventfd_read(), eventfd_write() from musl 1.2.1. 2020-11-24 17:55:02 +03:00
exp2.c libs/ → base/ 2020-02-14 17:48:30 +03:00
exp2f_data.c libs/ → base/ 2020-02-14 17:48:30 +03:00
exp2f_data.h libs/ → base/ 2020-02-14 17:48:30 +03:00
exp2f.c libs/ → base/ 2020-02-14 17:48:30 +03:00
exp_data.c libs/ → base/ 2020-02-14 17:48:30 +03:00
exp_data.h libs/ → base/ 2020-02-14 17:48:30 +03:00
exp.c libs/ → base/ 2020-02-14 17:48:30 +03:00
fallocate.c libs/ → base/ 2020-02-14 17:48:30 +03:00
fcntl.c libs/ → base/ 2020-02-14 17:48:30 +03:00
futimens.c libs/ → base/ 2020-02-14 17:48:30 +03:00
getauxval.c Fix getauxval() in glibc-compatibility 2022-01-26 12:56:27 +03:00
getentropy.c libs/ → base/ 2020-02-14 17:48:30 +03:00
getrandom.c libs/ → base/ 2020-02-14 17:48:30 +03:00
glob.c libs/ → base/ 2020-02-14 17:48:30 +03:00
lgamma.c Fix warnings by PVS-Studio in some third-party code 2021-05-08 22:41:06 +03:00
lgammal.c Fix warnings by PVS-Studio in some third-party code 2021-05-08 22:41:06 +03:00
libm.h Fix warnings by PVS-Studio 2021-05-08 23:57:08 +03:00
log2_data.c libs/ → base/ 2020-02-14 17:48:30 +03:00
log2_data.h libs/ → base/ 2020-02-14 17:48:30 +03:00
log2.c libs/ → base/ 2020-02-14 17:48:30 +03:00
log2f_data.c libs/ → base/ 2020-02-14 17:48:30 +03:00
log2f_data.h libs/ → base/ 2020-02-14 17:48:30 +03:00
log2f.c libs/ → base/ 2020-02-14 17:48:30 +03:00
log_data.c libs/ → base/ 2020-02-14 17:48:30 +03:00
log_data.h libs/ → base/ 2020-02-14 17:48:30 +03:00
log.c libs/ → base/ 2020-02-14 17:48:30 +03:00
logf_data.c libs/ → base/ 2020-02-14 17:48:30 +03:00
logf_data.h libs/ → base/ 2020-02-14 17:48:30 +03:00
logf.c libs/ → base/ 2020-02-14 17:48:30 +03:00
mkstemps.c add .sql suffix 2020-12-21 14:43:06 +08:00
musl_features.h Remove weak aliases from musl 2020-03-03 04:59:57 +03:00
pipe2.c libs/ → base/ 2020-02-14 17:48:30 +03:00
posix_spawn.c libs/ → base/ 2020-02-14 17:48:30 +03:00
pow_data.c libs/ → base/ 2020-02-14 17:48:30 +03:00
pow_data.h libs/ → base/ 2020-02-14 17:48:30 +03:00
pow.c libs/ → base/ 2020-02-14 17:48:30 +03:00
powf_data.c Add powf and powl to glibc-compatibility 2020-12-21 02:54:05 +03:00
powf_data.h Add powf and powl to glibc-compatibility 2020-12-21 02:54:05 +03:00
powf.c Fix warnings by PVS-Studio in some third-party code 2021-05-08 22:41:06 +03:00
powl.c Fix codespell warnings. Split style checks. Update style checks docker 2020-12-24 13:17:52 +03:00
pwritev.c libs/ → base/ 2020-02-14 17:48:30 +03:00
README libs/ → base/ 2020-02-14 17:48:30 +03:00
sched_cpucount.c libs/ → base/ 2020-02-14 17:48:30 +03:00
sched_getcpu.c Fix msan warnings 2021-01-29 19:11:50 +03:00
secure_getenv.c glibc-compatibility: Add secure_getenv(). 2020-11-24 17:55:02 +03:00
strsignal.c Import strsignal from Musl 2021-01-08 08:09:30 +03:00
sync_file_range.c add sync_file_range for glibc-compatibility 2020-11-11 09:08:52 +08:00
syscall_ret.c libs/ → base/ 2020-02-14 17:48:30 +03:00
syscall.h glibc-compatibility: Add accept4() from musl 1.2.1. 2020-11-24 17:55:02 +03:00
timerfd.c Add timerfd from musl 2020-12-14 17:41:59 +03:00
timespec_get.c libs/ → base/ 2020-02-14 17:48:30 +03:00
utimensat.c libs/ → base/ 2020-02-14 17:48:30 +03:00
vasprintf.c libs/ → base/ 2020-02-14 17:48:30 +03:00
vdso.c glibc-compatibility: Add getauxval(). 2020-11-24 17:55:02 +03:00

Tiny pieces extracted from MUSL library.

git://git.musl-libc.org/musl
c10bc61508dc52b8315084e628f36a6c3c2dabb1

NOTE: Files was edited.

NOTE: Math related files are pulled from commit 6ad514e4e278f0c3b18eb2db1d45638c9af1c07f.