From 353dcce12b4efb632ea7bac9eb34c967fe1afdae Mon Sep 17 00:00:00 2001 From: insofaras Date: Wed, 24 Feb 2016 19:10:42 +0000 Subject: [PATCH] add a memcpy wrapper for use when packaging the linux version so it can run on older distros --- linux_release_compat.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 linux_release_compat.c diff --git a/linux_release_compat.c b/linux_release_compat.c new file mode 100644 index 00000000..5dafb8f4 --- /dev/null +++ b/linux_release_compat.c @@ -0,0 +1,12 @@ +#include + +// Link to the memcpy symbol with version 2.2.5 instead of the newer 2.14 one +// since they are functionaly equivalent, but using the old one allows 4coder +// to run on older distros without glibc >= 2.14 + +extern "C" { +asm (".symver memcpy, memcpy@GLIBC_2.2.5"); +void *__wrap_memcpy(void *dest, const void *src, size_t n){ + return memcpy(dest, src, n); +} +}