Core DR's copies of memset and memcpy were placed into drhelper to avoid glibc-versioned symbols in our shipped binaries (#1504 (closed)). They are linked into the static drfrontendlib and drinjectlib libraries. They are also in core DR when built as a static library. In these static library cases they can conflict with symbols of the same name elsewhere in the linking application.
To solve this, we first separate memset and memcpy from drhelper into their own library, drmemfuncs. We simply avoid linking it into static core DR, and into drdecode. For static core DR we assume that whatever versions the application or glibc provides will be re-entrant.
We can't avoid linking it into drfrontendlib and drinjectlib (we hit the glibc versioning problem), but we reduce the chance of conflicts with these libraries by marking memset and memcpy as weak.
Fixes #3315 (closed)