Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
coreboot gcc build fails (cross-build for I386 on amd64)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
SpiderPigLoki
n00b
n00b


Joined: 22 Aug 2008
Posts: 74

PostPosted: Sun Apr 05, 2020 7:24 pm    Post subject: coreboot gcc build fails (cross-build for I386 on amd64) Reply with quote

Hello everybody,

I am currently trying to build coreboot for my purism notebook.


Quote:

Building GCC v8.1.0 for target ...
build
[excerpt from coreboot/util/crossgcc/build-i386-elf-GCC/build.log]
g++ -fno-PIE -c -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.1.0/gcc -I../../gcc-8.1.0/gcc/. -I../../gcc-8.1.0/gcc/../include -I../../gcc-8.1.0/gcc/../libcpp/include -I/home/user/git/update/coreboot/util/crossgcc/xgcc/include -I/home/user/git/update/coreboot/util/crossgcc/xgcc/include -I/home/user/git/update/coreboot/util/crossgcc/xgcc/include -I../../gcc-8.1.0/gcc/../libdecnumber -I../../gcc-8.1.0/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc-8.1.0/gcc/../libbacktrace -o graphite-dependences.o -MT graphite-dependences.o -MMD -MP -MF ./.deps/graphite-dependences.TPo ../../gcc-8.1.0/gcc/graphite-dependences.c
g++ -fno-PIE -c -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.1.0/gcc -I../../gcc-8.1.0/gcc/. -I../../gcc-8.1.0/gcc/../include -I../../gcc-8.1.0/gcc/../libcpp/include -I/home/user/git/update/coreboot/util/crossgcc/xgcc/include -I/home/user/git/update/coreboot/util/crossgcc/xgcc/include -I/home/user/git/update/coreboot/util/crossgcc/xgcc/include -I../../gcc-8.1.0/gcc/../libdecnumber -I../../gcc-8.1.0/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc-8.1.0/gcc/../libbacktrace -o graphite-optimize-isl.o -MT graphite-optimize-isl.o -MMD -MP -MF ./.deps/graphite-optimize-isl.TPo ../../gcc-8.1.0/gcc/graphite-optimize-isl.c
../../gcc-8.1.0/gcc/graphite-dependences.c: In function 'isl_map* constrain_domain(isl_map*, isl_set*)':
../../gcc-8.1.0/gcc/graphite-dependences.c:48:16: error: 'isl_space_get_tuple_id' was not declared in this scope
isl_id *id = isl_space_get_tuple_id (d, isl_dim_in);
^~~~~~~~~~~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-dependences.c:48:16: note: suggested alternative: 'isl_map_get_tuple_id'
isl_id *id = isl_space_get_tuple_id (d, isl_dim_in);
^~~~~~~~~~~~~~~~~~~~~~
isl_map_get_tuple_id
../../gcc-8.1.0/gcc/graphite-dependences.c:51:3: error: 'isl_space_free' was not declared in this scope
isl_space_free (d);
^~~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-dependences.c:51:3: note: suggested alternative: 'isl_aff_free'
isl_space_free (d);
^~~~~~~~~~~~~~
isl_aff_free
../../gcc-8.1.0/gcc/graphite-dependences.c: In function 'isl_stat max_number_of_out_dimensions(isl_map*, void*)':
../../gcc-8.1.0/gcc/graphite-dependences.c:141:16: error: 'isl_space_dim' was not declared in this scope
int nb_out = isl_space_dim (space, isl_dim_out);
^~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-dependences.c:141:16: note: suggested alternative: 'isl_aff_dim'
int nb_out = isl_space_dim (space, isl_dim_out);
^~~~~~~~~~~~~
isl_aff_dim
../../gcc-8.1.0/gcc/graphite-dependences.c:147:3: error: 'isl_space_free' was not declared in this scope
isl_space_free (space);
^~~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-dependences.c:147:3: note: suggested alternative: 'isl_aff_free'
isl_space_free (space);
^~~~~~~~~~~~~~
isl_aff_free
../../gcc-8.1.0/gcc/graphite-dependences.c: In function 'isl_map* extend_map(isl_map*, int)':
../../gcc-8.1.0/gcc/graphite-dependences.c:157:11: error: 'isl_space_dim' was not declared in this scope
int n = isl_space_dim (space, isl_dim_out);
^~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c: In function 'void ivs_params_clear(ivs_params&)':
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:83:7: error: 'isl_id_free' was not declared in this scope
isl_id_free (it->first);
^~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-dependences.c:157:11: note: suggested alternative: 'isl_aff_dim'
int n = isl_space_dim (space, isl_dim_out);
^~~~~~~~~~~~~
isl_aff_dim
../../gcc-8.1.0/gcc/graphite-dependences.c:159:3: error: 'isl_space_free' was not declared in this scope
isl_space_free (space);
^~~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:83:7: note: suggested alternative: 'isl_aff_free'
isl_id_free (it->first);
^~~~~~~~~~~
isl_aff_free
../../gcc-8.1.0/gcc/graphite-dependences.c:159:3: note: suggested alternative: 'isl_aff_free'
isl_space_free (space);
^~~~~~~~~~~~~~
isl_aff_free
../../gcc-8.1.0/gcc/graphite-dependences.c: In function 'bool carries_deps(isl_union_map*, isl_union_map*, int)':
../../gcc-8.1.0/gcc/graphite-dependences.c:234:34: error: 'isl_space_range' was not declared in this scope
isl_map *lex = isl_map_lex_le (isl_space_range (space));
^~~~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c: In member function 'tree_node* translate_isl_ast_to_gimple::gcc_expression_from_isl_ast_expr_id(tree, isl_ast_expr*, ivs_params&)':
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:262:3: error: 'isl_id_free' was not declared in this scope
isl_id_free (tmp_isl_id);
^~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-dependences.c:234:34: note: suggested alternative: 'isl_map_range'
isl_map *lex = isl_map_lex_le (isl_space_range (space));
^~~~~~~~~~~~~~~
isl_map_range
../../gcc-8.1.0/gcc/graphite-dependences.c: In function 'void scop_get_dependences(scop_p)':
../../gcc-8.1.0/gcc/graphite-dependences.c:266:47: error: 'isl_space_copy' was not declared in this scope
isl_union_map *reads = isl_union_map_empty (isl_space_copy (space));
^~~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:262:3: note: suggested alternative: 'isl_aff_free'
isl_id_free (tmp_isl_id);
^~~~~~~~~~~
isl_aff_free
../../gcc-8.1.0/gcc/graphite-dependences.c:266:47: note: suggested alternative: 'isl_aff_copy'
isl_union_map *reads = isl_union_map_empty (isl_space_copy (space));
^~~~~~~~~~~~~~
isl_aff_copy
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c: In member function 'loop* translate_isl_ast_to_gimple::graphite_create_new_loop(edge, isl_ast_node*, loop_p, tree, tree, tree, ivs_params&)':
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:598:5: error: 'isl_id_free' was not declared in this scope
isl_id_free (res->first);
^~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:598:5: note: suggested alternative: 'isl_aff_free'
isl_id_free (res->first);
^~~~~~~~~~~
isl_aff_free
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c: In member function 'edge_def* translate_isl_ast_to_gimple::translate_isl_ast_for_loop(loop_p, isl_ast_node*, edge, tree, tree, tree, ivs_params&)':
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:638:53: error: 'isl_id_get_user' was not declared in this scope
ast_build_info *for_info = (ast_build_info *) isl_id_get_user (id);
^~~~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:638:53: note: suggested alternative: 'isl_arg_user'
ast_build_info *for_info = (ast_build_info *) isl_id_get_user (id);
^~~~~~~~~~~~~~~
isl_arg_user
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:641:7: error: 'isl_id_free' was not declared in this scope
isl_id_free (id);
^~~~~~~~~~~
make[1]: *** [Makefile:1110: graphite-dependences.o] Error 1
make[1]: *** Waiting for unfinished jobs....
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:641:7: note: suggested alternative: 'isl_aff_free'
isl_id_free (id);
^~~~~~~~~~~
isl_aff_free
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c: In member function 'edge_def* translate_isl_ast_to_gimple::translate_isl_ast_node_user(isl_ast_node*, edge, ivs_params&)':
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:802:31: error: 'isl_id_get_user' was not declared in this scope
poly_bb_p pbb = (poly_bb_p) isl_id_get_user (name_id);
^~~~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:802:31: note: suggested alternative: 'isl_arg_user'
poly_bb_p pbb = (poly_bb_p) isl_id_get_user (name_id);
^~~~~~~~~~~~~~~
isl_arg_user
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:808:3: error: 'isl_id_free' was not declared in this scope
isl_id_free (name_id);
^~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:808:3: note: suggested alternative: 'isl_aff_free'
isl_id_free (name_id);
^~~~~~~~~~~
isl_aff_free
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c: In function 'isl_id* ast_build_before_for(isl_ast_build*, void*)':
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:1367:19: error: 'isl_space_dim' was not declared in this scope
int dimension = isl_space_dim (schedule_space, isl_dim_out);
^~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:1367:19: note: suggested alternative: 'isl_aff_dim'
int dimension = isl_space_dim (schedule_space, isl_dim_out);
^~~~~~~~~~~~~
isl_aff_dim
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:1371:3: error: 'isl_space_free' was not declared in this scope
isl_space_free (schedule_space);
^~~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:1371:3: note: suggested alternative: 'isl_aff_free'
isl_space_free (schedule_space);
^~~~~~~~~~~~~~
isl_aff_free
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:1372:16: error: 'isl_id_alloc' was not declared in this scope
isl_id *id = isl_id_alloc (isl_ast_build_get_ctx (build), "", for_info);
^~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-isl-ast-to-gimple.c:1372:16: note: suggested alternative: 'isl_mat_alloc'
isl_id *id = isl_id_alloc (isl_ast_build_get_ctx (build), "", for_info);
^~~~~~~~~~~~
isl_mat_alloc
make[1]: *** [Makefile:1110: graphite-isl-ast-to-gimple.o] Error 1
../../gcc-8.1.0/gcc/graphite-optimize-isl.c: In function 'isl_schedule_node* get_schedule_for_node_st(isl_schedule_node*, void*)':
../../gcc-8.1.0/gcc/graphite-optimize-isl.c:58:19: error: 'isl_space_dim' was not declared in this scope
unsigned dims = isl_space_dim (space, isl_dim_set);
^~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-optimize-isl.c:58:19: note: suggested alternative: 'isl_aff_dim'
unsigned dims = isl_space_dim (space, isl_dim_set);
^~~~~~~~~~~~~
isl_aff_dim
../../gcc-8.1.0/gcc/graphite-optimize-isl.c:61:3: error: 'isl_space_free' was not declared in this scope
isl_space_free (space);
^~~~~~~~~~~~~~
../../gcc-8.1.0/gcc/graphite-optimize-isl.c:61:3: note: suggested alternative: 'isl_aff_free'
isl_space_free (space);
^~~~~~~~~~~~~~
isl_aff_free
make[1]: *** [Makefile:1110: graphite-optimize-isl.o] Error 1
rm gcc.pod
make[1]: Leaving directory '/home/user/git/update/coreboot/util/crossgcc/build-i386-elf-GCC/gcc'
make: *** [Makefile:4244: all-gcc] Error 2


