Bug 57578 - SPE detection broken on Linux (bits/predefs.h: No such file or directory)
Summary: SPE detection broken on Linux (bits/predefs.h: No such file or directory)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-10 16:22 UTC by Roland Stigge
Modified: 2014-04-05 09:54 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-06-11 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Stigge 2013-06-10 16:22:20 UTC
SPE detection broken on Linux (bits/predefs.h: No such file or directory)

The build of powerpc spe on Linux aborts like this:

[...]
/«PKGBUILDDIR»/build/./gcc/xgcc -B/«PKGBUILDDIR»/build/./gcc/ -B/usr/lib/gcc-snapshot/powerpc-linux-gnuspe/bin/ -B/usr/lib/gcc-snapshot/powerpc-linux-gnuspe/lib/ -isystem /usr/lib/gcc-snapshot/powerpc-linux-gnuspe/include -isystem /usr/lib/gcc-snapshot/powerpc-linux-gnuspe/sys-include    -g -O2 -O2  -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -mlong-double-128 -mno-minimal-toc -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -mlong-double-128 -mno-minimal-toc -I. -I. -I../.././gcc -I../../../src/libgcc -I../../../src/libgcc/. -I../../../src/libgcc/../gcc -I../../../src/libgcc/../include -I../../../src/libgcc/../libdecnumber/dpd -I../../../src/libgcc/../libdecnumber -DHAVE_CC_TLS  -o _gcov_merge_single.o -MT _gcov_merge_single.o -MD -MP -MF _gcov_merge_single.dep -DL_gcov_merge_single -c ../../../src/libgcc/libgcov.c
In file included from /usr/include/stdio.h:28:0,
                 from ../../../src/libgcc/../gcc/tsystem.h:87,
                 from ../../../src/libgcc/libgcov.c:27:
/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory
 #include <bits/predefs.h>
                          ^
compilation terminated.
[...]

Turns out that the detection of the SPE case is done via
rs6000/e500-double.h in $(tm_file_list), but e500-double.h was removed
recently, and hence not added anymore to $(tm_file_list). However, in
the SPE (i.e. e500v2) case, with_cpu is set exactly to 8548 in
config.gcc.

I solved this in gcc/config/rs6000/t-linux by replacing the line

MULTIARCH_DIRNAME = powerpc-linux-gnuspe$(if $(findstring rs6000/e500-double.h, $(tm_file_list)),,v1)

with

MULTIARCH_DIRNAME = powerpc-linux-gnuspe$(if $(findstring 8548,$(with_cpu)),,v1)

Thanks!
Comment 1 Matthias Klose 2013-06-11 08:07:43 UTC
looks ok to me, but please send this to the gcc-patches ML and CC the powerpc maintainers.
Comment 2 Roland Stigge 2013-06-12 11:19:32 UTC
OK, we have feedback now from Olivier Hainque:

> ... so looks correct to me. Thanks!

So as soon as the change is checked in, we can close this bug.

Thanks!
Comment 3 Matthias Klose 2014-04-05 09:54:48 UTC
works on trunk