public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Unable to build libgcc for target x86_64-w64-mingw32, C preprocessor /lib/cpp fails sanity check
@ 2018-09-22 20:23 Juan Pablo Garibotti Arias
  2018-09-22 21:56 ` Christer Solskogen
  0 siblings, 1 reply; 3+ messages in thread
From: Juan Pablo Garibotti Arias @ 2018-09-22 20:23 UTC (permalink / raw)
  To: gcc-help

Hello,

I'm trying to build a cross compiler for UEFI, and having difficulties
building libgcc after having built the compilers themselves. I've already
built a cross compiler and libgcc (with and without red-zone) for
freestanding x86_64-elf in the same machine, so not sure what the issue is.

The machine is an Arch vm, with the following packages installed through
pacman:
gcc-8.2.1+20180831-1
bison-3.0.5-1
flex-2.6.4-1
gmp-6.1.2-1
libmpc-1.1.0-1
mpfr-4.0.1-1
texinfo-6.5-1
From the AUR, I got:
osl-0.9.2-2
isl-0.20-4
cloog-0.20.0-1

I'm using binutils 2.31 (compiled separately, binutils for
target x86_64-w64-mingw32 were built and installed fine to the same prefix
I'm trying to install my cross compiler to). For gcc, I'm using the branch
gcc-8-branch at revision 264489. I tried to use the 8.2.0 release, but I
ran into an issue with isl 0.20 having moved some headers around, causing
the build to fail. That was fixed in the branch with gcc 8.2.1.

The source for gcc was downloaded to ~/src/gcc. After that, I did:
export PREFIX="$HOME/opt/cross"
export TARGET=x86_64-w64-mingw32
export PATH="$PREFIX/bin:$PATH"
mkdir ~/src/gcc-build-$TARGET
cd ~/src/gcc-build-$TARGET
../gcc/configure --target=$TARGET --prefix="$PREFIX" --disable-nls
--enable-languages=c,c++ --without-headers
make all-gcc

This far, everything worked ok. Then I did:
make all-target-libgcc

And that's where I hit a wall. Make fails with the last few lines of output
being:
checking how to run the C preprocessor... /lib/cpp
configure: error: in
`/home/os/src/gcc-build-x86_64-w64-mingw32/x86_64-w64-mingw32/libgcc':
configure: error: C preprocessor "/lib/cpp"fails sanity check
See `config.log' for more details.
make: *** [Makefile:12659: configure-target-libgcc] Error 1

I won't copy the whole contents of the config log (unless someone feels
they'd be useful) but where it starts having issues it shows (log is at
x86_64-w64-mingw32/libgcc/config.log):

///---***---///  <- Search for this if you want to skip the log

configure:3933: checking how to run the C preprocessor
configure:3964:  /home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/xgcc
-B/home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/
-L/home/os/opt/cross/x86_64-w64-mingw32/lib -L/home/os/opt/cross/mingw/lib
-isystem /home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/mingw/include
-B/home/os/opt/cross/x86_64-w64-mingw32/bin/
-B/home/os/opt/cross/x86_64-w64-mingw32/lib/ -isystem
/home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/x86_64-w64-mingw32/sys-include    -E  conftest.c
In file included from
/home/os/src/gcc-build-x86_64-w64-mingw32/gcc/include-fixed/syslimits.h:7,
                 from
/home/os/src/gcc-build-x86_64-w64-mingw32/gcc/include-fixed/limits.h:34,
                 from conftest.c:10:
/home/os/src/gcc-build-x86_64-w64-mingw32/gcc/include-fixed/limits.h:194:61:
error: no include path in which to search for limits.h
 #include_next <limits.h>  /* recurse down to the real one */
                                                             ^
configure:3964: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|      Syntax error
configure:3964:  /home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/xgcc
-B/home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/
-L/home/os/opt/cross/x86_64-w64-mingw32/lib -L/home/os/opt/cross/mingw/lib
-isystem /home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/mingw/include
-B/home/os/opt/cross/x86_64-w64-mingw32/bin/
-B/home/os/opt/cross/x86_64-w64-mingw32/lib/ -isystem
/home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/x86_64-w64-mingw32/sys-include    -E  conftest.c
In file included from
/home/os/src/gcc-build-x86_64-w64-mingw32/gcc/include-fixed/syslimits.h:7,
                 from
/home/os/src/gcc-build-x86_64-w64-mingw32/gcc/include-fixed/limits.h:34,
                 from conftest.c:10:
/home/os/src/gcc-build-x86_64-w64-mingw32/gcc/include-fixed/limits.h:194:61:
error: no include path in which to search for limits.h
 #include_next <limits.h>  /* recurse down to the real one */
                                                             ^
configure:3964: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|      Syntax error
configure:3964:  /home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/xgcc
-B/home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/
-L/home/os/opt/cross/x86_64-w64-mingw32/lib -L/home/os/opt/cross/mingw/lib
-isystem /home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/mingw/include
-B/home/os/opt/cross/x86_64-w64-mingw32/bin/
-B/home/os/opt/cross/x86_64-w64-mingw32/lib/ -isystem
/home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/x86_64-w64-mingw32/sys-include    -E -traditional-cpp
conftest.c
conftest.c:13:2: fatal error: assert.h: No such file or directory
 #endif
  ^~~~~
compilation terminated.
configure:3964: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|      Syntax error
configure:3964:  /home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/xgcc
-B/home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/
-L/home/os/opt/cross/x86_64-w64-mingw32/lib -L/home/os/opt/cross/mingw/lib
-isystem /home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/mingw/include
-B/home/os/opt/cross/x86_64-w64-mingw32/bin/
-B/home/os/opt/cross/x86_64-w64-mingw32/lib/ -isystem
/home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/x86_64-w64-mingw32/sys-include    -E -traditional-cpp
conftest.c
conftest.c:13:2: fatal error: assert.h: No such file or directory
 #endif
  ^~~~~
compilation terminated.
configure:3964: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|      Syntax error
configure:3964: /lib/cpp  conftest.c
/home/os/src/gcc/libgcc/configure: line 1486: /lib/cpp: No such file or
directory
configure:3964: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|      Syntax error
configure:3964: /lib/cpp  conftest.c
/home/os/src/gcc/libgcc/configure: line 1486: /lib/cpp: No such file or
directory
configure:3964: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|      Syntax error
configure:4003: result: /lib/cpp
configure:4023: /lib/cpp  conftest.c
/home/os/src/gcc/libgcc/configure: line 1486: /lib/cpp: No such file or
directory
configure:4023: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|      Syntax error
configure:4023: /lib/cpp  conftest.c
/home/os/src/gcc/libgcc/configure: line 1486: /lib/cpp: No such file or
directory
configure:4023: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|      Syntax error
configure:4053: error: in
`/home/os/src/gcc-build-x86_64-w64-mingw32/x86_64-w64-mingw32/libgcc':
configure:4056: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.

