< libintl_gettextparse'的冲突类型

时间:2015-11-06 08:02:21

标签: linux

我正在尝试为嵌入式系统编译linux文件系统(uclinux-rootfs)。我得到以下错误日志,编译失败。

我做了一些搜索,但无法理解它是什么。 我怎么解决呢?

我的gcc版本是4.8.4,我使用的是Ubuntu 14.04

此致

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="Enter the Mobile number"
        android:id="@+id/entertextlabel"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="79dp" />    

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Start Alarm"
        android:id="@+id/button"
        android:layout_alignParentBottom="true"
        android:layout_toStartOf="@+id/callBtn"
        android:layout_marginBottom="81dp"
        android:onClick="startAlarm"/>

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Cancel Alarm"
        android:id="@+id/button2"
        android:layout_alignTop="@+id/button"
        android:layout_toEndOf="@+id/callBtn"
        android:onClick="cancelAlarm"/>
</RelativeLayout>

1 个答案:

答案 0 :(得分:1)

由于野牛版本和x86-x64冲突而发生此错误。

可以通过以下方式联系:https://github.com/zerovm/glibc/commit/9f3f5229848390ae921f77c92f666ca6f0bff

如果将此修改应用于相关的lib(eglibc,在我的情况下),它将解决编译问题。

如果链接断开,补丁文件的重要部分如下所示(!!!这不是精确的差异文件;由于字符限制而最小化!!!):

From 9f3f5229848390ae921f77c92f666ca6f0bffc00 Mon Sep 17 00:00:00 2001
From: pkit <pconstantine@gmail.com>
Date: Sun, 17 Aug 2014 15:39:12 +0000
Subject: [PATCH] fixed gettext compatibility with bison 3.0

plural.y was incompatible with newer bison versions
---
 intl/Makefile      |   9 ++
 intl/plural-exp.h  | 126 ----------------
 intl/plural-exp2.h | 126 ++++++++++++++++
 intl/plural-exp3.h | 126 ++++++++++++++++
 intl/plural.y      | 410 -----------------------------------------------------
 intl/plural2.y     | 410 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 intl/plural3.y     | 409 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 1080 insertions(+), 536 deletions(-)
 delete mode 100644 intl/plural-exp.h
 create mode 100644 intl/plural-exp2.h
 create mode 100644 intl/plural-exp3.h
 delete mode 100644 intl/plural.y
 create mode 100644 intl/plural2.y
 create mode 100644 intl/plural3.y

diff --git a/intl/Makefile b/intl/Makefile
index 1511edd..601fb57 100644
--- a/intl/Makefile
+++ b/intl/Makefile
@@ -51,6 +51,15 @@ generated = msgs.h mtrace-tst-gettext tst-gettext.mtrace
 generated-dirs := domaindir localedir

 ifneq (no,$(BISON))
+BISONVERGT2 := $(shell expr `bison -V | grep ^bison | sed 's/^.* //' | cut -f1 -d.` \> 2)
+plural.y: plural2.y plural3.y
+ifeq (0,$(BISONVERGT2))
+   cp plural2.y plural.y
+   cp plural-exp2.h plural-exp.h
+else
+   cp plural3.y plural.y
+   cp plural-exp3.h plural-exp.h
+endif
 plural.c: plural.y
    $(BISON) $(BISONFLAGS) $@ $^
 ifeq ($(with-cvs),yes)
diff --git a/intl/plural-exp.h b/intl/plural-exp.h
deleted file mode 100644
index 4a7336e..0000000
--- a/intl/plural-exp.h
+++ /dev/null
@@ -1,126 +0,0 @@

......

diff --git a/intl/plural-exp2.h b/intl/plural-exp2.h
new file mode 100644
index 0000000..4a7336e
--- /dev/null
+++ b/intl/plural-exp2.h
@@ -0,0 +1,126 @@

