[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
strangely.

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
instruction
                                  powf(1.055f * 255.0f, 4.0f));
                                  ^
  CC       gallivm/lp_bld_init.lo
  CC       gallivm/lp_bld_intr.lo
0x7d440f crash_signal
        ../../gcc-4.8.1/gcc/toplev.c:332
0x7fddcd7eb41f ???
       
/sources/glibc-2.18/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x55a0a3 do_mpfr_arg2
        ../../gcc-4.8.1/gcc/builtins.c:13734
0x564e35 fold_builtin_pow
        ../../gcc-4.8.1/gcc/builtins.c:8393
0x564e35 fold_builtin_2
        ../../gcc-4.8.1/gcc/builtins.c:10811
0x566973 fold_builtin_n
        ../../gcc-4.8.1/gcc/builtins.c:11066
0x571d7d fold_call_expr(unsigned int, tree_node*, bool)
        ../../gcc-4.8.1/gcc/builtins.c:11190
0x66a645 fold(tree_node*)
        ../../gcc-4.8.1/gcc/fold-const.c:14457
0x52d0ab c_fully_fold_internal
        ../../gcc-4.8.1/gcc/c-family/c-common.c:1153
0x52d6d6 c_fully_fold_internal
        ../../gcc-4.8.1/gcc/c-family/c-common.c:1262
0x52e142 c_fully_fold(tree_node*, bool, bool*)
        ../../gcc-4.8.1/gcc/c-family/c-common.c:1062
0x4ef813 convert_arguments
        ../../gcc-4.8.1/gcc/c/c-typeck.c:2979
0x4ef813 build_function_call_vec(unsigned int, tree_node*,
vec<tree_node*, va_gc, vl_embed>*, vec<tree_node*, va_gc, vl_embed>*)
        ../../gcc-4.8.1/gcc/c/c-typeck.c:2771
0x4fdf86 c_parser_postfix_expression_after_primary
        ../../gcc-4.8.1/gcc/c/c-parser.c:6908
0x4f6f60 c_parser_postfix_expression
        ../../gcc-4.8.1/gcc/c/c-parser.c:6770
0x4f863a c_parser_unary_expression
        ../../gcc-4.8.1/gcc/c/c-parser.c:5969
0x4fbd06 c_parser_cast_expression
        ../../gcc-4.8.1/gcc/c/c-parser.c:5821
0x4fbf1e c_parser_binary_expression
        ../../gcc-4.8.1/gcc/c/c-parser.c:5632
0x4fc747 c_parser_conditional_expression
        ../../gcc-4.8.1/gcc/c/c-parser.c:5427
0x4fcbc0 c_parser_expr_no_commas
        ../../gcc-4.8.1/gcc/c/c-parser.c:5347
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