Discussion:
gcc 7.2.0 error: no include path in which to search for stdc-predef.h
Marek
2017-11-27 07:09:00 UTC
Permalink
Hi,

while compiling 7.2.0 im getting the following:

cc1: error: no include path in which to search for stdc-predef.h
cc1: note: self-tests are not enabled in this build
In file included from ./../gcc/config.h:6:0,
from
/run/media/void/minnow/src/gcc-7.2.0/libcc1/libcc1plugin.cc:27:
./../gcc/auto-host.h:779:0: warning: "HAVE_DECL_BASENAME" redefined
#define HAVE_DECL_BASENAME 0

In file included from
/run/media/void/minnow/src/gcc-7.2.0/libcc1/libcc1plugin.cc:20:0:
./cc1plugin-config.h:6:0: note: this is the location of the previous definition
#define HAVE_DECL_BASENAME 1

In file included from ./../gcc/config.h:6:0,
from
/run/media/void/minnow/src/gcc-7.2.0/libcc1/libcp1plugin.cc:28:
./../gcc/auto-host.h:779:0: warning: "HAVE_DECL_BASENAME" redefined
#define HAVE_DECL_BASENAME 0

In file included from
/run/media/void/minnow/src/gcc-7.2.0/libcc1/libcp1plugin.cc:21:0:
./cc1plugin-config.h:6:0: note: this is the location of the previous definition
#define HAVE_DECL_BASENAME 1

configure: error: in
`/run/media/void/minnow/build/gcc-7.2.0/x86_64-lfs-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [Makefile:12068: configure-target-libgcc] Error 1
make: *** [Makefile:880: all] Error 2

If gcc is able to recognize between sources in one dir and objects in
another dir

Does a patch exist to fix this?

thanks,
Marek
Jim Wilson
2017-11-27 20:23:35 UTC
Permalink
Post by Marek
Hi,
cc1: error: no include path in which to search for stdc-predef.h
cc1: note: self-tests are not enabled in this build
This doesn't appear to be a build error. Configure runs the compiler to
check for features, and if a check fails, then the feature is disabled.
This is normal, and nothing to worry about. Though the message is
unusual. If the compiler is the one you just built, there might be
something wrong with it. Or there might be a minor configure script bug.
Post by Marek
configure: error: in
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [Makefile:12068: configure-target-libgcc] Error 1
make: *** [Makefile:880: all] Error 2
This is the real build error. You need to look at the config.log file
in the directory where configure failed to see what the problem is.
This is usually a build environment problem of some sort.
Post by Marek
If gcc is able to recognize between sources in one dir and objects in
another dir
Yes. The usual way to configure gcc is something like
mkdir build
cd build
../gcc/configure

Jim
Marek
2017-12-01 08:51:14 UTC
Permalink
It seems the last error preceeding the "suffix" error is "no include
path in which to search for stdc-predef.h"
"This error message is quite misleading and frequently the problem has
nothing to do with the message. You have to check the file
'config.log' in the directory where the error occurred. In the example
above, you would have to check the 'config.log' file in the directory
'/home/manu/gcc/gcc/i686-pc-linux-gnu/libgcc'. There might be several
test programs that failed during the configuration, but some of these
failures are non-critical. Check for the last error entry in the file.
I wonder where to find stdc-predef.h or whether it's generated by gcc
during compile time.
I'm also compiling against musl.

Marek
https://gcc.gnu.org/lists.html for information on the lists and what's
on-topic).
Post by Jim Wilson
Post by Marek
Hi,
cc1: error: no include path in which to search for stdc-predef.h
cc1: note: self-tests are not enabled in this build
This doesn't appear to be a build error. Configure runs the compiler to
check for features, and if a check fails, then the feature is disabled. This
is normal, and nothing to worry about. Though the message is unusual. If
the compiler is the one you just built, there might be something wrong with
it. Or there might be a minor configure script bug.
Post by Marek
configure: error: in
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [Makefile:12068: configure-target-libgcc] Error 1
make: *** [Makefile:880: all] Error 2
This is the real build error. You need to look at the config.log file in
the directory where configure failed to see what the problem is. This is
usually a build environment problem of some sort.
https://gcc.gnu.org/wiki/FAQ#configure_suffix
Post by Jim Wilson
Post by Marek
If gcc is able to recognize between sources in one dir and objects in
another dir
Yes. The usual way to configure gcc is something like
mkdir build
cd build
../gcc/configure
See https://gcc.gnu.org/wiki/InstallingGCC for more information,
including how to avoid the error above.
Kai Ruottu
2017-12-01 10:02:20 UTC
Permalink
Post by Marek
It seems the last error preceeding the "suffix" error is "no include
path in which to search for stdc-predef.h"
I wonder where to find stdc-predef.h or whether it's generated by gcc
during compile time.
This file comes with newer glibc versions. For instance glibc-2.17
coming with CentOS 7
has it in its '/usr/include'. Older glibc versions don't have it...
Post by Marek
I'm also compiling against musl.
No experience with that libc (https://www.musl-libc.org). Should it
include the 'stdc-predef.h'
in its '/usr/include'?
Post by Marek
configure: error: in
configure: error: cannot compute suffix of object files: cannot compile
The '-lfs' hints about a "making a hammer without any existing hammer"
case being in
question.  Not about a normal case like making a native or cross GCC for
CentOS 7 where the
target glibc (-2.17) is already made and tested and bug fixes will come
from the CentOS 7
maintainers for its glibc...

Ok, when your target is the 'x86_64-*-linux-gnu', identical with the
example CentOS 7/x86_64
and the default libc for it is glibc, how using 'musl' instead has been
taken care of?  Have you
installed some special patches into your local GCC sources?  Maybe there
is another target
name one should use like 'x86_64-lfs-linux-musl' in your case?
Kai Ruottu
2017-12-01 10:23:05 UTC
Permalink
Post by Kai Ruottu
Post by Marek
It seems the last error preceeding the "suffix" error is "no include
path in which to search for stdc-predef.h"
I wonder where to find stdc-predef.h or whether it's generated by gcc
during compile time.
This file comes with newer glibc versions. For instance glibc-2.17
coming with CentOS 7
has it in its '/usr/include'. Older glibc versions don't have it...
Post by Marek
I'm also compiling against musl.
No experience with that libc (https://www.musl-libc.org). Should it
include the 'stdc-predef.h'
in its '/usr/include'?
Answering to my own question... Yes, it should include this :

https://git.musl-libc.org/cgit/musl/tree/include
Post by Kai Ruottu
Maybe there is another target name one should use like
'x86_64-lfs-linux-musl' in your case?
The docs for musl are telling just this, one should use the
'<arch>-linux-musl' triplet!
Marek
2017-12-04 21:11:32 UTC
Permalink
looking at config.log i see theses errors:

configure:5941: checking for isl 0.15 or later
configure:5954: gcc -o conftest -g -O2 -I$$r/$(HOST_SUBDIR)/gmp
-I$$s/gmp -I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src -I$$s/mpc/src
-lisl -L$$r/$(HOST_SUBDIR)/gmp/.libs
-L$$r/$(HOST_SUBDIR)/mpfr/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/.libs
-lmpc -lmpfr -lgmp conftest.c -lisl -lgmp >&5
conftest.c: In function 'main':
conftest.c:14:1: warning: implicit declaration of function
'isl_options_set_schedule_serialize_sccs'; did you mean
'isl_options_set_schedule_split_scaled'?
[-Wimplicit-function-declaration]
isl_options_set_schedule_serialize_sccs (NULL, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
isl_options_set_schedule_split_scaled
/tmp/ccmCcjMj.o: In function `main':
/run/media/void/minnow/build/gcc-7.2.0/conftest.c:14: undefined
reference to `isl_options_set_schedule_serialize_sccs'
collect2: error: ld returned 1 exit status
configure:5954: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h. */
| #include <isl/schedule.h>
| int
| main ()
| {
| isl_options_set_schedule_serialize_sccs (NULL, 0);
| ;
| return 0;
| }
configure:5961: result: no
configure:5965: result: required isl version is 0.15 or later


configure:4314: $? = 0
configure:4303: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-musl/7.2.0/lto-wrapper
Target: x86_64-linux-musl
Configured with: /builddir/gcc-7.2.0/configure
--build=x86_64-linux-musl --enable-fast-character
--disable-libsanitizer --disable-symvers libat_cv_have_ifunc=no
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--libexecdir=/usr/lib --libdir=/usr/lib --enable-threads=posix
--enable-__cxa_atexit --disable-multilib --with-system-zlib
--enable-shared --enable-lto --enable-vtable-verify
--enable-linker-build-id --enable-serial-configure --disable-werror
--disable-nls --enable-default-pie --enable-default-ssp
--enable-checking=release --disable-libstdcxx-pch --with-isl
--with-linker-hash-style=gnu --disable-libunwind-exceptions
--disable-target-libiberty
--with-default-libstdcxx-abi=gcc4-compatible
--enable-languages=c,c++,objc,obj-c++,fortran,lto
Thread model: posix
gcc version 7.2.0 (GCC)
configure:4314: $? = 0
configure:4303: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4314: $? = 1
configure:4303: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean
'--version'?
gcc: fatal error: no input files
compilation terminated.

configure:4887: $? = 0
configure:4876: g++ -v >&5
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-musl/7.2.0/lto-wrapper
Target: x86_64-linux-musl
Configured with: /builddir/gcc-7.2.0/configure
--build=x86_64-linux-musl --enable-fast-character
--disable-libsanitizer --disable-symvers libat_cv_have_ifunc=no
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--libexecdir=/usr/lib --libdir=/usr/lib --enable-threads=posix
--enable-__cxa_atexit --disable-multilib --with-system-zlib
--enable-shared --enable-lto --enable-vtable-verify
--enable-linker-build-id --enable-serial-configure --disable-werror
--disable-nls --enable-default-pie --enable-default-ssp
--enable-checking=release --disable-libstdcxx-pch --with-isl
--with-linker-hash-style=gnu --disable-libunwind-exceptions
--disable-target-libiberty
--with-default-libstdcxx-abi=gcc4-compatible
--enable-languages=c,c++,objc,obj-c++,fortran,lto
Thread model: posix
gcc version 7.2.0 (GCC)
configure:4887: $? = 0
configure:4876: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:4887: $? = 1
configure:4876: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'; did you mean
'--version'?
g++: fatal error: no input files
compilation terminated.
Post by Kai Ruottu
Post by Marek
It seems the last error preceeding the "suffix" error is "no include
path in which to search for stdc-predef.h"
I wonder where to find stdc-predef.h or whether it's generated by gcc
during compile time.
This file comes with newer glibc versions. For instance glibc-2.17 coming
with CentOS 7
has it in its '/usr/include'. Older glibc versions don't have it...
Post by Marek
I'm also compiling against musl.
No experience with that libc (https://www.musl-libc.org). Should it
include the 'stdc-predef.h'
in its '/usr/include'?
https://git.musl-libc.org/cgit/musl/tree/include
Maybe there is another target name one should use like
'x86_64-lfs-linux-musl' in your case?
The docs for musl are telling just this, one should use the
'<arch>-linux-musl' triplet!
Jim Wilson
2017-12-05 18:31:39 UTC
Permalink
Configure does a number of feature tests to see what features are
available for use. It is expected that some of these feature tests will
fail. Some features are optional, and if that feature test fails there
is no problem; we just use an alternative feature. Some features are
required, and if that feature test fails then configure exits with an
error. If you get one of these, it will be the very last feature test
in the config.log file, and will have some kind of error message that
indicates that configure can not continue after this failure.

But this doesn't seem relevant to your problem, as Kai Ruottu already
pointed out what is wrong...
Post by Kai Ruottu
https://git.musl-libc.org/cgit/musl/tree/include
Post by Kai Ruottu
Maybe there is another target name one should use like
'x86_64-lfs-linux-musl' in your case?
The docs for musl are telling just this, one should use the
'<arch>-linux-musl' triplet!
Gcc assumes glibc for for a linux target. If you want to use musl, you
must include musl in the target triplet that you configure for. See the
gcc/config.gcc file, and look at the places where it checks the target
triplet for musl to enable musl support.

Jim

Loading...