[libcue] Hide flex-related functions

Peter Lemenkov peter at fedoraproject.org
Tue Sep 3 12:46:11 UTC 2013


commit 2007aef56290d75814e5782b4548bbfe5eebb15e
Author: Peter Lemenkov <lemenkov at gmail.com>
Date:   Tue Sep 3 16:45:57 2013 +0400

    Hide flex-related functions
    
    Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>

 libcue-0001-Rename-buffer-to-yy_buffer.patch |   61 ++++++++++++++++++++++++++
 libcue-0002-Hide-flex-related-symbols.patch  |   29 ++++++++++++
 libcue.spec                                  |    9 +++-
 3 files changed, 98 insertions(+), 1 deletions(-)
---
diff --git a/libcue-0001-Rename-buffer-to-yy_buffer.patch b/libcue-0001-Rename-buffer-to-yy_buffer.patch
new file mode 100644
index 0000000..3dc1bce
--- /dev/null
+++ b/libcue-0001-Rename-buffer-to-yy_buffer.patch
@@ -0,0 +1,61 @@
+From 47dd16aabe16595a7555edda3fb5c7381011793d Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Mon, 2 Sep 2013 18:12:23 +0400
+Subject: [PATCH 1/2] Rename buffer to yy_buffer
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ src/libcue/cue_scanner.l | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/src/libcue/cue_scanner.l b/src/libcue/cue_scanner.l
+index a1c15d4..380b529 100644
+--- a/src/libcue/cue_scanner.l
++++ b/src/libcue/cue_scanner.l
+@@ -13,7 +13,7 @@
+ #include "cd.h"
+ #include "cue_parser.h"
+ 
+-char buffer[PARSER_BUFFER];
++char yy_buffer[PARSER_BUFFER];
+ 
+ int yylex(void);
+ %}
+@@ -35,18 +35,18 @@ nonws		[^ \t\r\n]
+ 
+ \'([^\']|\\\')*\'	|
+ \"([^\"]|\\\")*\"	{
+-		yylval.sval = strncpy(	buffer,
++		yylval.sval = strncpy(	yy_buffer,
+ 					++yytext,
+-					(yyleng > sizeof(buffer) ? sizeof(buffer) : yyleng));
++					(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng));
+ 		yylval.sval[yyleng - 2] = '\0';
+ 		BEGIN(INITIAL);
+ 		return STRING;
+ 		}
+ 
+ <NAME>{nonws}+	{
+-		yylval.sval = strncpy(	buffer,
++		yylval.sval = strncpy(	yy_buffer,
+ 					yytext,
+-					(yyleng > sizeof(buffer) ? sizeof(buffer) : yyleng));
++					(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng));
+ 		yylval.sval[yyleng] = '\0';
+ 		BEGIN(INITIAL);
+ 		return STRING;
+@@ -115,9 +115,9 @@ REM		{ BEGIN(REM); /* exclusive rules for special exceptions */ }
+ <REM>\n		{ BEGIN(INITIAL); }
+ 
+ <RPG>{nonws}+	{
+-		yylval.sval = strncpy(	buffer,
++		yylval.sval = strncpy(	yy_buffer,
+ 					yytext,
+-					(yyleng > sizeof(buffer) ? sizeof(buffer) : yyleng));
++					(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng));
+ 		yylval.sval[yyleng] = '\0';
+ 		BEGIN(SKIP);
+ 		return STRING;
+-- 
+1.8.3.1
+
diff --git a/libcue-0002-Hide-flex-related-symbols.patch b/libcue-0002-Hide-flex-related-symbols.patch
new file mode 100644
index 0000000..caea71b
--- /dev/null
+++ b/libcue-0002-Hide-flex-related-symbols.patch
@@ -0,0 +1,29 @@
+From 703cfbc64e6d88f14ce84ba92384757e00f8693b Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Tue, 3 Sep 2013 16:26:20 +0400
+Subject: [PATCH 2/2] Hide flex-related symbols
+
+These symbols should be mangled or hidden, to avoid collisions with other DSOs
+and application programs. See this issue for further details:
+
+https://bugzilla.redhat.com/882178
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ src/libcue/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/libcue/Makefile.am b/src/libcue/Makefile.am
+index 801a090..c69f2f5 100644
+--- a/src/libcue/Makefile.am
++++ b/src/libcue/Makefile.am
+@@ -27,5 +27,5 @@ libcueinclude_HEADERS	= 				\
+ 
+ lib_LTLIBRARIES		= libcue.la
+ 
+-libcue_la_LDFLAGS	= -version-info @LIBCUE_LIBTOOL_VERSION@
++libcue_la_LDFLAGS	= -version-info @LIBCUE_LIBTOOL_VERSION@ -export-symbols-regex '^([^y]|y[^y])'
+ libcueincludedir	= $(includedir)/@LIBCUE_LIBRARY_NAME at -@LIBCUE_API_VERSION@/@LIBCUE_LIBRARY_NAME@
+-- 
+1.8.3.1
+
diff --git a/libcue.spec b/libcue.spec
index c212a6d..1124829 100644
--- a/libcue.spec
+++ b/libcue.spec
@@ -1,6 +1,6 @@
 Name:		libcue
 Version:	1.4.0
-Release:	1%{?dist}
+Release:	2%{?dist}
 Summary:	Cue sheet parser library
 
 Group:		System Environment/Libraries
@@ -10,6 +10,8 @@ URL:		https://libcue.sourceforge.net/
 %if 0%{?el7}%{?fedora}
 VCS:		git://git.code.sf.net/p/libcue/code
 %endif
+Patch1:		libcue-0001-Rename-buffer-to-yy_buffer.patch
+Patch2:		libcue-0002-Hide-flex-related-symbols.patch
 BuildRequires:	autoconf
 BuildRequires:	automake
 BuildRequires:	libtool
@@ -34,6 +36,8 @@ Development files for %{name}.
 
 %prep
 %setup -q
+%patch1 -p1 -b .rename_buffer
+%patch2 -p1 -b .hide_flex
 autoreconf -ivf
 
 
@@ -65,6 +69,9 @@ rm -f %{buildroot}%{_libdir}/libcue.la
 
 
 %changelog
+* Tue Sep 03 2013 Peter Lemenkov <lemenkov at gmail.com> - 1.4.0-2
+- Hide flex-related functions
+
 * Sat Aug 31 2013 Peter Lemenkov <lemenkov at gmail.com> - 1.4.0-1
 - Ver. 1.4.0 (soname bump)
 


More information about the scm-commits mailing list