Jelajahi Sumber

kludge to work around "gp-relative relocation against dynamic symbol" problem on Alpha

Thomas Lotterer 22 tahun lalu
induk
melakukan
ae669c399d
2 mengubah file dengan 97 tambahan dan 2 penghapusan
  1. 92 0
      fsl/fsl.patch
  2. 5 2
      fsl/fsl.spec

+ 92 - 0
fsl/fsl.patch

@@ -0,0 +1,92 @@
+--- lib_pcre/pcre.h.orig	Fri Jan 11 10:19:12 2002
++++ lib_pcre/pcre.h	Mon Nov 17 06:16:46 2003
+@@ -86,9 +86,19 @@
+ /* Store get and free functions. These can be set to alternative malloc/free
+ functions if required. Some magic is required for Win32 DLL; it is null on
+ other OS. */
+-
++/* force usage of native malloc is a dirty hack to get
++   around "gp-relative relocation against dynamic symbol
++   pcre_(malloc|free)" problem on Alpha as reported in
++   http://marc.theaimsgroup.com/?l=kroupware&m=106849138602149. Using
++   it prevents applications from providing customized memory management
++   functions for pcre at runtime which does break the test suite */
++#ifdef PCRE_FORCENATIVEMALLOC
++#define pcre_malloc malloc
++#define pcre_free free
++#else
+ PCRE_DL_IMPORT extern void *(*pcre_malloc)(size_t);
+ PCRE_DL_IMPORT extern void  (*pcre_free)(void *);
++#endif
+ 
+ #undef PCRE_DL_IMPORT
+ 
+--- lib_pcre/pcre.c.orig	Mon Jan  7 15:21:06 2002
++++ lib_pcre/pcre.c	Mon Nov 17 06:18:15 2003
+@@ -184,8 +184,12 @@
+ indirections below, which are can be changed by the caller, but are shared
+ between all threads. */
+ 
++#ifdef PCRE_FORCENATIVEMALLOC
++/* nop */
++#else
+ void *(*pcre_malloc)(size_t) = malloc;
+ void  (*pcre_free)(void *) = free;
++#endif
+ 
+ 
+ 
+Index: lib_l2/l2_ut_pcre.c
+--- lib_l2/l2_ut_pcre.c.orig	2003-01-28 10:10:39.000000000 +0100
++++ lib_l2/l2_ut_pcre.c	2003-11-17 13:19:34.000000000 +0100
+@@ -377,8 +377,12 @@
+ #define match_condassert   0x01
+ #define match_isgroup      0x02
+ 
+-void *(*pcre_malloc) (size_t) = malloc;
+-void (*pcre_free) (void *) = free;
++#ifdef PCRE_FORCENATIVEMALLOC
++/* nop */
++#else
++void *(*pcre_malloc)(size_t) = malloc;
++void  (*pcre_free)(void *) = free;
++#endif
+ 
+ #ifndef L2_UT_PCRE_SUPPORT_UTF8
+ #define GETCHARINC(c, eptr) c = *eptr++;
+Index: lib_l2/l2_ut_pcre.h
+--- lib_l2/l2_ut_pcre.h.orig	2002-01-11 11:36:14.000000000 +0100
++++ lib_l2/l2_ut_pcre.h	2003-11-17 13:29:07.000000000 +0100
+@@ -59,8 +59,19 @@
+ #define __PCRE_CONCAT(x) x
+ #define PCRE_CONCAT(x,y) __PCRE_CONCAT(x)y
+ #endif
++/* force usage of native malloc is a dirty hack to get
++   around "gp-relative relocation against dynamic symbol
++   pcre_(malloc|free)" problem on Alpha as reported in
++   http://marc.theaimsgroup.com/?l=kroupware&m=106849138602149. Using
++   it prevents applications from providing customized memory management
++   functions for pcre at runtime which does break the test suite */
++#ifdef PCRE_FORCENATIVEMALLOC
++#define pcre_malloc malloc
++#define pcre_free free
++#else
+ #define pcre_malloc PCRE_CONCAT(PCRE_PREFIX,pcre_malloc)
+ #define pcre_free PCRE_CONCAT(PCRE_PREFIX,pcre_free)
++#endif
+ #define pcre_compile PCRE_CONCAT(PCRE_PREFIX,pcre_compile)
+ #define pcre_copy_substring PCRE_CONCAT(PCRE_PREFIX,pcre_copy_substring)
+ #define pcre_exec PCRE_CONCAT(PCRE_PREFIX,pcre_exec)
+@@ -116,8 +127,12 @@
+ typedef struct pcre_st pcre;
+ typedef struct pcre_extra_st pcre_extra;
+ 
++#ifdef PCRE_FORCENATIVEMALLOC
++/* nop */
++#else
+ extern void *(*pcre_malloc)(size_t);
+ extern void  (*pcre_free)(void *);
++#endif
+ 
+ extern pcre *pcre_compile(const char *, int, const char **, int *,
+               const unsigned char *);

+ 5 - 2
fsl/fsl.spec

@@ -33,7 +33,7 @@ Distribution: OpenPKG [CORE]
 Group:        System
 License:      MIT-style
 Version:      1.4a1
-Release:      20031028
+Release:      20031117
 
 #   package options
 %option       with_fsl_debuglogcode   no
@@ -42,6 +42,7 @@ Release:      20031028
 Source0:      ftp://ftp.ossp.org/pkg/lib/fsl/fsl-%{version}.tar.gz
 Source1:      rc.fsl
 Source2:      fsl.fsl
+Patch0:       fsl.patch
 
 #   build information
 Prefix:       %{l_prefix}
@@ -63,6 +64,8 @@ AutoReqProv:  no
 
 %prep
     %setup -q
+    %patch -p0
+    %{l_shtool} subst -e 's;^\(all: .*\) pcre_test *$;\1;' lib_pcre/Makefile.in
     %{l_shtool} subst \
         -e 's;pcre;fsl_pcre;g' \
         -e '/#include/s;fsl_pcre;pcre;g' \
@@ -71,7 +74,7 @@ AutoReqProv:  no
 
 %build
     CC="%{l_cc}" \
-    CFLAGS="%{l_cflags -O}" \
+    CFLAGS="%{l_cflags -O} -DPCRE_FORCENATIVEMALLOC" \
     ./configure \
         --prefix=%{l_prefix} \
 %if "%{with_fsl_debuglogcode}" == "yes"