forked from snabbco/snabb
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.)
- Loading branch information
Showing
4 changed files
with
18 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Force an old symbol version on memcpy. | ||
// See: http://www.win.tue.nl/~aeb/linux/misc/gcc-semibug.html | ||
// https://rjpower9000.wordpress.com/2012/04/09/fun-with-shared-libraries-version-glibc_2-14-not-found/ | ||
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5"); | ||
|
||
|
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,9 @@ | ||
#!/bin/bash | ||
echo "selftest: ./snabb binary portability" | ||
glibc=$(objdump -T snabb | grep GLIBC | sed -e 's/^.*GLIBC_//' -e 's/ .*//' | sort -nr | head -1) | ||
if [ "$glibc" == "2.7" ]; then | ||
echo "ok: links with glibc >= 2.7" | ||
else | ||
echo "error: requires glibc $glibc (> 2.7)" | ||
exit 1 | ||
fi |