public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Errors in building gcc-4.4.3
@ 2024-01-17 23:23 Yaxuan Wen
  2024-01-18 12:39 ` Kai Ruottu
  0 siblings, 1 reply; 4+ messages in thread
From: Yaxuan Wen @ 2024-01-17 23:23 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 1937 bytes --]

Dear developer,

Hope this email finds you well. I'm trying to compile a native gcc (called
it turtle-gcc for communication) from source using a cross-compiler gcc.
Then I met the error:

In file included from ../../../gcc-4.4.3/libgcc/../gcc/libgcc2.c:61:

../../../gcc-4.4.3/libgcc/../gcc/libgcc2.h:164: error: unable to emulate
‘XF’

../../../gcc-4.4.3/libgcc/../gcc/libgcc2.h:165: error: unable to emulate
‘XC’

../../../gcc-4.4.3/libgcc/../gcc/libgcc2.h:397: warning: conflicting types
for built-in function ‘__divxc3’

../../../gcc-4.4.3/libgcc/../gcc/libgcc2.h:398: warning: conflicting types
for built-in function ‘__mulxc3’

make[2]: *** [Makefile:359: _muldi3.o] Error 1

make[2]: Leaving directory
'/home/lind/lind_project/tests/applications/gcc-4.4.3_build/x86_64-nacl-linux/libgcc'

make[1]: *** [Makefile:11488: all-target-libgcc] Error 2

make[1]: Leaving directory
'/home/lind/lind_project/tests/applications/gcc-4.4.3_build'

make: *** [Makefile:741: all] Error 2

Here is the configuration file I used:

export CFLAGS="-ffloat-store"

export CXXFLAGS="-ffloat-store"


../gcc-4.4.3/configure --enable-languages=c --disable-shared \

  --disable-threads \

  --enable-threads=single \

  --disable-bootstarp \

  --disable-decimal-float \

  --disable-libatomic \

  --disable-libcilkrts \

  --disable-libgomp \

  --disable-libitm \

  --disable-libmudflap \

  --disable-libquadmath \

  --disable-libsanitizer \

  --disable-libssp --disable-libstdcxx-pch \

  --disable-libvtv \

  --disable-lto \

  --disable-lto-plugin \

  --disable-multilib \

  --disable-werror \

  --with-bugurl="https://bugs.linaro.org/" \

  --build=x86_64-linux --host=x86_64-nacl-linux --target=x86_64-nacl-linux
"$@"

I have no idea what causes this error, could you please provide some
instructions? Many thanks!

Best,
-- 
*Alice*

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

* Re: Errors in building gcc-4.4.3
  2024-01-17 23:23 Errors in building gcc-4.4.3 Yaxuan Wen
@ 2024-01-18 12:39 ` Kai Ruottu
  2024-01-18 12:51   ` Kai Ruottu
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Ruottu @ 2024-01-18 12:39 UTC (permalink / raw)
  To: Yaxuan Wen, gcc-help

[-- Attachment #1: Type: text/plain, Size: 2473 bytes --]

Yaxuan Wen via Gcc-help kirjoitti 18.1.2024 klo 1.23:
> Dear developer,
>
> Hope this email finds you well. I'm trying to compile a native gcc (called
> it turtle-gcc for communication) from source using a cross-compiler gcc.
>
> Here is the configuration file I used:
>
> export CFLAGS="-ffloat-store"
> export CXXFLAGS="-ffloat-store"
>
> ../gcc-4.4.3/configure --enable-languages=c --disable-shared \
> <clip>
>    --build=x86_64-linux --host=x86_64-nacl-linux --target=x86_64-nacl-linux
>
> I have no idea what causes this error, could you please provide some
> instructions? Many thanks!

The prerequisites in your case are aworking compiler for 
the'x86_64-linux' build system and a working cross-compiler from the 
build/host 'x86_64-linux' system to the target 'x86_64-nacl-linux' 
system. Whether the GCC configure scripts could quess what tools the 
build should use for the $host and $target I have no clue. Years I have 
always defined these with the : AR=<something> \ CC= <something> \ 
CXX=<something> \ .... RANLIB=<something> \ for the $host system. And : 
AR_FOR_TARGET=<something> \ CC_FOR_TARGET= <something> \ 
CXX_FOR_TARGET=<something> \ .... RANLIB_FOR_TARGET=<something> \ for 
the $target system. Similarly for the $build system with the : 
<TOOL>_FOR_BUILD=<something> rows in the script used as the
configure command, before the final 'configure' command in it.
Not much left to guess...

The already existing cross-compiler for the $target should be
used to compile all the usual target libraries like 'libgcc' during
the build. But they already were built during the cross-compiler
build so producing them once again is basically "reinventing the
wheel". So using the command :

make all-gcc

would be enough in order to get the executables for the new
native compiler, 'xgcc', 'cc1', 'collect2' etc.

The errors you got are the result of the just built GCC being
used to compile 'libgcc'. It of course searches its headers and
libraries from the "native places" which in your case are those
for the $build system. Seemingly its executables can somehow
work on your $build system. If the CPU arch would be different
the erors would come about the new 'xgcc' not working on the
$build system.

Furthermore using the '--prefix=/usr' for a native GCC aimed
as the 1st GCC there or as a replacement for the existing GCC
on the target system is usual. Without any '--prefix=<something>'
the '/usr/local' will be used as the default install prefix.

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

* Re: Errors in building gcc-4.4.3
  2024-01-18 12:39 ` Kai Ruottu
