From 825083ef841055965335996771b385e4cb9c62ca Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 11 Jul 2017 21:41:47 +0200 Subject: [PATCH] config_file.l: Change default prefix for global symbols. Without this, applications which use flex for their own work might run into problems due to duplicate symbols when linking against liblopsub. Since this is an ABI change, we have to increment the ABI version number. No changes in the source code are necessary since flex provides macros which allow to still refer to the variables and functions with the usual yy prefixed names. However, the command nm -e liblopsub.a shows that the external symbols are now prefixed with lls_yy. Note that the patch only changes config_file.l. We don't bother to adjust lopsubgen.l in the same way because the object file which is derived from lopsubgen.l is not part of the library. It is only linked into the lopsubgen executable. --- config_file.l | 3 +++ lopsub-internal.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config_file.l b/config_file.l index 0b84350..b6eff7c 100644 --- a/config_file.l +++ b/config_file.l @@ -4,6 +4,9 @@ * Licensed under the LGPL v3, see http://www.gnu.org/licenses/lgpl-3.0.html */ + /* We don't want symbols to clash with those of other flex users. */ +%option prefix="lls_yy" + %option stack %option never-interactive %option yylineno diff --git a/lopsub-internal.h b/lopsub-internal.h index 99366d3..bbc2963 100644 --- a/lopsub-internal.h +++ b/lopsub-internal.h @@ -6,7 +6,7 @@ #include -#define LLS_ABI_VERSION 1 +#define LLS_ABI_VERSION 2 /* * Concat "lls_abi_version" and the ABI version number to produce the name of a -- 2.39.2