So it seems to me, that this is an error with graphite? The use-flag was disabled, but only for version 9.2.0 on my host-system, which I'm not using. I cannot find GCC in version 8.3.1 on my system, yet it is displayed. Why is that?
Quote:

Gentoo /etc/portage # gcc-config -l
[1] x86_64-pc-linux-gnu-8.3.1 *
[2] x86_64-pc-linux-gnu-9.2.0


And yes, I resourced /etc/profile after I switched compilers. I have however not re-emerge libtool, like said in the gcc-upgrade guide in the gentoo wiki.

Could this maybe a lead? (Kind of afraid to do it TBH)

EDIT:
Sorry, I think I should have mentioned, that I am trying to build coreboot using the official script from my vendor (Purism) which can be found here: https://source.puri.sm/coreboot/utility

This script per default needs to be run as root / with sudo. AFAIK this is encouraged, at least for the linux kernel.
EDIT 2: OK, I give up for today. Building it as user, make is not able to locate bzip2 (obvs. installed with ABI 32 and 64 - if that maybe matters) and refuses to start. It starts however with sudo....
Back to top
View user's profile Send private message
sdauth
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2018
Posts: 142
Location: Frankreich

PostPosted: Sun Apr 05, 2020 10:18 pm    Post subject: Reply with quote

