public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Anthony de Almeida Lopes <anthony.de.almeida.lopes@falsifiable.net>
To: Xi Ruoyao <xry111@mengyan1223.wang>, gcc-help@gcc.gnu.org
Subject: Re: Building a host-isolated gcc without faking cross-compiling
Date: Mon, 13 Sep 2021 14:06:01 +0000	[thread overview]
Message-ID: <fd96fa42-450a-db81-c128-9b0d03058c58@falsifiable.net> (raw)
In-Reply-To: <494c39c9462eaf036e04aa7ede61325585af4da6.camel@mengyan1223.wang>

Alright, fair enough, I surrender.

I did end up solving the GCC_NO_EXECUTABLE in a better way by just
including zlib in the source tree. I found the solution in this[1] bug
report from libdragon.

Then the reason things were crashing was my own fault: I incorrectly
assumed setting LD_LIBRARY_PATH would set the dynamic linker but it
doesn't do that. Running programs directly with the dynamic linker (like
`usr/lib/ld-linux-x86-64.so.2 usr/bin/ls`) works fine.

1. https://github.com/DragonMinded/libdragon/issues/22

- Anthony


On 9/11/21 10:32 AM, Xi Ruoyao wrote:
> On Sat, 2021-09-11 at 04:55 +0000, Anthony de Almeida Lopes via Gcc-help
> wrote:
>> Alright, progress. I'm still researching the next problems that I ran
>> into but I thought I'd post an update. First, I ran into
>> GCC_NO_EXECUTABLES while the build was in configure-stage2-zlib and in
>> anticipating what Lance might say to that, I checked and there doesn't
>> seem to be a --without-zlib although I did test that just in case and
>> it
>> did nothing. The best explanation for what GCC_NO_EXECUTABLES is that
>> I
>> found so far is in a post to the list about a similar problem:
>>
>> https://gcc.gnu.org/legacy-ml/gcc/2008-03/msg00515.html
>>
>> I went ahead and built it anyway with --disable-bootstrap. glibc
>> compiled but not too surprisingly running ldd or /usr/lib/libc.so.6
>> with
>> LD_LIBRARY_PATH to $DISTRO/usr/lib just segfaults, so it seems like it
>> wasn't really a sane build of gcc after all.
>>
>> Ignoring that problem, configuring libstdc++-v3 after having glibc
>> fails
>> which is kind of obvious since the host glibc differs in version from
>> the target version. You know, the typical "version `GLIBC_2.34' not
>> found" errors. This seems like a proper motivating reason for using
>> the
>> fake cross-compiling trick but I'm determined to figure out if there's
>> a
>> way around that.
> As a LFS editor (and I also have several commits in GCC) I'd say there
> is no rational way for this, expect cross-compilation.  Maybe you can
> use a dozen of switches to accomplish the object, but at last it will be
> almost equivelent to run a cross-compilation.
> --
> Xi Ruoyao <xry111@mengyan1223.wang>
> School of Aerospace Science and Technology, Xidian University
>


      reply	other threads:[~2021-09-13 14:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 16:54 Anthony de Almeida Lopes
2021-09-10 17:46 ` Lance Fredrickson
2021-09-10 18:21   ` Anthony de Almeida Lopes
2021-09-10 18:42     ` Lance Fredrickson
2021-09-11  4:55       ` Anthony de Almeida Lopes
2021-09-11  8:32         ` Xi Ruoyao
2021-09-13 14:06           ` Anthony de Almeida Lopes [this message]

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=fd96fa42-450a-db81-c128-9b0d03058c58@falsifiable.net \
    --to=anthony.de.almeida.lopes@falsifiable.net \
    --cc=gcc-help@gcc.gnu.org \
    --cc=xry111@mengyan1223.wang \
    /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).