Add wrapper for memcpy for linux x86_64 build so the library can be build on a new linux machine without enforcing a dependency on GLIBC 2.14
This commit is contained in:
parent
6748760ef6
commit
3e00d5b498
@ -75,5 +75,5 @@ build()
|
||||
chmod -x "$DISTDIR/"*
|
||||
|
||||
# Cleanup
|
||||
# rm -rf "$TMPDIR"
|
||||
rm -rf "$TMPDIR"
|
||||
}
|
||||
|
||||
@ -9,8 +9,9 @@ set -e
|
||||
OS="linux"
|
||||
ARCH="x86_64"
|
||||
HOST="$ARCH-$OS-gnu"
|
||||
CFLAGS="-m64"
|
||||
CFLAGS="-m64 -Wl,--wrap=memcpy"
|
||||
LIBUSB_CONFIG="--disable-shared"
|
||||
USB4JAVA_LIBS="-lrt"
|
||||
USB4JAVA_CFLAGS="-DWRAP_MEMCPY"
|
||||
|
||||
build
|
||||
|
||||
@ -4,6 +4,7 @@ libusb4java_la_LIBADD = $(LIBUSB_LIBS)
|
||||
libusb4java_la_LDFLAGS = -version-info 1:0:0 -no-undefined
|
||||
EXTRA_DIST = *.h
|
||||
libusb4java_la_SOURCES = \
|
||||
wrappers.c \
|
||||
usb4java.c \
|
||||
LibUsb.c \
|
||||
Version.c \
|
||||
|
||||
15
src/main/c/src/wrappers.c
Normal file
15
src/main/c/src/wrappers.c
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Klaus Reimer (k@ailis.de)
|
||||
* See COPYING file for copying conditions
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
// Enforce usage of older memcpy to be compatible with older libc versions
|
||||
#if WRAP_MEMCPY
|
||||
asm (".symver memcpy, memcpy@GLIBC_2.2.5");
|
||||
void *__wrap_memcpy(void *dest, const void *src, size_t n)
|
||||
{
|
||||
return memcpy(dest, src, n);
|
||||
}
|
||||
#endif
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user