I don't use the purism script but to build the official coreboot crossgcc toolchain, I emerged "dev-lang/gnat-gpl" (with default USE flags) which builds GCC 8.3.1 with Ada support.
And the following variables set in /etc/portage/make.conf :

Code:
ADA=x86_64-pc-linux-gnu-gcc-8.3.1
ADAFLAGS=${CFLAGS}


Once done, I switched to that :

Code:
sudo gcc-config 1

 [1] x86_64-pc-linux-gnu-8.3.1 *
 [2] x86_64-pc-linux-gnu-9.3.0


then : source /etc/profile

Then try this to see if the coreboot toolchain builds correctly. (It is 9.2.0 currently if you use master branch)

Code:

git clone https://review.coreboot.org/coreboot
cd coreboot
git submodule update --init --checkout
make crossgcc-i386 CPUS="$(nproc)" && make iasl
Back to top
View user's profile Send private message
SpiderPigLoki
n00b
n00b


Joined: 22 Aug 2008
Posts: 74

PostPosted: Mon Apr 06, 2020 3:42 pm    Post subject: Reply with quote

sdauth wrote:
I emerged "dev-lang/gnat-gpl" (with default USE flags) which builds GCC 8.3.1 with Ada support.


Ok, so that explains why it works with 8.3.1 but not with 9.20. - cheers for the clear up!


