[blfs-support] BLFS 7.4: X11 - MesaLib - strange compilation error and workaround

Bernd Bausch berndbausch at gmail.com
Wed Dec 18 23:19:28 PST 2013

My goal is to build a GUI. Today a strange error hit when making MesaLib
in chapter 24. All prerequisites should be there, even the recommended
optional ones. The only place where I cut corners is LLVM - I did not
install the optional components /Clang/ and /Compiler RT/.

After patching and configuring exactly as described in the book, "make"
fails with a scary error "internal compiler error: Illegal instruction"
when compiling Gallium code. The compiler chokes on this
innocent-looking statement, dumps a stack trace and dies:
      coeff = lp_build_const_vec(gallivm, src_type,
                                 1.0f / (3.0f * coeff_f) * 0.999852f *
                                 powf(1.055f * 255.0f, 4.0f));
Detailed output is at the end of this message.

The powf() call has only constant parameters, so that it should be
possible to replace it with 5238061103.270562891. I did that and
succeeded in making the software. Unfortunately it has no test suite, so
that I am not 100% sure if my solution is really a solution. Time will
tell, probably after I compiled everything else and my GUI behaves

Without this solution, what steps could I take to narrow the error down?
And why do I get this error and nobody else?

Here is what I consider the relevant part of the compiler output:

  CC       gallivm/lp_bld_format_soa.lo
  CC       gallivm/lp_bld_format_yuv.lo
  CC       gallivm/lp_bld_gather.lo
gallivm/lp_bld_format_srgb.c: In function 'lp_build_linear_to_srgb':
gallivm/lp_bld_format_srgb.c:219:34: internal compiler error: Illegal
                                  powf(1.055f * 255.0f, 4.0f));
  CC       gallivm/lp_bld_init.lo
  CC       gallivm/lp_bld_intr.lo
0x7d440f crash_signal
0x7fddcd7eb41f ???
0x55a0a3 do_mpfr_arg2
0x564e35 fold_builtin_pow
0x564e35 fold_builtin_2
0x566973 fold_builtin_n
0x571d7d fold_call_expr(unsigned int, tree_node*, bool)
0x66a645 fold(tree_node*)
0x52d0ab c_fully_fold_internal
0x52d6d6 c_fully_fold_internal
0x52e142 c_fully_fold(tree_node*, bool, bool*)
0x4ef813 convert_arguments
0x4ef813 build_function_call_vec(unsigned int, tree_node*,
vec<tree_node*, va_gc, vl_embed>*, vec<tree_node*, va_gc, vl_embed>*)
0x4fdf86 c_parser_postfix_expression_after_primary
0x4f6f60 c_parser_postfix_expression
0x4f863a c_parser_unary_expression
0x4fbd06 c_parser_cast_expression
0x4fbf1e c_parser_binary_expression
0x4fc747 c_parser_conditional_expression
0x4fcbc0 c_parser_expr_no_commas
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/blfs-support/attachments/20131219/bda9ff7e/attachment.html>

More information about the blfs-support mailing list