Error building cross-compiler (undefined reference to yylex)
Posted: Sat Feb 14, 2015 1:31 am
Hey,
I've wanted to follow the baby steps tutorial to build a hello world kernel. So I started to build my cross-compiler, the binutils compiled fine(version 2.22) then I wanted to build gcc(version 4.6.4) my system's compiler version was 4.6.3. But when I ran make all-gcc I've got this error:
After some googling I've found out that the error occurs because of flex, my flex version is 2.5.39. I've tried to install some other flex version(2.5.35, 2.5.37, 2.5.4a) but it doesn't work I got the same error. Does anybody know where the problem could be?
P.S. My linux distribution is: Elementary OS Luna (version: 0.2, 64-bit)
I've wanted to follow the baby steps tutorial to build a hello world kernel. So I started to build my cross-compiler, the binutils compiled fine(version 2.22) then I wanted to build gcc(version 4.6.4) my system's compiler version was 4.6.3. But when I ran make all-gcc I've got this error:
Code: Select all
build/gengtype.o: In function `adjust_field_type':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype.c:1264: undefined reference to `lexer_line'
build/gengtype.o: In function `adjust_field_rtx_def':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype.c:978: undefined reference to `lexer_line'
build/gengtype.o: In function `adjust_field_type':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype.c:1279: undefined reference to `lexer_line'
build/gengtype.o: In function `adjust_field_tree_exp':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype.c:1205: undefined reference to `lexer_line'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype.c:1217: undefined reference to `lexer_line'
build/gengtype.o:/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype.c:1032: more undefined references to `lexer_line' follow
build/gengtype-parse.o: In function `token':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
build/gengtype-parse.o:/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: more undefined references to `yylex' follow
build/gengtype-parse.o: In function `type':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:722: undefined reference to `lexer_line'
build/gengtype-parse.o: In function `token':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
build/gengtype-parse.o: In function `type':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:793: undefined reference to `lexer_line'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:793: undefined reference to `lexer_line'
build/gengtype-parse.o: In function `token':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
build/gengtype-parse.o: In function `type':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:754: undefined reference to `lexer_line'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:754: undefined reference to `lexer_line'
build/gengtype-parse.o: In function `token':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
build/gengtype-parse.o:/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: more undefined references to `yylex' follow
build/gengtype-parse.o: In function `struct_field_seq':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:688: undefined reference to `lexer_line'
build/gengtype-parse.o: In function `token':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
build/gengtype-parse.o: In function `type':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:778: undefined reference to `lexer_line'
build/gengtype-parse.o: In function `token':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
build/gengtype-parse.o:/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: more undefined references to `yylex' follow
build/gengtype-parse.o: In function `parse_file':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:947: undefined reference to `yybegin'
build/gengtype-parse.o: In function `token':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
build/gengtype-parse.o: In function `parse_file':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:982: undefined reference to `lexer_toplevel_done'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:987: undefined reference to `yyend'
build/gengtype-parse.o: In function `extern_or_static':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:888: undefined reference to `lexer_line'
build/gengtype-parse.o: In function `def_vec':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:914: undefined reference to `lexer_line'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:915: undefined reference to `lexer_line'
build/gengtype-parse.o: In function `def_vec_alloc':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:939: undefined reference to `lexer_line'
build/gengtype-parse.o: In function `typedef_decl':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:838: undefined reference to `lexer_line'
build/gengtype-parse.o: In function `token':
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
/home/ostylk/src/build-gcc/gcc/../../gcc_4_6_4_release/gcc/gengtype-parse.c:49: undefined reference to `yylex'
P.S. My linux distribution is: Elementary OS Luna (version: 0.2, 64-bit)