......
diff --git a/intl/plural-exp3.h b/intl/plural-exp3.h
new file mode 100644
index 0000000..282c15d
--- /dev/null
+++ b/intl/plural-exp3.h
@@ -0,0 +1,126 @@
+/* Expression parsing and evaluation for plural form selection.
+   Copyright (C) 2000, 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
+   Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _PLURAL_EXP_H
+#define _PLURAL_EXP_H
+
+#ifndef PARAMS
+# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
+#  define PARAMS(args) args
+# else
+#  define PARAMS(args) ()
+# endif
+#endif
+
+#ifndef internal_function
+# define internal_function
+#endif
+
+#ifndef attribute_hidden
+# define attribute_hidden
+#endif
+
+
+/* This is the representation of the expressions to determine the
+   plural form.  */
+struct expression
+{
+  int nargs;           /* Number of arguments.  */
+  enum operator
+  {
+    /* Without arguments:  */
+    var,           /* The variable "n".  */
+    num,           /* Decimal number.  */
+    /* Unary operators:  */
+    lnot,          /* Logical NOT.  */
+    /* Binary operators:  */
+    mult,          /* Multiplication.  */
+    divide,            /* Division.  */
+    module,            /* Modulo operation.  */
+    plus,          /* Addition.  */
+    minus,         /* Subtraction.  */
+    less_than,         /* Comparison.  */
+    greater_than,      /* Comparison.  */
+    less_or_equal,     /* Comparison.  */
+    greater_or_equal,      /* Comparison.  */
+    equal,         /* Comparison for equality.  */
+    not_equal,         /* Comparison for inequality.  */
+    land,          /* Logical AND.  */
+    lor,           /* Logical OR.  */
+    /* Ternary operators:  */
+    qmop           /* Question mark operator.  */
+  } operation;
+  union
+  {
+    unsigned long int num; /* Number value for `num'.  */
+    struct expression *args[3];    /* Up to three arguments.  */
+  } val;
+};
+
+/* This is the data structure to pass information to the parser and get
+   the result in a thread-safe way.  */
+struct parse_args
+{
+  const char *cp;
+  struct expression *res;
+};
+
+
+/* Names for the libintl functions are a problem.  This source code is used
+   1. in the GNU C Library library,
+   2. in the GNU libintl library,
+   3. in the GNU gettext tools.
+   The function names in each situation must be different, to allow for
+   binary incompatible changes in 'struct expression'.  Furthermore,
+   1. in the GNU C Library library, the names have a __ prefix,
+   2.+3. in the GNU libintl library and in the GNU gettext tools, the names
+         must follow ANSI C and not start with __.
+   So we have to distinguish the three cases.  */
+#ifdef _LIBC
+# define FREE_EXPRESSION __gettext_free_exp
+# define PLURAL_PARSE __gettextparse
+# define GERMANIC_PLURAL __gettext_germanic_plural
+# define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural
+#elif defined (IN_LIBINTL)
+# define FREE_EXPRESSION libintl_gettext_free_exp
+# define PLURAL_PARSE libintl_gettextparse
+# define GERMANIC_PLURAL libintl_gettext_germanic_plural
+# define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural
+#else
+# define FREE_EXPRESSION free_plural_expression
+# define PLURAL_PARSE parse_plural_expression
+# define GERMANIC_PLURAL germanic_plural
+# define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
+#endif
+
+extern void FREE_EXPRESSION PARAMS ((struct expression *exp))
+     internal_function;
+extern int PLURAL_PARSE PARAMS ((struct parse_args *arg));
+extern const struct expression GERMANIC_PLURAL attribute_hidden;
+extern void EXTRACT_PLURAL_EXPRESSION PARAMS
+  ((const char *nullentry, const struct expression **pluralp,
+    unsigned long int *npluralsp)) internal_function;
+
+#if !defined (_LIBC) && !defined (IN_LIBINTL)
+extern unsigned long int plural_eval PARAMS ((const struct expression *pexp,
+                         unsigned long int n));
+#endif
+
+#endif /* _PLURAL_EXP_H */
diff --git a/intl/plural.y b/intl/plural.y
deleted file mode 100644
index a1ffb9e..0000000
--- a/intl/plural.y
+++ /dev/null
@@ -1,410 +0,0 @@

......

diff --git a/intl/plural2.y b/intl/plural2.y
new file mode 100644
index 0000000..a1ffb9e
--- /dev/null
+++ b/intl/plural2.y
@@ -0,0 +1,410 @@

.......

diff --git a/intl/plural3.y b/intl/plural3.y
new file mode 100644
index 0000000..f3ae954
--- /dev/null
+++ b/intl/plural3.y
@@ -0,0 +1,409 @@
+%{
+/* Expression parsing for plural form selection.
+   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* The bison generated parser uses alloca.  AIX 3 forces us to put this
+   declaration at the beginning of the file.  The declaration in bison's
+   skeleton file comes too late.  This must come before <config.h>
+   because <config.h> may include arbitrary system headers.  */
+#if defined _AIX && !defined __GNUC__
+ #pragma alloca
+#endif
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include "plural-exp.h"
+
+/* The main function generated by the parser is called __gettextparse,
+   but we want it to be called PLURAL_PARSE.  */
+#ifndef _LIBC
+# define __gettextparse PLURAL_PARSE
+#endif
+%}
+%param {struct parse_args *arg}
+%define api.pure full
+%expect 7
+
+%union {
+  unsigned long int num;
+  enum operator op;
+  struct expression *exp;
+}
+
+%{
+/* Prototypes for local functions.  */
+static struct expression *new_exp PARAMS ((int nargs, enum operator op,
+                      struct expression * const *args));
+static inline struct expression *new_exp_0 PARAMS ((enum operator op));
+static inline struct expression *new_exp_1 PARAMS ((enum operator op,
+                          struct expression *right));
+static struct expression *new_exp_2 PARAMS ((enum operator op,
+                        struct expression *left,
+                        struct expression *right));
+static inline struct expression *new_exp_3 PARAMS ((enum operator op,
+                          struct expression *bexp,
+                          struct expression *tbranch,
+                          struct expression *fbranch));
+static int yylex PARAMS ((YYSTYPE *lval, struct parse_args *arg));
+static void yyerror PARAMS ((struct parse_args *arg, const char *str));
+
+/* Allocation of expressions.  */
+
+static struct expression *
+new_exp (nargs, op, args)
+     int nargs;
+     enum operator op;
+     struct expression * const *args;
+{
+  int i;
+  struct expression *newp;
+
+  /* If any of the argument could not be malloc'ed, just return NULL.  */
+  for (i = nargs - 1; i >= 0; i--)
+    if (args[i] == NULL)
+      goto fail;
+
+  /* Allocate a new expression.  */
+  newp = (struct expression *) malloc (sizeof (*newp));
+  if (newp != NULL)
+    {
+      newp->nargs = nargs;
+      newp->operation = op;
+      for (i = nargs - 1; i >= 0; i--)
+   newp->val.args[i] = args[i];
+      return newp;
+    }
+
+ fail:
+  for (i = nargs - 1; i >= 0; i--)
+    FREE_EXPRESSION (args[i]);
+
+  return NULL;
+}
+
+static inline struct expression *
+new_exp_0 (op)
+     enum operator op;
+{
+  return new_exp (0, op, NULL);
+}
+
+static inline struct expression *
+new_exp_1 (op, right)
+     enum operator op;
+     struct expression *right;
+{
+  struct expression *args[1];
+
+  args[0] = right;
+  return new_exp (1, op, args);
+}
+
+static struct expression *
+new_exp_2 (op, left, right)
+     enum operator op;
+     struct expression *left;
+     struct expression *right;
+{
+  struct expression *args[2];
+
+  args[0] = left;
+  args[1] = right;
+  return new_exp (2, op, args);
+}
+
+static inline struct expression *
+new_exp_3 (op, bexp, tbranch, fbranch)
+     enum operator op;
+     struct expression *bexp;
+     struct expression *tbranch;
+     struct expression *fbranch;
+{
+  struct expression *args[3];
+
+  args[0] = bexp;
+  args[1] = tbranch;
+  args[2] = fbranch;
+  return new_exp (3, op, args);
+}
+
+%}
+
+/* This declares that all operators have the same associativity and the
+   precedence order as in C.  See [Harbison, Steele: C, A Reference Manual].
+   There is no unary minus and no bitwise operators.
+   Operators with the same syntactic behaviour have been merged into a single
+   token, to save space in the array generated by bison.  */
+%right '?'     /*   ?      */
+%left '|'      /*   ||     */
+%left '&'      /*   &&     */
+%left EQUOP2       /*   == !=  */
+%left CMPOP2       /*   < > <= >=  */
+%left ADDOP2       /*   + -    */
+%left MULOP2       /*   * / %  */
+%right '!'     /*   !      */
+
+%token <op> EQUOP2 CMPOP2 ADDOP2 MULOP2
+%token <num> NUMBER
+%type <exp> exp
+
+%%
+
+start:   exp
+     {
+       if ($1 == NULL)
+         YYABORT;
+       arg->res = $1;
+     }
+   ;
+
+exp:     exp '?' exp ':' exp
+     {
+       $$ = new_exp_3 (qmop, $1, $3, $5);
+     }
+   | exp '|' exp
+     {
+       $$ = new_exp_2 (lor, $1, $3);
+     }
+   | exp '&' exp
+     {
+       $$ = new_exp_2 (land, $1, $3);
+     }
+   | exp EQUOP2 exp
+     {
+       $$ = new_exp_2 ($2, $1, $3);
+     }
+   | exp CMPOP2 exp
+     {
+       $$ = new_exp_2 ($2, $1, $3);
+     }
+   | exp ADDOP2 exp
+     {
+       $$ = new_exp_2 ($2, $1, $3);
+     }
+   | exp MULOP2 exp
+     {
+       $$ = new_exp_2 ($2, $1, $3);
+     }
+   | '!' exp
+     {
+       $$ = new_exp_1 (lnot, $2);
+     }
+   | 'n'
+     {
+       $$ = new_exp_0 (var);
+     }
+   | NUMBER
+     {
+       if (($$ = new_exp_0 (num)) != NULL)
+         $$->val.num = $1;
+     }
+   | '(' exp ')'
+     {
+       $$ = $2;
+     }
+   ;
+
+%%
+
+void
+internal_function
+FREE_EXPRESSION (exp)
+     struct expression *exp;
+{
+  if (exp == NULL)
+    return;
+
+  /* Handle the recursive case.  */
+  switch (exp->nargs)
+    {
+    case 3:
+      FREE_EXPRESSION (exp->val.args[2]);
+      /* FALLTHROUGH */
+    case 2:
+      FREE_EXPRESSION (exp->val.args[1]);
+      /* FALLTHROUGH */
+    case 1:
+      FREE_EXPRESSION (exp->val.args[0]);
+      /* FALLTHROUGH */
+    default:
+      break;
+    }
+
+  free (exp);
+}
+
+
+static int
+yylex (lval, arg)
+     YYSTYPE *lval;
+     struct parse_args *arg;
+{
+  const char *exp = arg->cp;
+  int result;
+
+  while (1)
+    {
+      if (exp[0] == '\0')
+   {
+     arg->cp = exp;
+     return YYEOF;
+   }
+
+      if (exp[0] != ' ' && exp[0] != '\t')
+   break;
+
+      ++exp;
+    }
+
+  result = *exp++;
+  switch (result)
+    {
+    case '0': case '1': case '2': case '3': case '4':
+    case '5': case '6': case '7': case '8': case '9':
+      {
+   unsigned long int n = result - '0';
+   while (exp[0] >= '0' && exp[0] <= '9')
+     {
+       n *= 10;
+       n += exp[0] - '0';
+       ++exp;
+     }
+   lval->num = n;
+   result = NUMBER;
+      }
+      break;
+
+    case '=':
+      if (exp[0] == '=')
+   {
+     ++exp;
+     lval->op = equal;
+     result = EQUOP2;
+   }
+      else
+   result = YYERRCODE;
+      break;
+
+    case '!':
+      if (exp[0] == '=')
+   {
+     ++exp;
+     lval->op = not_equal;
+     result = EQUOP2;
+   }
+      break;
+
+    case '&':
+    case '|':
+      if (exp[0] == result)
+   ++exp;
+      else
+   result = YYERRCODE;
+      break;
+
+    case '<':
+      if (exp[0] == '=')
+   {
+     ++exp;
+     lval->op = less_or_equal;
+   }
+      else
+   lval->op = less_than;
+      result = CMPOP2;
+      break;
+
+    case '>':
+      if (exp[0] == '=')
+   {
+     ++exp;
+     lval->op = greater_or_equal;
+   }
+      else
+   lval->op = greater_than;
+      result = CMPOP2;
+      break;
+
+    case '*':
+      lval->op = mult;
+      result = MULOP2;
+      break;
+
+    case '/':
+      lval->op = divide;
+      result = MULOP2;
+      break;
+
+    case '%':
+      lval->op = module;
+      result = MULOP2;
+      break;
+
+    case '+':
+      lval->op = plus;
+      result = ADDOP2;
+      break;
+
+    case '-':
+      lval->op = minus;
+      result = ADDOP2;
+      break;
+
+    case 'n':
+    case '?':
+    case ':':
+    case '(':
+    case ')':
+      /* Nothing, just return the character.  */
+      break;
+
+    case ';':
+    case '\n':
+    case '\0':
+      /* Be safe and let the user call this function again.  */
+      --exp;
+      result = YYEOF;
+      break;
+
+    default:
+      result = YYERRCODE;
+#if YYDEBUG != 0
+      --exp;
+#endif
+      break;
+    }
+
+  arg->cp = exp; 
+
+  return result;
+}
+
+
+static void
+yyerror (arg, str)
+     struct parse_args *arg;
+     const char *str;
+{
+  /* Do nothing.  We don't print error messages here.  */
+}

简而言之:

  • plural-exp.h移至plural-exp2.h
  • plural.y被移动到plural2.y
  • 复数-ex3.h和plural3.y被创建
  • 根据野牛版本
  • 选择相关的标题和y文件
相关问题