[PATCH v2 xserver 2/7] sdksyms: fix typo in export keyword index

Mihail Konev k.mvc at ya.ru
Tue Apr 4 23:49:41 UTC 2017


In headers, the symbols exported from Xorg are declared as
  "extern _X_EXPORT type name [...]".

In 3dad57b1 ("sdksyms: Tighten up the symbols we add to the magic table"),
a check has been inserted that ensures the word at the index matches the
_X_EXPORT expansion.

With GCC 5, the "skip line numbers" loop will reassign the index, and
the check works as intended.

With GCC 4 and below, for declarations having the type on the same line
as "extern" (most of them), the initial index is off by one, the check
will look at the type instead, never pass, and the build breaks.

Fixes: b1dac41f ('Use libtool convenience libraries and better "symbol" table')
Signed-off-by: Mihail Konev <k.mvc at ya.ru>
---
v2: Figure out what exactly happens. Reword.

 hw/xfree86/sdksyms.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
index 767ce2181d5f..0139a5077516 100755
--- a/hw/xfree86/sdksyms.sh
+++ b/hw/xfree86/sdksyms.sh
@@ -348,7 +348,7 @@ BEGIN {
 
 /^extern[ 	]/  {
     if (sdk) {
-	n = 3;
+	n = 2;
 
         # skip line numbers GCC 5 adds before __attribute__
         while ($n == "" || $0 ~ /^# [0-9]+ "/) {
-- 
2.9.2



More information about the xorg-devel mailing list