您尚未登录。

楼主 #1 2019-10-22 15:03:12

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 307
积分: 275

大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

如题,前几天还是好的,今天就不行了

离线

#2 2019-10-22 15:24:05

晕哥
管理员
所在地: wechat: whycan_cn
注册时间: 2017-09-06
已发帖子: 9,473
积分: 9202

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

错误信息





离线

楼主 #3 2019-10-22 15:36:15

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 307
积分: 275

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

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

离线

#4 2019-10-22 15:53:50

晕哥
管理员
所在地: wechat: whycan_cn
注册时间: 2017-09-06
已发帖子: 9,473
积分: 9202

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败





离线

楼主 #5 2019-10-22 16:08:54

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 307
积分: 275

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

显示已经是最新版本

离线

#6 2019-10-22 16:09:36

晕哥
管理员
所在地: wechat: whycan_cn
注册时间: 2017-09-06
已发帖子: 9,473
积分: 9202

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

那 make clean 重来吧。





离线

楼主 #7 2019-10-22 16:10:31

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 307
积分: 275

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

remove后,还是一样

离线

楼主 #8 2019-10-22 16:11:21

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 307
积分: 275

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

make clean,试了N次,一样的结果

离线

#9 2019-10-22 16:28:38

晕哥
管理员
所在地: wechat: whycan_cn
注册时间: 2017-09-06
已发帖子: 9,473
积分: 9202

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

/usr/bin/gcc 是什么版本的?





离线

楼主 #10 2019-10-22 16:40:31

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 307
积分: 275

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

7.4

离线

楼主 #11 2019-10-22 16:41:26

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 307
积分: 275

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

现在用回buildroot的toolchain,把gcc调到6.x,正在编译

离线

#12 2019-10-22 16:48:41

晕哥
管理员
所在地: wechat: whycan_cn
注册时间: 2017-09-06
已发帖子: 9,473
积分: 9202

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

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 有 问题?





离线

楼主 #13 2019-10-22 16:54:36

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 307
积分: 275

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

嗯,也测试了按commit修改,还是不行

离线

楼主 #14 2019-10-22 18:03:59

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 307
积分: 275

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

修改两个文件,编译过了。遇到有朋友可以借鉴一吓
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. /

离线

楼主 #15 2019-10-22 18:04:42

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 307
积分: 275

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

修改后再不行,请sudo apt-get install help2man

离线

#16 2019-10-22 18:46:54

ffplay
会员
注册时间: 2019-08-31
已发帖子: 92
积分: 92

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

还有这种操作

离线

#17 2019-12-29 16:48:47

wlcccccc
会员
注册时间: 2019-12-06
已发帖子: 72
积分: 67.5

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

我把GCC降级成4.8 就好了

离线

#18 2020-08-03 11:14:08

淡定
会员
注册时间: 2020-07-23
已发帖子: 21
积分: 41

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

output/build/host-flex-2.6.4的makefile DEFS添加 -D_GNU_SOURCE

离线

#19 2020-08-03 11:46:24

kesion
会员
注册时间: 2020-07-03
已发帖子: 45
积分: 32

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

host-flex有什么用?

离线

#20 2020-08-06 18:31:18

an99h
会员
注册时间: 2020-07-17
已发帖子: 2
积分: 2

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

遇到同样问题,之前还好好的。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 2

gcc 版本:gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

离线

#21 2021-05-07 15:58:30

Wally
会员
注册时间: 2020-07-15
已发帖子: 9
积分: 6

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

请问你们怎么解决的,我也遇到这个问题

离线

#22 2021-05-08 11:57:37

酷酷酷
会员
注册时间: 2021-04-13
已发帖子: 48
积分: 45

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

Wally wrote:

请问你们怎么解决的,我也遇到这个问题

建议直接换2018.2的buildroot
https://blog.csdn.net/qq_46604211/article/details/116024970?spm=1001.2014.3001.5501

离线

#23 2022-08-10 15:09:43

yellowboy
会员
注册时间: 2022-07-05
已发帖子: 2
积分: 2

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

遇到同样问题,参考题主及楼上各种方法均失败,分享一下自己查到的方法: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;
    }

离线

#24 2023-10-04 17:29:06

iufly
会员
注册时间: 2023-02-19
已发帖子: 22
积分: 2

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

离线

#25 2025-01-01 23:57:20

su@@peng
会员
注册时间: 2025-01-01
已发帖子: 2
积分: 2

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

./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都试过还是有错怎么解决家人们

离线

#26 2025-11-11 23:39:26

与非门
会员
注册时间: 2021-01-18
已发帖子: 38
积分: 31.5

Re: 大家有没有遇到使用buildroot-2017.08编译host-flex 2.6.4 失败

同样的问题

akefile: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

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn


东莞哇酷科技有限公司开发