archfan / coreboot

Coreboot for Lenovo Thinkpad T440P with additional patches
GNU General Public License v2.0
14 stars 2 forks source link

Issues building cross-compiler even though gcc-ada installed #14

Closed bitshiftnetau closed 3 years ago

bitshiftnetau commented 4 years ago

Running this up on Arch Linux and I can't seem to build the i386 toolchain.

I've installed gcc-ada and all of the requirements for Arch Linux, it should be noted that I don't have any issues compiling the toolchain in the upstream coreboot.

When it gets to building GCC this is the error I get:

mv b_gnatb.adb b_gnatb.ads ada/
g++ -no-pie   -O2  -fomit-frame-pointer -m64  -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  -o Tlto-wrapper \
   lto-wrapper.o collect-utils.o ggc-none.o libcommon-target.a libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a 
mv -f Tcollect2 collect2
g++ -no-pie   -O2  -fomit-frame-pointer -m64  -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  gcc-ar.o -o gcc-ar \
    file-find.o libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  
g++ -no-pie   -O2  -fomit-frame-pointer -m64  -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  gcc-nm.o -o gcc-nm \
    file-find.o libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  
mv -f Tlto-wrapper lto-wrapper
g++ -no-pie   -O2  -fomit-frame-pointer -m64  -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  gcc-ranlib.o -o gcc-ranlib \
    file-find.o libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  
g++ -no-pie   -O2  -fomit-frame-pointer -m64  -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  -o gengtype \
    gengtype.o gengtype-lex.o gengtype-parse.o gengtype-state.o version.o errors.o libcommon.a ../libcpp/libcpp.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a ../libbacktrace/.libs/libbacktrace.a libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a 
g++ -fno-PIE -c  -DSTANDARD_STARTFILE_PREFIX=\"../../../\" -DSTANDARD_EXEC_PREFIX=\"/home/access/code/coreboot/t440p/coreboot-t440p-fork/util/crossgcc/xgcc/lib/gcc/\" -DSTANDARD_LIBEXEC_PREFIX=\"/home/access/code/coreboot/t440p/coreboot-t440p-fork/util/crossgcc/xgcc/lib/gcc/\" -DDEFAULT_TARGET_VERSION=\"8.3.0\" -DDEFAULT_REAL_TARGET_MACHINE=\"i386-elf\" -DDEFAULT_TARGET_MACHINE=\"i386-elf\" -DSTANDARD_BINDIR_PREFIX=\"/home/access/code/coreboot/t440p/coreboot-t440p-fork/util/crossgcc/xgcc/bin/\" -DTOOLDIR_BASE_PREFIX=\"../../../../\" -DACCEL_DIR_SUFFIX=\"\"   -DCONFIGURE_SPECS="\"\"" -DBASEVER="\"8.3.0\"" -O2  -fomit-frame-pointer -m64  -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc-8.3.0/gcc -I../../gcc-8.3.0/gcc/. -I../../gcc-8.3.0/gcc/../include -I../../gcc-8.3.0/gcc/../libcpp/include -I/home/access/code/coreboot/t440p/coreboot-t440p-fork/util/crossgcc/xgcc/include -I/home/access/code/coreboot/t440p/coreboot-t440p-fork/util/crossgcc/xgcc/include -I/home/access/code/coreboot/t440p/coreboot-t440p-fork/util/crossgcc/xgcc/include  -I../../gcc-8.3.0/gcc/../libdecnumber -I../../gcc-8.3.0/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc-8.3.0/gcc/../libbacktrace   -o gcc.o -MT gcc.o -MMD -MP -MF ./.deps/gcc.TPo ../../gcc-8.3.0/gcc/gcc.c
gnatgcc -c -O2  -fomit-frame-pointer -m64   -gnatp -gnatws -nostdinc -I- -I. -Iada/generated -Iada -I../../gcc-8.3.0/gcc/ada -I../../gcc-8.3.0/gcc/ada/gcc-interface -Iada/libgnat -I../../gcc-8.3.0/gcc/ada/libgnat \
    ada/b_gnatb.adb -o ada/b_gnatb.o