@ 2024-01-18 12:51   ` Kai Ruottu
  2024-01-18 20:20     ` Kai Ruottu
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Ruottu @ 2024-01-18 12:51 UTC (permalink / raw)
  To: gcc-help


Kai Ruottu kirjoitti 18.1.2024 klo 14.39:
> The prerequisites in your case are aworking compiler for 
> the'x86_64-linux' build system and a working cross-compiler from the 
> build/host 'x86_64-linux' system to the target 'x86_64-nacl-linux' 
> system. Whether the GCC configure scripts could quess what tools the 
> build should use for the $host and $target I have no clue. Years I 
> have always defined these with the : AR=<something> \ CC= <something> 
> \ CXX=<something> \ .... RANLIB=<something> \ for the $host system. 
> And : AR_FOR_TARGET=<something> \ CC_FOR_TARGET= <something> \ 
> CXX_FOR_TARGET=<something> \ .... RANLIB_FOR_TARGET=<something> \ for 
> the $target system. Similarly for the $build system with the : 
> <TOOL>_FOR_BUILD=<something> rows in the script used as the
> configure command, before the final 'configure' command in it.
> Not much left to guess...
>
Should I now shoot Thunderbird because it decided to change my written 
text to something unreadable?

Later text then surprisingly wasn't changed :

> The already existing cross-compiler for the $target should be
> used to compile all the usual target libraries like 'libgcc' during
> the build. But they already were built during the cross-compiler
> build so producing them once again is basically "reinventing the
> wheel". So using the command :
>

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

* Re: Errors in building gcc-4.4.3
  2024-01-18 12:51   ` Kai Ruottu
@ 2024-01-18 20:20     ` Kai Ruottu
  0 siblings, 0 replies; 4+ messages in thread
From: Kai Ruottu @ 2024-01-18 20:20 UTC (permalink / raw)
  To: gcc-help, >> Yaxuan Wen


Kai Ruottu kirjoitti 18.1.2024 klo 14.51:
>
> Kai Ruottu kirjoitti 18.1.2024 klo 14.39:
>> The prerequisites in your case are aworking compiler for 
>> the'x86_64-linux' build system and a working cross-compiler from the 
>> build/host 'x86_64-linux' system to the target 'x86_64-nacl-linux' 
>> system. Whether the GCC configure scripts could quess what tools the 
>> build should use for the $host and $target I have no clue. Years I 
>> have always defined these with the : AR=<something> \ CC= <something> 
>> \ CXX=<something> \ .... RANLIB=<something> \ for the $host system. 
>> And : AR_FOR_TARGET=<something> \ CC_FOR_TARGET= <something> \ 
>> CXX_FOR_TARGET=<something> \ .... RANLIB_FOR_TARGET=<something> \ for 
>> the $target system. Similarly for the $build system with the : 
>> <TOOL>_FOR_BUILD=<something> rows in the script used as the
>> configure command, before the final 'configure' command in it.
>> Not much left to guess...
>>
> Should I now shoot Thunderbird because it decided to change my written 
> text to something unreadable?

Maybe not... Let's try again via copy&paste using Notepad to "normalize" 
whatever there was in the Thunderbird text...

---------- clip ----------

The prerequisites in your case are a working compiler for the 
'x86_64-linux'  build system and
a working cross-compiler from the build/host  'x86_64-linux' system to 
the target 'x86_64-nacl-linux' system.
Whether the GCC configure scripts could quess what tools the build 
should use for the $host
and $target I have no clue. Years I have always defined these with the :

AR=<something> \
CC= <something> \
CXX=<something> \
....
RANLIB=<something> \

for the $host system. And :

AR_FOR_TARGET=<something> \
CC_FOR_TARGET= <something> \
CXX_FOR_TARGET=<something> \
....
RANLIB_FOR_TARGET=<something> \

for the $target system.  Similarly for the $build system with the :
<TOOL>_FOR_BUILD=<something> rows in the script used as the
configure command, before the final 'configure' command in it.
Not much left to guess...

---------- clip ----------



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

end of thread, other threads:[~2024-01-18 20:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-17 23:23 Errors in building gcc-4.4.3 Yaxuan Wen
2024-01-18 12:39 ` Kai Ruottu
2024-01-18 12:51   ` Kai Ruottu
2024-01-18 20:20     ` 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).