From b73a3693e581583e9ec676f4396d0c3d173e2462 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Mon, 11 Jul 2011 11:25:25 -0400 Subject: Disable __longjmp_chk protection glibc implements some checking on longjmp() calls by replacing it with an internal function __longjmp_chk(), when FORTIFY_SOURCE is defined. This can be problematic when compiling the library under one version of glibc and running it under another. Work around this issue for the one symbol affected for now, before taking out the undef hammer. Fixes http://code.google.com/p/webm/issues/detail?id=166 Change-Id: Ifc5e25cdec17915e394711f2185b3e9214572d10 --- vpx/internal/vpx_codec_internal.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/vpx/internal/vpx_codec_internal.h b/vpx/internal/vpx_codec_internal.h index a1ff1921e..7cc2c3a62 100644 --- a/vpx/internal/vpx_codec_internal.h +++ b/vpx/internal/vpx_codec_internal.h @@ -45,6 +45,7 @@ #define VPX_CODEC_INTERNAL_H #include "../vpx_decoder.h" #include "../vpx_encoder.h" +#include "vpx_config.h" #include @@ -435,6 +436,23 @@ vpx_codec_pkt_list_get(struct vpx_codec_pkt_list *list, #include #include + +/* GLIBC started intercepting calls to longjmp in version 2.11, if the + * FORTIFY_SOURCE flag is defined (it's defined by default on Ubuntu). + * This can cause problems running under older versions of GLIBC (ie, + * for binary distributions), so work around it by linking to the + * underlying longjmp call directly. + */ +#if defined(__GNUC_PREREQ) +#if __GNUC_PREREQ (2,11) +#if ARCH_X86_64 +__asm__(".symver __longjmp_chk,longjmp@GLIBC_2.2.5"); +#else +__asm__(".symver __longjmp_chk,longjmp@GLIBC_2.0"); +#endif +#endif +#endif + struct vpx_internal_error_info { vpx_codec_err_t error_code; -- cgit v1.2.3