public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC cross-compiler errors
@ 2020-09-25 13:12 William Gregorio
  2020-09-28 16:46 ` Richard Earnshaw
  0 siblings, 1 reply; 3+ messages in thread
From: William Gregorio @ 2020-09-25 13:12 UTC (permalink / raw)
  To: gcc-help

Hi,

I'm trying to build a gcc cross-compiler from source, and whenever I invoke
make it results in an error. I'd appreciate any help! Feel free to request
any more details needed.

Ubuntu 18.04.3 LTS
gcc-7.5.0
autoconf-2.69


./configure options
--target=arm-none-eabi
--prefix=/usr/bin/crossbuild
--without-headers
--enable-multilib
--with-multilib=armv7e-m
--with-gnu-as
--with-gnu-ld
--with-dwarf2
--with-newlib
--with-system-zlib
--without-libffi
--disable-decimal-float
--disable-nls
--enable-languages="c,c++"
--enable-interwork
--disable-libstdcxx-pch
--with-newlib


make all
configure: WARNING: No native atomic operations are provided for this platform.
configure: WARNING: They cannot be faked when thread support is disabled.
configure: WARNING: Thread-safety of certain classes is not guaranteed.
.
.
.
configure: WARNING: stdbool.h: present but cannot be compiled
configure: WARNING: stdbool.h:     check for missing prerequisite headers?
configure: WARNING: stdbool.h: see the Autoconf documentation
configure: WARNING: stdbool.h:     section "Present But Cannot Be Compiled"
configure: WARNING: stdbool.h: proceeding with the compiler's result
checking for stdbool.h... no
checking stdalign.h usability... no
checking stdalign.h presence... yes
configure: WARNING: stdalign.h: present but cannot be compiled
configure: WARNING: stdalign.h:     check for missing prerequisite headers?
configure: WARNING: stdalign.h: see the Autoconf documentation
configure: WARNING: stdalign.h:     section "Present But Cannot Be Compiled"
configure: WARNING: stdalign.h: proceeding with the compiler's result
checking for stdalign.h... no
checking for the value of EOF... configure: error: computing EOF failed
Makefile:10307: recipe for target 'configure-target-libstdc++-v3' failed
make[1]: *** [configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory '/home/metaw1ll/crossbuild/tivac/gcc'
Makefile:889: recipe for target 'all' failed
make: *** [all] Error 2

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

* Re: GCC cross-compiler errors
  2020-09-25 13:12 GCC cross-compiler errors William Gregorio
@ 2020-09-28 16:46 ` Richard Earnshaw
  2020-09-29  7:04   ` Kai Ruottu
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Earnshaw @ 2020-09-28 16:46 UTC (permalink / raw)
  To: William Gregorio, gcc-help

On 25/09/2020 14:12, William Gregorio via Gcc-help wrote:
> Hi,
> 
> I'm trying to build a gcc cross-compiler from source, and whenever I invoke
> make it results in an error. I'd appreciate any help! Feel free to request
> any more details needed.
> 
> Ubuntu 18.04.3 LTS
> gcc-7.5.0
> autoconf-2.69
> 
> 
> ./configure options
> --target=arm-none-eabi
> --prefix=/usr/bin/crossbuild
> --without-headers
> --enable-multilib
> --with-multilib=armv7e-m
> --with-gnu-as
> --with-gnu-ld
> --with-dwarf2
> --with-newlib
> --with-system-zlib
> --without-libffi
> --disable-decimal-float
> --disable-nls
> --enable-languages="c,c++"
> --enable-interwork
> --disable-libstdcxx-pch
> --with-newlib
> 
> 
> make all
> configure: WARNING: No native atomic operations are provided for this platform.
> configure: WARNING: They cannot be faked when thread support is disabled.
> configure: WARNING: Thread-safety of certain classes is not guaranteed.
> .
> .
> .
> configure: WARNING: stdbool.h: present but cannot be compiled
> configure: WARNING: stdbool.h:     check for missing prerequisite headers?
> configure: WARNING: stdbool.h: see the Autoconf documentation
> configure: WARNING: stdbool.h:     section "Present But Cannot Be Compiled"
> configure: WARNING: stdbool.h: proceeding with the compiler's result
> checking for stdbool.h... no
> checking stdalign.h usability... no
> checking stdalign.h presence... yes
> configure: WARNING: stdalign.h: present but cannot be compiled
> configure: WARNING: stdalign.h:     check for missing prerequisite headers?
> configure: WARNING: stdalign.h: see the Autoconf documentation
> configure: WARNING: stdalign.h:     section "Present But Cannot Be Compiled"
> configure: WARNING: stdalign.h: proceeding with the compiler's result
> checking for stdalign.h... no
> checking for the value of EOF... configure: error: computing EOF failed
> Makefile:10307: recipe for target 'configure-target-libstdc++-v3' failed
> make[1]: *** [configure-target-libstdc++-v3] Error 1
> make[1]: Leaving directory '/home/metaw1ll/crossbuild/tivac/gcc'
> Makefile:889: recipe for target 'all' failed
> make: *** [all] Error 2
> 

Use a separate build area from your sources.  Building inside the source
tree is not supported.

R.

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

* Re: GCC cross-compiler errors
  2020-09-28 16:46 ` Richard Earnshaw
@ 2020-09-29  7:04   ` Kai Ruottu
  0 siblings, 0 replies; 3+ messages in thread
From: Kai Ruottu @ 2020-09-29  7:04 UTC (permalink / raw)
  To: Richard Earnshaw, William Gregorio, gcc-help

Richard Earnshaw kirjoitti 28.9.2020 klo 19.46:
> On 25/09/2020 14:12, William Gregorio via Gcc-help wrote:
>> Hi,
>>
>> I'm trying to build a gcc cross-compiler from source, and whenever I invoke
>> make it results in an error. I'd appreciate any help! Feel free to request
>> any more details needed.
>>
>> ./configure options
>> --target=arm-none-eabi
>> --prefix=/usr/bin/crossbuild
>> --without-headers
>> --enable-multilib
>> --with-multilib=armv7e-m
>> --with-gnu-as
>> --with-gnu-ld
>> --with-dwarf2
>> --with-newlib
>> --with-system-zlib
>> --without-libffi
>> --disable-decimal-float
>> --disable-nls
>> --enable-languages="c,c++"
>> --enable-interwork
>> --disable-libstdcxx-pch
>> --with-newlib
>>
>>
>> make all
Here are the true errors during the configure/build :
>> configure: WARNING: stdbool.h: present but cannot be compiled
>> configure: WARNING: stdbool.h:     check for missing prerequisite headers?
>> checking for stdbool.h... no
>> configure: WARNING: stdalign.h: present but cannot be compiled
>> configure: WARNING: stdalign.h:     check for missing prerequisite headers?
>> checking for stdalign.h... no
>> Makefile:10307: recipe for target 'configure-target-libstdc++-v3' failed
>> make[1]: *** [configure-target-libstdc++-v3] Error 1
I don't remember for what group these headers belong but one thing is 
sure in
every GCC build, especially when trying to produce the extra target 
libraries like
'libstdc++-v3'.  What was told in the "Prerequisites" :
https://gcc.gnu.org/install/prerequisites.html

"In order to build GCC, the C standard library and headers must be 
present for all
target variants for which target libraries will be built (and not only 
the variant of
the host C++ compiler)."

So where you did put the required 'arm-none-eabi' target headers?
The option :

|--without-headers|
    Tells GCC not use any target headers from a libc when building a 
cross compiler.
    When crossing to GNU/Linux, you need the headers so GCC can build the
    exception handling for libgcc.

Isn't maybe very clearly described. What means the "cross compiler"?  Is 
it the
"xgcc", "cc1", "cc1plus" etc produced into the 'gcc' build directory?  
Or does it
also include all the target libraries produced with these executables?  The
"Prerequisites" is more clear in this issue.  The :

--with-newlib
    Specifies that ‘newlib’ is being used as the target C library. This 
causes __eprintf
    to be omitted from libgcc.a on the assumption that it will be 
provided by ‘newlib’.

then only shows that one's aim is to use 'newlib' as the target C 
library. Normally
this means that one builds 'newlib' at the same time with the GCC 
sources via
providing the 'newlib' and 'libgloss' subdirs from the 'newlib-x.yz' 
sources in the
main GCC source directory.  Via copying or symlinking. The GCC build 
will find the
newlib headers automatically during the GCC and target libraries builds 
among
the sources.  Trying to copy the headers from the newlib sources where 
they would
be found is more hard ("--with-headers=<something>").  If one already 
has an earlier
toolchain for the target with "acid tested" C library, then not building 
one with the
new GCC maybe is motivated. Only when one is sure that the newer GCC 
will produce
working code. In this case one knows where the target headers are and 
can copy them
or use them where they are (the $prefix used in configure is the same).

>> Use a separate build area from your sources.  Building inside the source
>> tree is not supported.
This is true but I'm not sure whether this was the case here. "Where are the
target headers and where to put them" has been an eternal problem when 
people
are building tools for embedded use.  And all kind of "conspiracy 
theories" about
the GCC developers trying to get things complicated are spread in the 
net. Although
the "Prerequisites" clearly tells :
"To build all languages in a cross-compiler or other configuration where 
3-stage
bootstrap is not performed,"
people still believe in weird "multi-phase" build requirements in cross 
GCC builds.
For instance that building newlib immediately with GCC doesn't work but 
one must
first build a "bootstrap GCC", then newlib from sources with it and in 
stage 3 the
"final GCC".


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

end of thread, other threads:[~2020-09-29  7:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25 13:12 GCC cross-compiler errors William Gregorio
2020-09-28 16:46 ` Richard Earnshaw
2020-09-29  7:04   ` 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).