Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ./snabb binary more portable #359

Merged
merged 3 commits into from
Feb 20, 2015
Merged

Conversation

lukego
Copy link
Member

@lukego lukego commented Jan 30, 2015

Prepare dynamic linking so that ./snabb is compatible with all GLIBC versions >= 2.7. This enables us to release Snabb Switch as a single executable file for any modern Linux/x86_64.

Tested when built on Ubuntu 14.04. Building with newer versions of GLIBC can potentially break backwards compatibility. A selftest.sh script is included to detect this.

Makefile now forces GCC to always include the file gcc-preinclude.h. This file can contain .symver directives to break dependencies on new GLIBC versions.

There is currently one such directive forcing memcpy to bind to the GLIBC 2.2.5 symbol instead of GLIBC 2.14. (This is because GLIBC made a semi-backwards-incompatible change to memcpy in version 2.14.) Loosely speaking, this has the side-effect of forcing memcpy to act like memmove i.e. to be safe for overlapping memory regions. This is not expected to have a significant performance impact, although that is not impossible. See long question to the GLIBC mailing list about this (unanswered).

This will enable us to release Snabb Switch as a single executable
file for any modern Linux/x86_64.

./snabb will link with any GLIBC version >= 2.7 (released 2007).  This
makes the binary linker-compatible with older Linux distributions such
as Ubuntu 10.04 and CentOS 6.

Tested when built on Ubuntu 14.04. Building on other distributions may
yield different results, but a selftest script is included to catch that.

(There may be other compatibility issues with older kernels and
CPUs. This only takes care of the dynamic linking.)
Detect when compiling an assembler file and suppress the contents of
the header file. (It only compiles as C.)
Print any symbols that depend on GLIBC > 2.7 and error unless there
are none.
@lukego lukego changed the title Make ./snabb binary more portable [DRAFT] Make ./snabb binary more portable Feb 20, 2015
lukego added a commit that referenced this pull request Feb 20, 2015
Make ./snabb binary more portable
@lukego lukego merged commit 2a204bb into snabbco:master Feb 20, 2015
@lukego lukego deleted the portable_binary branch March 10, 2015 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant