Created
November 19, 2013 06:31
-
-
Save nicky-zs/7541169 to your computer and use it in GitHub Desktop.
One way to solve the glibc compatibility problem. In my case, when building a program with libthrift.a on linux with glibc version 2.15, ld always links memcpy@GLIBC_2.14 which cannot be found on systems with glibc version < 2.14. So, use this file to define a symbol __wrap_memcpy and use -Wl,--wrap=memcpy to tell ld using this symbol when meeti…
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
#include <string.h> | |
void *__memcpy_glibc_2_2_5(void *, const void *, size_t); | |
asm(".symver __memcpy_glibc_2_2_5, memcpy@GLIBC_2.2.5"); | |
void *__wrap_memcpy(void *dest, const void *src, size_t n) | |
{ | |
return __memcpy_glibc_2_2_5(dest, src, n); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if build with g++, should around extern "C" {}, resolve undefine reference error