public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kai Ruottu <kai.ruottu@wippies.com>
To: Jonathan Wakely <jwakely.gcc@gmail.com>,
	Jouk Jansen <joukj@hrem.nano.tudelft.nl>
Cc: gcc-help <GCC-HELP@gcc.gnu.org>
Subject: Re: Problem creating cross-compiler
Date: Thu, 18 Jun 2020 14:26:08 +0300	[thread overview]
Message-ID: <7d23ba40-85d9-497c-6d54-abeed4e62937@wippies.com> (raw)
In-Reply-To: <CAH6eHdRRJiFc6VvtuVs9h3wBGvVJGWVSMKSNb4qj_eap_jv8pg@mail.gmail.com>

Jonathan Wakely via Gcc-help kirjoitti 18.6.2020 klo 13.52:
> On Thu, 18 Jun 2020 at 09:59, Jouk Jansen via Gcc-help
> <gcc-help@gcc.gnu.org> wrote:
>> Hi,
>>
>> I'm trying to build a cross-compiler which should be running on a Fedora 32
>> system building objects for a IA64-OpenVMS system. I'm running the
>> compilation on a "up-to-date" Fedora 32 system.
>>
>> What do I do wrong?
>>
>> ./configure --prefix=/home/joukj/openvms --exec-prefix=/home/joukj/openvms --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=ia64-hp-openvms
> Don't run configure in the source tree, see
> https://gcc.gnu.org/wiki/InstallingGCC
>
>
>> make
>>
>>
>> ...
>> g++ -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtt
>> i -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qu
>> al -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedan
>> tic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_
>> H  -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../.././gcc -I../.././gcc/build -I../
>> .././gcc/../include  -I../.././gcc/../libcpp/include  \
>>          -o build/genmodes.o ../.././gcc/genmodes.c
>> ./as: line 106: exec: -I: invalid option
> This means you don't have an assembler for the cross target.

I would guess this coming somehow from configuring in the source 
directory.  The 'genmodes'
executable is produced for the BUILD system so the 'as' required here 
would be the native one.
The './as' script is somehow broken.

What seems also to be missing is the prerequisite :

"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)."

https://gcc.gnu.org/install/prerequisites.html

When there is no "--with-sysroot=<something>" to point to the required  
'ia64-hp-openvms'
target libraries and headers (the assumption nowadays being a separate 
$sysroot for the target
stuff), this mistake seems obvious.  The "prerequisites" talks about 
producing a native GCC but
just the same prerequisite is true for a cross GCC. People may have 
installed only the 64-bit libs
and headers but the GCC build tries to build also 32-bit stuff and needs 
32-bit libs and headers
in this task.

The same "--with-sysroot=<something>" is required in the binutils 
configure to tell the target
linker where the target libraries are.


  reply	other threads:[~2020-06-18 11:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18  8:48 Jouk Jansen
2020-06-18 10:52 ` Jonathan Wakely
2020-06-18 11:26   ` Kai Ruottu [this message]
2020-06-18 11:46     ` Jonathan Wakely
2020-06-18 11:52     ` Kai Ruottu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7d23ba40-85d9-497c-6d54-abeed4e62937@wippies.com \
    --to=kai.ruottu@wippies.com \
    --cc=GCC-HELP@gcc.gnu.org \
    --cc=joukj@hrem.nano.tudelft.nl \
    --cc=jwakely.gcc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).