///---***---///

After these there are a few more sections in the log. Cache variables and
output variables. Included for completeness:

///---***---///

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=set
ac_cv_env_CC_value=' /home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/xgcc
-B/home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/
-L/home/os/opt/cross/x86_64-w64-mingw32/lib -L/home/os/opt/cross/mingw/lib
-isystem /home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/mingw/include
-B/home/os/opt/cross/x86_64-w64-mingw32/bin/
-B/home/os/opt/cross/x86_64-w64-mingw32/lib/ -isystem
/home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/x86_64-w64-mingw32/sys-include   '
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-g -O2'
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=x86_64-pc-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=x86_64-w64-mingw32
ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=x86_64-w64-mingw32
ac_cv_host=x86_64-w64-mingw32
ac_cv_objext=o
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AR=/home/os/opt/cross/x86_64-w64-mingw32/bin/ar
ac_cv_prog_AWK=gawk
ac_cv_prog_CC=' /home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/xgcc
-B/home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/
-L/home/os/opt/cross/x86_64-w64-mingw32/lib -L/home/os/opt/cross/mingw/lib
-isystem /home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/mingw/include
-B/home/os/opt/cross/x86_64-w64-mingw32/bin/
-B/home/os/opt/cross/x86_64-w64-mingw32/lib/ -isystem
/home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/x86_64-w64-mingw32/sys-include   '
ac_cv_prog_CPP=/lib/cpp
ac_cv_prog_LIPO=x86_64-w64-mingw32-lipo
ac_cv_prog_NM=/home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/nm
ac_cv_prog_RANLIB=/home/os/opt/cross/x86_64-w64-mingw32/bin/ranlib
ac_cv_prog_STRIP=/home/os/opt/cross/x86_64-w64-mingw32/bin/strip
ac_cv_prog_cc_c89=no
ac_cv_prog_cc_g=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='/home/os/opt/cross/x86_64-w64-mingw32/bin/ar'
AWK='gawk'
CC=' /home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/xgcc
-B/home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/
-L/home/os/opt/cross/x86_64-w64-mingw32/lib -L/home/os/opt/cross/mingw/lib
-isystem /home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/mingw/include
-B/home/os/opt/cross/x86_64-w64-mingw32/bin/
-B/home/os/opt/cross/x86_64-w64-mingw32/lib/ -isystem
/home/os/opt/cross/x86_64-w64-mingw32/include -isystem
/home/os/opt/cross/x86_64-w64-mingw32/sys-include   '
CET_FLAGS=''
CFLAGS='-g -O2'
CPP='/lib/cpp'
CPPFLAGS=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIPO='x86_64-w64-mingw32-lipo'
LN_S='ln -s'
LTLIBOBJS=''
MAINT='#'
NM='/home/os/src/gcc-build-x86_64-w64-mingw32/./gcc/nm'
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME='GNU C Runtime Library'
PACKAGE_STRING='GNU C Runtime Library 1.0'
PACKAGE_TARNAME='libgcc'
PACKAGE_URL='http://www.gnu.org/software/libgcc/'
PACKAGE_VERSION='1.0'
PATH_SEPARATOR=':'
PICFLAG=''
RANLIB='/home/os/opt/cross/x86_64-w64-mingw32/bin/ranlib'
SHELL='/bin/sh'
STRIP='/home/os/opt/cross/x86_64-w64-mingw32/bin/strip'
ac_ct_CC=''
accel_dir_suffix=''
asm_hidden_op=''
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias='x86_64-pc-linux-gnu'
build_cpu='x86_64'
build_libsubdir='build-x86_64-pc-linux-gnu'
build_os='linux-gnu'
build_subdir='build-x86_64-pc-linux-gnu'
build_vendor='pc'
cpu_type=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
decimal_float=''
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
double_type_size=''
dvidir='${docdir}'
enable_decimal_float=''
enable_execute_stack=''
enable_shared='yes'
enable_vtable_verify='no'
exec_prefix='NONE'
extra_parts=''
fixed_point=''
force_explicit_eh_registry=''
get_gcc_base_ver=''
host='x86_64-w64-mingw32'
host_alias='x86_64-w64-mingw32'
host_cpu='x86_64'
host_noncanonical='x86_64-w64-mingw32'
host_os='mingw32'
host_subdir='.'
host_vendor='w64'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
libgcc_topdir='../../../gcc/libgcc/..'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
long_double_type_size=''
mandir='${datarootdir}/man'
md_unwind_header=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/home/os/opt/cross'
program_transform_name='s&^&x86_64-w64-mingw32-&'
psdir='${docdir}'
real_host_noncanonical=''
sbindir='${exec_prefix}/sbin'
set_have_cc_tls=''
set_use_emutls=''
sfp_machine_header=''
sharedstatedir='${prefix}/com'
slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
sysconfdir='${prefix}/etc'
target_alias='x86_64-w64-mingw32'
target_noncanonical='x86_64-w64-mingw32'
target_subdir='x86_64-w64-mingw32'
thread_header=''
tm_defines=''
tm_file=''
tmake_file=''
toolexecdir='$(exec_prefix)/$(target_noncanonical)'
toolexeclibdir='$(toolexecdir)/lib/../lib'
unwind_header=''
vis_hide=''
with_aix_soname='aix'

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "GNU C Runtime Library"
#define PACKAGE_TARNAME "libgcc"
#define PACKAGE_VERSION "1.0"
#define PACKAGE_STRING "GNU C Runtime Library 1.0"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL "http://www.gnu.org/software/libgcc/"

