Skip to content

Add ability to compile using newer version fo glibc w/o using new symbols#29594

Merged
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
azat:glibc-compact
Oct 2, 2021
Merged

Add ability to compile using newer version fo glibc w/o using new symbols#29594
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
azat:glibc-compact

Conversation

@azat
Copy link
Copy Markdown
Member

@azat azat commented Sep 30, 2021

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add ability to compile using newer version fo glibc w/o using new symbols

Detailed description / Documentation draft:
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

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.

Note, that I've tested this by compiling with glibc 2.32 and verifying
that output ELF does not have @GLIBC_2.32 symbols and also running that
binary inside ubuntu:20.04 image (that has glibc 2.31).

v1: -Wl,--wrap
v2: -Wl,--defsym
v3: -include
v4: fix versioning for aarch64

@robot-clickhouse robot-clickhouse added the pr-build Pull request with build/testing/packaging improvement label Sep 30, 2021
@azat azat marked this pull request as draft September 30, 2021 20:36
@alexey-milovidov alexey-milovidov self-assigned this Sep 30, 2021
@alexey-milovidov
Copy link
Copy Markdown
Member

LGTM

Also there is another way: build with -sysroot and fixed libc blob (that we can put in ClickHouse-Extras repository).

…bols

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.

Note, that I've tested this by compiling with glibc 2.32 and verifying
that output ELF does not have @GLIBC_2.32 symbols and also running that
binary inside ubuntu:20.04 image (that has glibc 2.31).

v1: -Wl,--wrap
v2: -Wl,--defsym
v3: -include
v4: fix versioning for aarch64
@azat azat changed the title RFC: Add ability to compile using newer version fo glibc w/o using new symbols Add ability to compile using newer version fo glibc w/o using new symbols Oct 1, 2021
@azat azat marked this pull request as ready for review October 1, 2021 18:03
@azat
Copy link
Copy Markdown
Member Author

azat commented Oct 1, 2021

Also there is another way: build with -sysroot and fixed libc blob (that we can put in ClickHouse-Extras repository).

Indeed, but it is a little bit more complex approach :)

@alexey-milovidov alexey-milovidov merged commit 41924c9 into ClickHouse:master Oct 2, 2021
@azat azat deleted the glibc-compact branch October 2, 2021 06:56
@azat azat mentioned this pull request Oct 12, 2021
azat added a commit to azat/ClickHouse that referenced this pull request Jan 24, 2022
…bundled libc)

This patch reverts glibc compatibility (via .symver) ClickHouse#29594,
in favor of hermetic build (that provides bundled libc version) ClickHouse#30011

Signed-off-by: Azat Khuzhin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-build Pull request with build/testing/packaging improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants