如题,前几天还是好的,今天就不行了
离线
libtool: link: /usr/bin/gcc -shared  -fPIC -DPIC  .libs/libmain.o .libs/libyywrap.o   -L/home/paulwu/buildroot-2017.08/output/host/lib -lm  -O2 -Wl,-rpath -Wl,/home/paulwu/buildroot-2017.08/output/host/lib   -Wl,-soname -Wl,libfl.so.2 -o .libs/libfl.so.2.0.0
libtool: link: (cd ".libs" && rm -f "libfl.so.2" && ln -s "libfl.so.2.0.0" "libfl.so.2")
libtool: link: (cd ".libs" && rm -f "libfl.so" && ln -s "libfl.so.2.0.0" "libfl.so")
/bin/bash ../libtool  --tag=CC   --mode=link /usr/bin/gcc  -O2 -I/home/paulwu/buildroot-2017.08/output/host/include  -L/home/paulwu/buildroot-2017.08/output/host/lib -Wl,-rpath,/home/paulwu/buildroot-2017.08/output/host/lib -o stage1flex stage1flex-scan.o stage1flex-buf.o stage1flex-ccl.o stage1flex-dfa.o stage1flex-ecs.o stage1flex-filter.o stage1flex-gen.o stage1flex-main.o stage1flex-misc.o stage1flex-nfa.o stage1flex-options.o stage1flex-parse.o stage1flex-regex.o stage1flex-scanflags.o stage1flex-scanopt.o stage1flex-skel.o stage1flex-sym.o stage1flex-tables.o stage1flex-tables_shared.o stage1flex-tblcmp.o stage1flex-yylex.o    -lm 
libtool: link: ( cd ".libs" && rm -f "libfl.la" && ln -s "../libfl.la" "libfl.la" )
libtool: link: /usr/bin/gcc -O2 -I/home/paulwu/buildroot-2017.08/output/host/include -Wl,-rpath -Wl,/home/paulwu/buildroot-2017.08/output/host/lib -o stage1flex stage1flex-scan.o stage1flex-buf.o stage1flex-ccl.o stage1flex-dfa.o stage1flex-ecs.o stage1flex-filter.o stage1flex-gen.o stage1flex-main.o stage1flex-misc.o stage1flex-nfa.o stage1flex-options.o stage1flex-parse.o stage1flex-regex.o stage1flex-scanflags.o stage1flex-scanopt.o stage1flex-skel.o stage1flex-sym.o stage1flex-tables.o stage1flex-tables_shared.o stage1flex-tblcmp.o stage1flex-yylex.o  -L/home/paulwu/buildroot-2017.08/output/host/lib -lm
./stage1flex   -o stage1scan.c ./scan.l
Makefile:1696: recipe for target 'stage1scan.c' failed
make[3]: *** [stage1scan.c] 段错误 (core dumped)
make[3]: 离开目录“/home/paulwu/buildroot-2017.08/output/build/host-flex-2.6.4/src”
Makefile:546: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: 离开目录“/home/paulwu/buildroot-2017.08/output/build/host-flex-2.6.4/src”
Makefile:532: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: 离开目录“/home/paulwu/buildroot-2017.08/output/build/host-flex-2.6.4”
package/pkg-generic.mk:227: recipe for target '/home/paulwu/buildroot-2017.08/output/build/host-flex-2.6.4/.stamp_built' failed
make: *** [/home/paulwu/buildroot-2017.08/output/build/host-flex-2.6.4/.stamp_built] Error 2
离线
离线
显示已经是最新版本
离线
remove后,还是一样
离线
make clean,试了N次,一样的结果
离线
7.4
离线
现在用回buildroot的toolchain,把gcc调到6.x,正在编译
离线
https://bugs.openwrt.org/index.php?do=details&task_id=1003
Same issue here. Can't build the toolchain on Arch with gcc 7.2.0 due to this flex bug.
上面说 gcc 7.2 有 问题?
离线
嗯,也测试了按commit修改,还是不行
离线
修改两个文件,编译过了。遇到有朋友可以借鉴一吓
1.修改Buildroot-2017.08/output/build/host-flex-2.6.4/configure.ac
AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex])
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([src/scan.l])
AC_CONFIG_AUX_DIR([build-aux])
AC_USE_SYSTEM_EXTENSIONS
LT_INIT
AM_INIT_AUTOMAKE([1.11.3 -Wno-portability foreign check-news std-options dist-lzip parallel-tests subdir-objects])
AC_CONFIG_HEADER([src/config.h])
2.修改Buildroot-2017.08/output/build/host-flex-2.6.4/src/scan.l
/* scan.l - scanner for flex input -*-C-*- */
%top{
/* flexdef.h includes config.h, which may contain macros that alter the API */
/* of libc functions. Must include first before any libc header. */
#include "flexdef.h"
}
%{
/*  Copyright (c) 1990 The Regents of the University of California. */
/*  All rights reserved. */
@@ -32,7 +38,6 @@
/*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
/*  PURPOSE. */
#include "flexdef.h"
#include "parse.h"
extern bool tablesverify, tablesext;
extern int trlcontxt; /* Set in  parse.y for each rule. */
离线
修改后再不行,请sudo apt-get install help2man
离线
还有这种操作
离线
我把GCC降级成4.8 就好了
离线
output/build/host-flex-2.6.4的makefile DEFS添加 -D_GNU_SOURCE
离线
host-flex有什么用?
离线
遇到同样问题,之前还好好的。make clean也不行
./stage1flex   -o stage1scan.c ./scan.l
Makefile:1696: recipe for target 'stage1scan.c' failed
make[3]: *** [stage1scan.c] Segmentation fault (core dumped)
make[3]: Leaving directory '/root/linux/lichee/buildroot-2017.08/output/build/host-flex-2.6.4/src'
Makefile:546: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/root/linux/lichee/buildroot-2017.08/output/build/host-flex-2.6.4/src'
Makefile:532: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/linux/lichee/buildroot-2017.08/output/build/host-flex-2.6.4'
package/pkg-generic.mk:227: recipe for target '/root/linux/lichee/buildroot-2017.08/output/build/host-flex-2.6.4/.stamp_built' failed
make: *** [/root/linux/lichee/buildroot-2017.08/output/build/host-flex-2.6.4/.stamp_built] Error 2gcc 版本:gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
离线
请问你们怎么解决的,我也遇到这个问题
离线
请问你们怎么解决的,我也遇到这个问题
建议直接换2018.2的buildroot
https://blog.csdn.net/qq_46604211/article/details/116024970?spm=1001.2014.3001.5501
离线
遇到同样问题,参考题主及楼上各种方法均失败,分享一下自己查到的方法:https://github.com/openwrt/openwrt/issues/5960
1.修改 host-flex-2.6.4/configure.ac:
@@ -25,8 +25,10 @@
  # autoconf requirements and initialization
  AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex])
+AC_PREREQ([2.60])
  AC_CONFIG_SRCDIR([src/scan.l])
  AC_CONFIG_AUX_DIR([build-aux])
+AC_USE_SYSTEM_EXTENSIONS
  LT_INIT
  AM_INIT_AUTOMAKE([1.15 -Wno-portability foreign std-options dist-lzip parallel-tests subdir-objects])
  AC_CONFIG_HEADER([src/config.h])
@@ -166,6 +166,7 @@ strtol dnl
   AC_CHECK_FUNCS([dnl
   pow dnl           Used only by "examples/manual/expr"
   setlocale dnl     Needed only if NLS is enabled
+ reallocarr dnl    NetBSD function. Use reallocarray if not available.
   reallocarray dnl  OpenBSD function. We have replacement if not available.
   ])
2.修改 host-flex-2.6.4/src/misc.c:
@@ -142,7 +142,14 @@ void add_action (const char *new_text)
void   *allocate_array (int size, size_t element_size)
{
-    void *mem;
+    void *new_array;
-#if HAVE_REALLOCARRAY
+#if HAVE_REALLOCARR
-
-    /* reallocarray has built-in overflow detection */
-    mem = reallocarray(NULL, (size_t) size, element_size);
+    new_array = NULL;
+    if (reallocarr(&new_array, (size_t) size, element_size))
+        flexfatal (_("memory allocation failed in allocate_array()"));
#else
+# if HAVE_REALLOCARRAY
+    new_array = reallocarray(NULL, (size_t) size, element_size);
+# else
+    /* Do manual overflow detection */
    size_t num_bytes = (size_t) size * element_size;
-    mem = (size && SIZE_MAX / (size_t) size < element_size) ? NULL :
+    new_array = (size && SIZE_MAX / (size_t) size < element_size) ? NULL :
        malloc(num_bytes);
+# endif
+    if (!new_array)
+        flexfatal (_("memory allocation failed in allocate_array()"));
#endif
-    if (!mem)
-        flexfatal (_
-               ("memory allocation failed in allocate_array()"));
-
-    return mem;
+    return new_array;
}
@@ -667,21 +664,21 @@ void *reallocate_array (void *array, int size, size_t element_size)
void   *reallocate_array (void *array, int size, size_t element_size)
{
    void *new_array;
-#if HAVE_REALLOCARRAY
+#if HAVE_REALLOCARR
+    new_array = array;
+    if (reallocarr(&new_array, (size_t) size, element_size))
+        flexfatal (_("attempt to increase array size failed"));
-    /* reallocarray has built-in overflow detection */
-    new_array = reallocarray(array, (size_t) size, element_size);
#else
+# if HAVE_REALLOCARRAY
+    new_array = reallocarray(array, (size_t) size, element_size);
+# else
+    /* Do manual overflow detection */
    size_t num_bytes = (size_t) size * element_size;
    new_array = (size && SIZE_MAX / (size_t) size < element_size) ? NULL :
        realloc(array, num_bytes);
-#endif
+# endif
    if (!new_array)
        flexfatal (_("attempt to increase array size failed"));
+#endif
    return new_array;
}
离线
离线
./stage1flex   -o stage1scan.c ./scan.l
Makefile:1696: recipe for target 'stage1scan.c' failed
make[4]: *** [stage1scan.c] 段错误 (core dumped)
Makefile:546: recipe for target 'all' failed
make[3]: *** [all] Error 2
Makefile:532: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
package/pkg-generic.mk:227: recipe for target '/home/su/linux/AllwinnerV3S/buildroot-2017.08/output/build/host-flex-2.6.4/.stamp_built' failed
make[1]: *** [/home/su/linux/AllwinnerV3S/buildroot-2017.08/output/build/host-flex-2.6.4/.stamp_built] Error 2
Makefile:79: recipe for target '_all' failed
make: *** [_all] Error 2
交叉编译arm-linux-gnueabihf-gcc -v 4.9和6.3都试过还是有错怎么解决家人们
离线