configure: exit 1

///---***---///

Anyway, been trying to toy with options and such, but no change in results.
Not sure what to make of this. I would appreciate any help anyone could
provide.

Regards,
Juan Pablo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unable to build libgcc for target x86_64-w64-mingw32, C preprocessor /lib/cpp fails sanity check
  2018-09-22 20:23 Unable to build libgcc for target x86_64-w64-mingw32, C preprocessor /lib/cpp fails sanity check Juan Pablo Garibotti Arias
@ 2018-09-22 21:56 ` Christer Solskogen
  2018-09-23  7:52   ` Kai Ruottu
  0 siblings, 1 reply; 3+ messages in thread
From: Christer Solskogen @ 2018-09-22 21:56 UTC (permalink / raw)
  To: gcc-help

On 9/22/2018 10:23 PM, Juan Pablo Garibotti Arias wrote:
> Hello,
> 
> I'm trying to build a cross compiler for UEFI, and having difficulties
> building libgcc after having built the compilers themselves. I've already
> built a cross compiler and libgcc (with and without red-zone) for
> freestanding x86_64-elf in the same machine, so not sure what the issue is.
> 
> The machine is an Arch vm, with the following packages installed through
> pacman:
> gcc-8.2.1+20180831-1
> bison-3.0.5-1
> flex-2.6.4-1
> gmp-6.1.2-1
> libmpc-1.1.0-1
> mpfr-4.0.1-1
> texinfo-6.5-1
>  From the AUR, I got:
> osl-0.9.2-2
> isl-0.20-4
> cloog-0.20.0-1
> 
> 

The build order I use is something like this:
binutils
gcc (all-gcc && install-gcc)
mingw-headers
mingw-crt
full gcc




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unable to build libgcc for target x86_64-w64-mingw32, C preprocessor /lib/cpp fails sanity check
  2018-09-22 21:56 ` Christer Solskogen
@ 2018-09-23  7:52   ` Kai Ruottu
  0 siblings, 0 replies; 3+ messages in thread
From: Kai Ruottu @ 2018-09-23  7:52 UTC (permalink / raw)
  To: Christer Solskogen, gcc-help

Christer Solskogen kirjoitti 23.9.2018 klo 0.56:
> On 9/22/2018 10:23 PM, Juan Pablo Garibotti Arias wrote:
>> I'm trying to build a cross compiler for UEFI, and having difficulties
>> building libgcc after having built the compilers themselves. I've 
>> already
>> built a cross compiler and libgcc (with and without red-zone) for
>> freestanding x86_64-elf in the same machine, so not sure what the 
>> issue is.
>> The source for gcc was downloaded to ~/src/gcc. After that, I did:
>> export PREFIX="$HOME/opt/cross"
>> export TARGET=x86_64-w64-mingw32
>> export PATH="$PREFIX/bin:$PATH"
>> mkdir ~/src/gcc-build-$TARGET
>> cd ~/src/gcc-build-$TARGET
>> ../gcc/configure --target=$TARGET --prefix="$PREFIX" --disable-nls
>> --enable-languages=c,c++ --without-headers
> The build order I use is something like this:
> binutils
> gcc (all-gcc && install-gcc)
> mingw-headers
> mingw-crt
> full gcc

With an already existing target which has an already built and tested 
target C libraries
like 'x86_64-w64-mingw32' and 'x86_64-redhat-linux' (CentOS, Fedora) it 
is quite vain
and even questionable (will the result really be the same?) to try to 
rebuild this already
existing target C library stuff.  One could ask oneself whether one 
really would rebuild
the target C library stuff in the native GCC case.  If not, why on earth 
in the cross GCC
case?  (A resurrection of the native GCC for the target on another host 
with only new
executables for the new cross host)

So just choosing a SYSROOT to keep the already existing target stuff (in 
this case as
downloaded mingw-packages from the MinGW site) and using the 
'--with-sysroot=$SYSROOT'
to point to them when configuring GNU binutils and GCC, would be the 
recommendation
from me. If one chooses PREFIX="$HOME/opt/cross" (for keeping all the 
crosstools) then
a quite obvious choose for the TARGET stuff would be to use 
SYSROOT=$PREFIX/host-$TARGET,
in this case it would lead using 
'$HOME/opt/cross/host-x86_64-w64-mingw32' as the SYSROOT
for the MinGW stuff.  When making more  crosstoolchains one then uses 
the same standard,
for instance with a crosstoolchain for 'x86_64-centos7-linux' one would 
use the
'$HOME/opt/cross/host-x86_64-centos7-linux' as the SYSROOT for the 
CentOS7 stuff and
the '$HOME/opt/cross/bin' for the 'x86_64-centos7-linux-*' named 
executables.

With the "embedded targets" like 'x86_64-elf' one doesn't use any 
SYSROOT because there
aren't any "existing target standard C libraries" but one usually 
compiles them from the newlib
sources at the same time with the GCC sources.  The resulting standard C 
libraries will go into
the default '$PREFIX/$TARGET/include' and '$PREFIX/$TARGET/lib', in the 
previous "standard"
into the '$HOME/opt/cross/x86_64-elf/include' and 
'$HOME/opt/cross/x86_64-elf/lib' in the
'x86_64-elf' target case.  Whether newlib now supports the 'x86_64-elf' 
target I have no clue,
the 'i386-elf' has been there from the very beginning and I remember 
toying with it to make
a crosscompiler which could make simple executables for both DJGPP2 on 
MS-DOS and Unix
SVR4.2 (UnixWare and Linux with ibcs2).

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-23  7:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-22 20:23 Unable to build libgcc for target x86_64-w64-mingw32, C preprocessor /lib/cpp fails sanity check Juan Pablo Garibotti Arias
2018-09-22 21:56 ` Christer Solskogen
2018-09-23  7:52   ` Kai Ruottu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).