-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prolog of hermetic build with GCC 11 and Clang 13.
- Loading branch information
Showing
37 changed files
with
568 additions
and
209 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/// In glibc 2.32 new version of some symbols had been added [1]: | ||
/// | ||
/// $ nm -D clickhouse | fgrep -e @GLIBC_2.32 | ||
/// U pthread_getattr_np@GLIBC_2.32 | ||
/// U pthread_sigmask@GLIBC_2.32 | ||
/// | ||
/// [1]: https://www.spinics.net/lists/fedora-devel/msg273044.html | ||
/// | ||
/// Right now ubuntu 20.04 is used as official image for building | ||
/// ClickHouse, however once it will be switched someone may not be happy | ||
/// with that fact that he/she cannot use official binaries anymore because | ||
/// they have glibc < 2.32. | ||
/// | ||
/// To avoid this dependency, let's force previous version of those | ||
/// symbols from glibc. | ||
/// | ||
/// Also note, that the following approach had been tested: | ||
/// a) -Wl,--wrap -- but it goes into endless recursion whey you try to do | ||
/// something like this: | ||
/// | ||
/// int __pthread_getattr_np_compact(pthread_t thread, pthread_attr_t *attr); | ||
/// GLIBC_COMPAT_SYMBOL(__pthread_getattr_np_compact, pthread_getattr_np) | ||
/// int __pthread_getattr_np_compact(pthread_t thread, pthread_attr_t *attr); | ||
/// int __wrap_pthread_getattr_np(pthread_t thread, pthread_attr_t *attr) | ||
/// { | ||
/// return __pthread_getattr_np_compact(thread, attr); | ||
/// } | ||
/// | ||
/// int __pthread_sigmask_compact(int how, const sigset_t *set, sigset_t *oldset); | ||
/// GLIBC_COMPAT_SYMBOL(__pthread_sigmask_compact, pthread_sigmask) | ||
/// int __pthread_sigmask_compact(int how, const sigset_t *set, sigset_t *oldset); | ||
/// int __wrap_pthread_sigmask(int how, const sigset_t *set, sigset_t *oldset) | ||
/// { | ||
/// return __pthread_sigmask_compact(how, set, oldset); | ||
/// } | ||
/// | ||
/// b) -Wl,--defsym -- same problems (and you cannot use version of symbol with | ||
/// version in the expression) | ||
/// c) this approach -- simply add this file with -include directive. | ||
|
||
#if defined(__amd64__) | ||
#define GLIBC_COMPAT_SYMBOL(func) __asm__(".symver " #func "," #func "@GLIBC_2.2.5"); | ||
#elif defined(__aarch64__) | ||
#define GLIBC_COMPAT_SYMBOL(func) __asm__(".symver " #func "," #func "@GLIBC_2.17"); | ||
#else | ||
#error Your platform is not supported. | ||
#endif | ||
|
||
GLIBC_COMPAT_SYMBOL(pthread_sigmask) | ||
GLIBC_COMPAT_SYMBOL(pthread_getattr_np) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <sys/eventfd.h> | ||
#include <unistd.h> | ||
#include <errno.h> | ||
#include "syscall.h" | ||
|
||
int eventfd(unsigned int count, int flags) | ||
{ | ||
int r = __syscall(SYS_eventfd2, count, flags); | ||
#ifdef SYS_eventfd | ||
if (r==-ENOSYS && !flags) r = __syscall(SYS_eventfd, count); | ||
#endif | ||
return __syscall_ret(r); | ||
} | ||
|
||
int eventfd_read(int fd, eventfd_t *value) | ||
{ | ||
return (sizeof(*value) == read(fd, value, sizeof(*value))) ? 0 : -1; | ||
} | ||
|
||
int eventfd_write(int fd, eventfd_t value) | ||
{ | ||
return (sizeof(value) == write(fd, &value, sizeof(value))) ? 0 : -1; | ||
} |
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
Oops, something went wrong.