Funny thing is that with sudo the official, vanilla, non-purism coreboot-code was able to compile. So I guess this is not like the linux-kernel, but actually needs to be compiled with root-rights.

I guess for now I am going to study and breakdown the purism-script and then build my own.

@sdauth: Thanks a lot for your reply.

KR
SPL
Back to top
View user's profile Send private message
sdauth
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2018
Posts: 142
Location: Frankreich

PostPosted: Tue Apr 07, 2020 1:12 pm    Post subject: Reply with quote

You don't need root rights to compile the coreboot toolchain. The purism script gives me headaches :lol: but I think that, in this particular case, it is required because of some commands used by the script to feed variables (like dmidecode for example) or to check dependencies.

By the way, I tried the script :
Code:

[...]
Extracting descriptor.bin
Extracting me.bin
Checking me.bin
Checking mrc.bin
Extracting mrc.bin
Checking refcode.elf
Extracting refcode.elf
Checking cpu_microcode_blob.bin
Extracting cpu_microcode_blob.bin
All blobs successfully verified

Ready to build coreboot - this will take some time depending on your connection
speed and CPU/RAM, esp if the toolchain needs to be built.

Press [Enter] to continue
coreboot toolchain version changed from 0 to CROSSGCC_VERSION="$(git log -n 1 --pretty=%h .)"
Cleaning crossgcc compiler before rebuilding it
Welcome to the coreboot cross toolchain builder v7385b656c2 (2019-10-27)

Building toolchain using 4 thread(s).

Target architecture is i386-elf

Found compatible Ada compiler, enabling Ada support by default.
Downloading and verifing tarballs ...
 * gmp-6.1.2.tar.xz (cached)... hash verified (9dc6981197a7d92f339192eea974f5eca48fcffe)
 * mpfr-4.0.2.tar.xz (cached)... hash verified (52c1f2a4c9a202f46cf3275a8d46b562aa584208)
 * mpc-1.1.0.tar.gz (cached)... hash verified (b019d9e1d27ec5fb99497159d43a3164995de2d0)
 * binutils-2.32.tar.xz (cached)... hash verified (cd45a512af1c8a508976c1beb4f5825b3bb89f4d)
 * gcc-8.3.0.tar.xz (cached)... hash verified (c27f4499dd263fe4fb01bcc5565917f3698583b2)
Downloaded tarballs ... ok
Unpacking and patching ...
 * gmp-6.1.2.tar.xz
   o gmp-6.1.2_freebsd-configure.patch
 * mpfr-4.0.2.tar.xz
 * mpc-1.1.0.tar.gz
 * binutils-2.32.tar.xz
   o binutils-2.32_as-ipxe.patch
   o binutils-2.32_mips-gold.patch
   o binutils-2.32_no-bfd-doc.patch
 * gcc-8.3.0.tar.xz
   o gcc-8.3.0_ada-musl_workaround.patch
   o gcc-8.3.0_gnat-bad_constant.patch
   o gcc-8.3.0_gnat.patch
   o gcc-8.3.0_libgcc.patch
   o gcc-8.3.0_nds32_ite.patch
Unpacked and patched ... ok
Building packages ...
Building GMP v6.1.2 for host ... ok
Building MPFR v4.0.2 for host ... ok
Building MPC v1.1.0 for host ... ok
Building BINUTILS v2.32 for target ... ok
Building GCC v8.3.0 for target ... failed. Check 'build-i386-elf-GCC/build.log'.
make[2]: *** [Makefile:26: build_gcc] Error 1
make[1]: *** [Makefile:51: build-i386] Error 2
make: *** [util/crossgcc/Makefile.inc:48: crossgcc-i386] Error 2


Very strange error (and the log doesn't say much either) as if I check out the source myself using 4.11 branch (the same used by purism script), crossgcc builds just fine. And as User of course. Maybe some patches they use are causing this, who knows, I'm too lazy to check. I don't know much about purism.

SpiderPigLoki wrote:

I guess for now I am going to study and breakdown the purism-script and then build my own.


This is the best thing to do indeed.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum