Hi everyone, I am using linux/ppc and after porting llvm's jit for this architecture, I am currently trying to compile llvm-gcc on it. I have gcc 4.1.1 and use llvm-gcc from cvs. Compilation fails and the message is: gcc -O2 -DIN_GCC -DDEFAULT_TARGET_MACHINE=\"powerpc-unknown-linux-gnu\" -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -fno-common -DHAVE_CONFIG_H -o f771 f/bad.o f/bit.o f/bld.o f/com.o f/data.o f/equiv.o f/expr.o f/global.o f/implic.o f/info.o f/intrin.o f/lab.o f/lex.o f/malloc.o f/name.o f/parse.o f/src.o f/st.o f/sta.o f/stb.o f/stc.o f/std.o f/ste.o f/storag.o f/stp.o f/str.o f/sts.o f/stt.o f/stu.o f/stv.o f/stw.o f/symbol.o f/target.o f/top.o f/type.o f/where.o main.o libbackend.a ../libiberty/libiberty.a libbackend.a(llvm-out.o): In function `llvm_c_expand_body': llvm-out.c:(.text+0x1c2): undefined reference to `lang_expand_function_end' llvm-out.c:(.text+0x1c6): undefined reference to `lang_expand_function_end' libbackend.a(llvm-out.o): In function `llvm_init_asm_output': llvm-out.c:(.text+0x70e): undefined reference to `c_language' llvm-out.c:(.text+0x716): undefined reference to `c_language' llvm-out.c:(.text+0x7ba): undefined reference to `c_language' llvm-out.c:(.text+0x7c2): undefined reference to `c_language' llvm-out.c:(.text+0x7ea): undefined reference to `c_language' libbackend.a(llvm-expand.o): In function `llvm_emit_local_var': llvm-expand.c:(.text+0x16f48): undefined reference to `stmts_are_full_exprs_p' llvm-expand.c:(.text+0x16f60): undefined reference to `stmts_are_full_exprs_p' libbackend.a(llvm-expand.o): In function `genllvm_decl_stmt': llvm-expand.c:(.text+0x203a6): undefined reference to `lang_expand_decl_stmt' llvm-expand.c:(.text+0x203aa): undefined reference to `lang_expand_decl_stmt' llvm-expand.c:(.text+0x204d8): undefined reference to `anon_aggr_type_p' libbackend.a(llvm-expand.o): In function `llvm_expand_stmt': llvm-expand.c:(.text+0x20c98): undefined reference to `stmts_are_full_exprs_p' llvm-expand.c:(.text+0x20ca4): undefined reference to `prep_stmt' llvm-expand.c:(.text+0x20d64): undefined reference to `current_stmt_tree' llvm-expand.c:(.text+0x20ea4): undefined reference to `stmts_are_full_exprs_p' llvm-expand.c:(.text+0x20ecc): undefined reference to `stmts_are_full_exprs_p' llvm-expand.c:(.text+0x210fc): undefined reference to `stmts_are_full_exprs_p' llvm-expand.c:(.text+0x21108): undefined reference to `prep_stmt' llvm-expand.c:(.text+0x21118): undefined reference to `current_stmt_tree' libbackend.a(llvm-expand.o): In function `genllvm_for_stmt': llvm-expand.c:(.text+0x227e8): undefined reference to `stmts_are_full_exprs_p' llvm-expand.c:(.text+0x2283c): undefined reference to `stmts_are_full_exprs_p' libbackend.a(tree-inline.o): In function `copy_tree_r': tree-inline.c:(.text+0x2e2): undefined reference to `statement_code_p' tree-inline.c:(.text+0x2e6): undefined reference to `statement_code_p' libbackend.a(tree-inline.o): In function `walk_tree': tree-inline.c:(.text+0x436): undefined reference to `statement_code_p' tree-inline.c:(.text+0x43a): undefined reference to `statement_code_p' tree-inline.c:(.text+0x546): undefined reference to `statement_code_p' libbackend.a(tree-inline.o):tree-inline.c:(.text+0x54a): more undefined references to `statement_code_p' follow libbackend.a(tree-inline.o): In function `copy_body_r': tree-inline.c:(.text+0x2620): undefined reference to `build_stmt' tree-inline.c:(.text+0x26d4): undefined reference to `build_stmt' libbackend.a(tree-inline.o): In function `expand_call_inline': tree-inline.c:(.text+0x37a0): undefined reference to `build_stmt' tree-inline.c:(.text+0x3808): undefined reference to `build_stmt' tree-inline.c:(.text+0x386c): undefined reference to `build_stmt' libbackend.a(tree-inline.o):tree-inline.c:(.text+0x3c44): more undefined references to `build_stmt' follow libbackend.a(tree-inline.o): In function `expand_call_inline': tree-inline.c:(.text+0x3d54): undefined reference to `decl_constant_value' tree-inline.c:(.text+0x4108): undefined reference to `build_stmt' tree-inline.c:(.text+0x4390): undefined reference to `build_stmt' tree-inline.c:(.text+0x446c): undefined reference to `build_stmt' tree-inline.c:(.text+0x44e4): undefined reference to `build_stmt' tree-inline.c:(.text+0x4b78): undefined reference to `build_stmt' libbackend.a(tree-inline.o):tree-inline.c:(.text+0x4b90): more undefined references to `build_stmt' follow collect2: ld returned 1 exit status make[1]: *** [f771] Error 1 make[1]: Leaving directory `/home/varth/project/llvm-cvs/llvm-gcc/gcc' make: *** [all-gcc] Error 2 If anyone has a clue... Best, Nicolas
On Mon, 14 May 2007, Nicolas Geoffray wrote:> Hi everyone, I am using linux/ppc and after porting llvm's jit for this > architecture, I am currently trying to compile llvm-gcc on it. > > I have gcc 4.1.1 and use llvm-gcc from cvs.This looks like you're compiling llvm-gcc3, which is quite dead by now. Please follow these instructions: http://llvm.org/docs/CFEBuildInstrs.html In particular, following the instructions in README.LLVM is very important. Building the fortran front-end, for example, won't work. -Chris> Compilation fails and the message is: > > gcc -O2 -DIN_GCC > -DDEFAULT_TARGET_MACHINE=\"powerpc-unknown-linux-gnu\" -W -Wall > -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic > -Wno-long-long -fno-common -DHAVE_CONFIG_H -o f771 f/bad.o f/bit.o > f/bld.o f/com.o f/data.o f/equiv.o f/expr.o f/global.o f/implic.o > f/info.o f/intrin.o f/lab.o f/lex.o f/malloc.o f/name.o f/parse.o > f/src.o f/st.o f/sta.o f/stb.o f/stc.o f/std.o f/ste.o f/storag.o > f/stp.o f/str.o f/sts.o f/stt.o f/stu.o f/stv.o f/stw.o f/symbol.o > f/target.o f/top.o f/type.o f/where.o main.o libbackend.a > ../libiberty/libiberty.a > libbackend.a(llvm-out.o): In function `llvm_c_expand_body': > llvm-out.c:(.text+0x1c2): undefined reference to `lang_expand_function_end' > llvm-out.c:(.text+0x1c6): undefined reference to `lang_expand_function_end' > libbackend.a(llvm-out.o): In function `llvm_init_asm_output': > llvm-out.c:(.text+0x70e): undefined reference to `c_language' > llvm-out.c:(.text+0x716): undefined reference to `c_language' > llvm-out.c:(.text+0x7ba): undefined reference to `c_language' > llvm-out.c:(.text+0x7c2): undefined reference to `c_language' > llvm-out.c:(.text+0x7ea): undefined reference to `c_language' > libbackend.a(llvm-expand.o): In function `llvm_emit_local_var': > llvm-expand.c:(.text+0x16f48): undefined reference to > `stmts_are_full_exprs_p' > llvm-expand.c:(.text+0x16f60): undefined reference to > `stmts_are_full_exprs_p' > libbackend.a(llvm-expand.o): In function `genllvm_decl_stmt': > llvm-expand.c:(.text+0x203a6): undefined reference to > `lang_expand_decl_stmt' > llvm-expand.c:(.text+0x203aa): undefined reference to > `lang_expand_decl_stmt' > llvm-expand.c:(.text+0x204d8): undefined reference to `anon_aggr_type_p' > libbackend.a(llvm-expand.o): In function `llvm_expand_stmt': > llvm-expand.c:(.text+0x20c98): undefined reference to > `stmts_are_full_exprs_p' > llvm-expand.c:(.text+0x20ca4): undefined reference to `prep_stmt' > llvm-expand.c:(.text+0x20d64): undefined reference to `current_stmt_tree' > llvm-expand.c:(.text+0x20ea4): undefined reference to > `stmts_are_full_exprs_p' > llvm-expand.c:(.text+0x20ecc): undefined reference to > `stmts_are_full_exprs_p' > llvm-expand.c:(.text+0x210fc): undefined reference to > `stmts_are_full_exprs_p' > llvm-expand.c:(.text+0x21108): undefined reference to `prep_stmt' > llvm-expand.c:(.text+0x21118): undefined reference to `current_stmt_tree' > libbackend.a(llvm-expand.o): In function `genllvm_for_stmt': > llvm-expand.c:(.text+0x227e8): undefined reference to > `stmts_are_full_exprs_p' > llvm-expand.c:(.text+0x2283c): undefined reference to > `stmts_are_full_exprs_p' > libbackend.a(tree-inline.o): In function `copy_tree_r': > tree-inline.c:(.text+0x2e2): undefined reference to `statement_code_p' > tree-inline.c:(.text+0x2e6): undefined reference to `statement_code_p' > libbackend.a(tree-inline.o): In function `walk_tree': > tree-inline.c:(.text+0x436): undefined reference to `statement_code_p' > tree-inline.c:(.text+0x43a): undefined reference to `statement_code_p' > tree-inline.c:(.text+0x546): undefined reference to `statement_code_p' > libbackend.a(tree-inline.o):tree-inline.c:(.text+0x54a): more undefined > references to `statement_code_p' follow > libbackend.a(tree-inline.o): In function `copy_body_r': > tree-inline.c:(.text+0x2620): undefined reference to `build_stmt' > tree-inline.c:(.text+0x26d4): undefined reference to `build_stmt' > libbackend.a(tree-inline.o): In function `expand_call_inline': > tree-inline.c:(.text+0x37a0): undefined reference to `build_stmt' > tree-inline.c:(.text+0x3808): undefined reference to `build_stmt' > tree-inline.c:(.text+0x386c): undefined reference to `build_stmt' > libbackend.a(tree-inline.o):tree-inline.c:(.text+0x3c44): more undefined > references to `build_stmt' follow > libbackend.a(tree-inline.o): In function `expand_call_inline': > tree-inline.c:(.text+0x3d54): undefined reference to `decl_constant_value' > tree-inline.c:(.text+0x4108): undefined reference to `build_stmt' > tree-inline.c:(.text+0x4390): undefined reference to `build_stmt' > tree-inline.c:(.text+0x446c): undefined reference to `build_stmt' > tree-inline.c:(.text+0x44e4): undefined reference to `build_stmt' > tree-inline.c:(.text+0x4b78): undefined reference to `build_stmt' > libbackend.a(tree-inline.o):tree-inline.c:(.text+0x4b90): more undefined > references to `build_stmt' follow > collect2: ld returned 1 exit status > make[1]: *** [f771] Error 1 > make[1]: Leaving directory `/home/varth/project/llvm-cvs/llvm-gcc/gcc' > make: *** [all-gcc] Error 2 > > If anyone has a clue... > > Best, > Nicolas > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-Chris -- http://nondot.org/sabre/ http://llvm.org/
Chris Lattner wrote:> > This looks like you're compiling llvm-gcc3, which is quite dead by now. > Please follow these instructions: > http://llvm.org/docs/CFEBuildInstrs.html > >Oups, sorry for that. Here is the error message with the latest svn version: gcc -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -DHAVE_CONFIG_H -DENABLE_LLVM -D__STDC_LIMIT_MACROS -I. -I. -I../../trunk/gcc -I../../trunk/gcc/. -I../../trunk/gcc/../include -I../../trunk/gcc/../libcpp/include -I/home/varth/project/llvm-cvs/llvm/include -I/usr/local/home/varth/project/llvm-cvs/llvm/include ../../trunk/gcc/stor-layout.c -o stor-layout.o ../../trunk/gcc/stor-layout.c:450:25: error: macro "ADJUST_FIELD_ALIGN" passed 3 arguments, but takes just 2 ../../trunk/gcc/stor-layout.c: In function 'layout_decl': ../../trunk/gcc/stor-layout.c:449: error: 'ADJUST_FIELD_ALIGN' undeclared (first use in this function) ../../trunk/gcc/stor-layout.c:449: error: (Each undeclared identifier is reported only once ../../trunk/gcc/stor-layout.c:449: error: for each function it appears in.) ../../trunk/gcc/stor-layout.c:711:43: error: macro "ADJUST_FIELD_ALIGN" passed 3 arguments, but takes just 2 ../../trunk/gcc/stor-layout.c: In function 'update_alignment_for_field': ../../trunk/gcc/stor-layout.c:708: error: 'ADJUST_FIELD_ALIGN' undeclared (first use in this function) ../../trunk/gcc/stor-layout.c:760:41: error: macro "ADJUST_FIELD_ALIGN" passed 3 arguments, but takes just 2 ../../trunk/gcc/stor-layout.c:994:44: error: macro "ADJUST_FIELD_ALIGN" passed 3 arguments, but takes just 2 ../../trunk/gcc/stor-layout.c: In function 'place_field': ../../trunk/gcc/stor-layout.c:991: error: 'ADJUST_FIELD_ALIGN' undeclared (first use in this function) ../../trunk/gcc/stor-layout.c:1031:44: error: macro "ADJUST_FIELD_ALIGN" passed 3 arguments, but takes just 2 make[1]: *** [stor-layout.o] Error 1 make[1]: Leaving directory `/home/varth/project/llvm-cvs/llvm-gcc4/obj/gcc' make: *** [all-gcc] Error 2 I looked a bit at the source, and the gcc/config/darwin.h declares a ADJUST_FIELD_ALIGN with two arguments whereas all other back-ends that declare ADJUST_FIELD_ALIGN have only two arguments. And it seems that stor-layout.c assumes that if we have ADJUST_FIELD_ALIGN defined, then we're on darwin. Nicolas