From 04606a7afa8aa06b975bf6fca84517bb311e613b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 21 Apr 2013 08:36:21 +0200 Subject: Add 'glibc-compat-symbols.h' to force usage of minimal GLIBC symbols currently for memcpy only, used in our x86_32 and default gcc toolchain cmake file. Note: JogAmp's minimum GLIBC is 2.4 due to '__stack_chk_fail' (stack overflow checking) GLIBC 2.4 - March 2006 - Standard for LSB 4.0, Used in SLES 10 We could add compile/link option '-fno-stack-protector', however stack protection seems reasonable and a pre 2006 distribution a bit too 'far fetched' for our multimedia bindings anyway. +++ Added convenient script 'make/scripts/check-glibc-version.sh' to sort and list GLIBC versions per symbol. +++ Besides openal-soft (commit 554b34927cd6a2e0c0ce227108ebf8521bcba889), jogamp modules do not reference any GLIBC symbols > 2.4 per default! If so, 'glibc-compat-symbols.h' should be included per default! --- make/scripts/check-glibc-version.sh | 8 ++++++++ make/stub_includes/platform/glibc-compat-symbols.h | 15 +++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 make/scripts/check-glibc-version.sh create mode 100644 make/stub_includes/platform/glibc-compat-symbols.h diff --git a/make/scripts/check-glibc-version.sh b/make/scripts/check-glibc-version.sh new file mode 100644 index 0000000..aa5f5cc --- /dev/null +++ b/make/scripts/check-glibc-version.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +if [ -z "$1" ] ; then + echo Usage $0 library-file + exit 1 +fi + +objdump -T $1 | grep GLIBC | awk ' { print $5 " " $6 } ' | sort diff --git a/make/stub_includes/platform/glibc-compat-symbols.h b/make/stub_includes/platform/glibc-compat-symbols.h new file mode 100644 index 0000000..482e232 --- /dev/null +++ b/make/stub_includes/platform/glibc-compat-symbols.h @@ -0,0 +1,15 @@ +#ifndef __GLIBC_COMPAT_SYMBOLS_H__ +#define __GLIBC_COMPAT_SYMBOLS_H__ 1 + +/** + * add other architecures below + */ +#ifdef __amd64__ + #define GLIBC_COMPAT_SYMBOL(FFF) __asm__(".symver " #FFF "," #FFF "@GLIBC_2.2.5"); +#else + #define GLIBC_COMPAT_SYMBOL(FFF) __asm__(".symver " #FFF "," #FFF "@GLIBC_2.0"); +#endif /*__amd64__*/ + +GLIBC_COMPAT_SYMBOL(memcpy) + +#endif /*__GLIBC_COMPAT_SYMBOLS_H__*/ -- cgit v1.2.3