g++ -no-pie -O2 -fomit-frame-pointer -m64 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  -o gnatbind ada/b_gnatb.o ada/libgnat/a-elchha.o ada/libgnat/a-except.o ada/libgnat/ada.o ada/adaint.o ada/ali-util.o ada/ali.o ada/alloc.o ada/argv.o ada/aspects.o ada/atree.o ada/bcheck.o ada/binde.o ada/binderr.o ada/bindgen.o ada/bindusg.o ada/butil.o ada/casing.o ada/cio.o ada/csets.o ada/cstreams.o ada/debug.o ada/einfo.o ada/elists.o ada/env.o ada/err_vars.o ada/errout.o ada/erroutc.o ada/exit.o ada/final.o ada/fmap.o ada/fname-uf.o ada/fname.o ada/libgnat/g-byorma.o ada/libgnat/g-hesora.o ada/libgnat/g-htable.o ada/libgnat/gnat.o ada/gnatbind.o ada/gnatvsn.o ada/hostparm.o ada/init.o ada/initialize.o ada/libgnat/interfac.o ada/krunch.o ada/lib.o ada/link.o ada/namet.o ada/nlists.o ada/opt.o ada/osint-b.o ada/osint.o ada/output.o ada/raise.o ada/raise-gcc.o ada/restrict.o ada/rident.o ada/rtfinal.o ada/rtinit.o ada/libgnat/s-addope.o ada/libgnat/s-assert.o ada/libgnat/s-carun8.o ada/libgnat/s-casuti.o ada/libgnat/s-conca2.o ada/libgnat/s-conca3.o ada/libgnat/s-conca4.o ada/libgnat/s-conca5.o ada/libgnat/s-conca6.o ada/libgnat/s-conca7.o ada/libgnat/s-conca8.o ada/libgnat/s-conca9.o ada/libgnat/s-crc32.o ada/libgnat/s-crtl.o ada/libgnat/s-excdeb.o ada/libgnat/s-except.o ada/libgnat/s-excmac.o ada/libgnat/s-exctab.o ada/libgnat/s-htable.o ada/libgnat/s-imenne.o ada/libgnat/s-imgenu.o ada/libgnat/s-imgint.o ada/libgnat/s-mastop.o ada/libgnat/s-memory.o ada/libgnat/s-os_lib.o ada/libgnat/s-parame.o ada/libgnat/s-resfil.o ada/libgnat/s-restri.o ada/libgnat/s-secsta.o ada/libgnat/s-soflin.o ada/libgnat/s-soliin.o ada/libgnat/s-sopco3.o ada/libgnat/s-sopco4.o ada/libgnat/s-sopco5.o ada/libgnat/s-stache.o ada/libgnat/s-stalib.o ada/libgnat/s-stoele.o ada/libgnat/s-strhas.o ada/libgnat/s-string.o ada/libgnat/s-strops.o ada/libgnat/s-traent.o ada/libgnat/s-traceb.o ada/libgnat/s-unstyp.o ada/libgnat/s-utf_32.o ada/libgnat/s-wchcnv.o ada/libgnat/s-wchcon.o ada/libgnat/s-wchjis.o ada/libgnat/s-wchstw.o ada/scans.o ada/scil_ll.o ada/scng.o ada/sdefault.o ada/seh_init.o ada/sem_aux.o ada/sinfo.o ada/sinput-c.o ada/sinput.o ada/snames.o ada/stand.o ada/stringt.o ada/style.o ada/styleg.o ada/stylesw.o ada/switch-b.o ada/switch.o ada/libgnat/system.o ada/table.o ada/targext.o ada/targparm.o ada/tree_io.o ada/types.o ada/uintp.o ada/uname.o ada/urealp.o ada/widechar.o ggc-none.o libcommon-target.a libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a   -O2  -fomit-frame-pointer -m64 
/usr/bin/ld: ada/ali.o: in function `ali__scan_ali.cold':
ali.adb:(.text.unlikely+0xa): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: ali.adb:(.text.unlikely+0x31): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ali.adb:(.text.unlikely+0x4e): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: ali.adb:(.text.unlikely+0x5b): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ali.adb:(.text.unlikely+0x7c): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: ali.adb:(.text.unlikely+0x135): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ali.adb:(.text.unlikely+0x154): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: ali.adb:(.text.unlikely+0x1a9): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ali.adb:(.text.unlikely+0x1c4): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: ali.adb:(.text.unlikely+0x1e1): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ali.adb:(.text.unlikely+0x20a): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/gnatbind.o: in function `_ada_gnatbind.cold':
gnatbind.adb:(.text.unlikely+0xd): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: gnatbind.adb:(.text.unlikely+0x27): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/output.o: in function `output__flush_buffer.cold':
output.adb:(.text.unlikely+0xd): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: output.adb:(.text.unlikely+0x65): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/restrict.o: in function `restrict__check_restriction__update_restrictions.2.cold':
restrict.adb:(.text.unlikely+0x20): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: restrict.adb:(.text.unlikely+0x45): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/libgnat/s-os_lib.o: in function `system__os_lib__gm_split.cold':
s-os_lib.adb:(.text.unlikely+0xa): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: s-os_lib.adb:(.text.unlikely+0x31): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/libgnat/s-os_lib.o: in function `system__os_lib__create_temp_file_internal.constprop.0.cold':
s-os_lib.adb:(.text.unlikely+0x48): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: s-os_lib.adb:(.text.unlikely+0x6f): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/libgnat/s-os_lib.o: in function `system__os_lib__copy_file.cold':
s-os_lib.adb:(.text.unlikely+0xb9): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: s-os_lib.adb:(.text.unlikely+0xc9): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/libgnat/s-resfil.o: in function `system__response_file__arguments_from__recurse.0.cold':
s-resfil.adb:(.text.unlikely+0x11): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: s-resfil.adb:(.text.unlikely+0x3d): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/libgnat/s-resfil.o: in function `system__response_file__arguments_from.cold':
s-resfil.adb:(.text.unlikely+0x60): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: s-resfil.adb:(.text.unlikely+0xec): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/switch-b.o: in function `switch__b__scan_binder_switches__get_stack_size.0.cold':
switch-b.adb:(.text.unlikely+0xa): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: switch-b.adb:(.text.unlikely+0x48): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/switch-b.o: in function `switch__b__scan_binder_switches.cold':
switch-b.adb:(.text.unlikely+0x5e): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: switch-b.adb:(.text.unlikely+0x85): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/targparm.o: in function `targparm__get_target_parameters.cold':
targparm.adb:(.text.unlikely+0xa): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: targparm.adb:(.text.unlikely+0x17): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/tree_io.o: in function `tree_io__tree_read_terminate.cold':
tree_io.adb:(.text.unlikely+0xa): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: tree_io.adb:(.text.unlikely+0x18): undefined reference to `__gnat_end_handler_v1'
/usr/bin/ld: ada/widechar.o: in function `widechar__scan_wide.cold':
widechar.adb:(.text.unlikely+0xa): undefined reference to `__gnat_begin_handler_v1'
/usr/bin/ld: widechar.adb:(.text.unlikely+0x1c): undefined reference to `__gnat_end_handler_v1'
collect2: error: ld returned 1 exit status
make[1]: *** [../../gcc-8.3.0/gcc/ada/gcc-interface/Make-lang.in:662: gnatbind] Error 1
make[1]: *** Waiting for unfinished jobs....
mv b_gnat1.adb b_gnat1.ads ada/
make[1]: Leaving directory '/home/access/code/coreboot/t440p/coreboot-t440p-fork/util/crossgcc/build-i386-elf-GCC/gcc'
make: *** [Makefile:4244: all-gcc] Error 2
mytbk commented 3 years ago

Upstream coreboot has fixed this. https://review.coreboot.org/c/coreboot/+/42158 And I think you'd better use the upstream coreboot code.

bitshiftnetau commented 3 years ago

@mytbk roger that, I ended up using upstream :)