forked from koreader/koreader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Linux backward compat issues w/ leptonica
Never pull the GLIBC_2.22 version of fmemopen on Linux. None of our ARM targets run anything that new. Fix koreader#421 Note to mainteners: there's an updated patch for the upcoming leptonica version, because the code got easier to deal with ;).
- Loading branch information
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
thirdparty/leptonica/leptonica-1.72-fmemopen-compat-symbol.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
diff --git a/src/bmpio.c b/src/bmpio.c | ||
index e775dd2..68dc56c 100644 | ||
--- a/src/bmpio.c | ||
+++ b/src/bmpio.c | ||
@@ -554,6 +554,7 @@ RGBA_QUAD *pquad; | ||
#endif /* HAVE_CONFIG_H */ | ||
|
||
#if HAVE_FMEMOPEN | ||
+__asm__(".symver fmemopen,fmemopen@GLIBC_2.2.5"); | ||
extern FILE *open_memstream(char **data, size_t *size); | ||
extern FILE *fmemopen(void *data, size_t size, const char *mode); | ||
#endif /* HAVE_FMEMOPEN */ | ||
diff --git a/src/jp2kio.c b/src/jp2kio.c | ||
index 9eb88d1..105b160 100644 | ||
--- a/src/jp2kio.c | ||
+++ b/src/jp2kio.c | ||
@@ -743,6 +743,7 @@ opj_image_cmptparm_t cmptparm[4]; | ||
* Read/write to memory * | ||
*---------------------------------------------------------------------*/ | ||
#if HAVE_FMEMOPEN | ||
+__asm__(".symver fmemopen,fmemopen@GLIBC_2.2.5"); | ||
extern FILE *open_memstream(char **data, size_t *size); | ||
extern FILE *fmemopen(void *data, size_t size, const char *mode); | ||
#endif /* HAVE_FMEMOPEN */ | ||
diff --git a/src/jpegio.c b/src/jpegio.c | ||
index 06185da..ddc4a3c 100644 | ||
--- a/src/jpegio.c | ||
+++ b/src/jpegio.c | ||
@@ -939,6 +939,7 @@ jmp_buf jmpbuf; /* must be local to the function */ | ||
* Read/write to memory * | ||
*---------------------------------------------------------------------*/ | ||
#if HAVE_FMEMOPEN | ||
+__asm__(".symver fmemopen,fmemopen@GLIBC_2.2.5"); | ||
extern FILE *open_memstream(char **data, size_t *size); | ||
extern FILE *fmemopen(void *data, size_t size, const char *mode); | ||
#endif /* HAVE_FMEMOPEN */ | ||
diff --git a/src/pngio.c b/src/pngio.c | ||
index 19f6c55..79b7ed3 100644 | ||
--- a/src/pngio.c | ||
+++ b/src/pngio.c | ||
@@ -1252,6 +1252,7 @@ l_pngSetReadStrip16To8(l_int32 flag) | ||
* Read/write to memory * | ||
*---------------------------------------------------------------------*/ | ||
#if HAVE_FMEMOPEN | ||
+__asm__(".symver fmemopen,fmemopen@GLIBC_2.2.5"); | ||
extern FILE *open_memstream(char **data, size_t *size); | ||
extern FILE *fmemopen(void *data, size_t size, const char *mode); | ||
#endif /* HAVE_FMEMOPEN */ | ||
diff --git a/src/pnmio.c b/src/pnmio.c | ||
index 3b4b931..00b4e47 100644 | ||
--- a/src/pnmio.c | ||
+++ b/src/pnmio.c | ||
@@ -601,6 +601,7 @@ PIX *pixs; | ||
#endif /* HAVE_CONFIG_H */ | ||
|
||
#if HAVE_FMEMOPEN | ||
+__asm__(".symver fmemopen,fmemopen@GLIBC_2.2.5"); | ||
extern FILE *open_memstream(char **data, size_t *size); | ||
extern FILE *fmemopen(void *data, size_t size, const char *mode); | ||
#endif /* HAVE_FMEMOPEN */ |
12 changes: 12 additions & 0 deletions
12
thirdparty/leptonica/leptonica-1.74-fmemopen-compat-symbol.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/src/utils.c b/src/utils.c | ||
index 76e7d43..9da46b0 100644 | ||
--- a/src/utils.c | ||
+++ b/src/utils.c | ||
@@ -1912,6 +1912,7 @@ FILE *fp; | ||
return (FILE *)ERROR_PTR("data not defined", procName, NULL); | ||
|
||
#if HAVE_FMEMOPEN | ||
+ __asm__(".symver fmemopen,fmemopen@GLIBC_2.2.5"); | ||
if ((fp = fmemopen((void *)data, size, "rb")) == NULL) | ||
return (FILE *)ERROR_PTR("stream not opened", procName, NULL); | ||
#else /* write to tmp file */ |