From: "H.J. Lu" <hjl.tools@gmail.com>
To: Paul Lucas <plucas@splunk.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: Cross-compile on Linux for Solaris x86
Date: Thu, 12 May 2022 17:05:10 -0700 [thread overview]
Message-ID: <CAMe9rOqtka7yyEfw3VFhKMN=gs2mQ9yrOkN_L_j+Yp8B76GROw@mail.gmail.com> (raw)
In-Reply-To: <08A4459C-97E2-4626-9E3A-44A340722DE2@splunk.com>
On Thu, May 12, 2022 at 4:33 PM Paul Lucas <plucas@splunk.com> wrote:
>
>
>
> > On May 12, 2022, at 1:37 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Thu, May 12, 2022 at 12:14 PM Paul Lucas via Binutils
> > <binutils@sourceware.org> wrote:
> >>
> >> Hello -
> >>
> >> I’m building a cross-compiled gcc and binutils on Linux x86_64 for Solaris x86_64. The problem is that the executables produced hard-code the wrong path for the dynamic linker and get killed immediately upon launch. In elfxx-x86.c, the path for ELF64_DYNAMIC_INTERPRETER is defined as "/lib/ld64.so.1", but should be "/lib/amd64/ld.so.1" on a Solaris x86_64 system.
> >>
> >> I came across this exact problem here:
> >>
> >> https://binutils.sourceware.narkive.com/hNh1UFx2/building-a-cross-for-solaris-x86-target#post2
> >>
> >> That thread is 15 years (!) old and implies this issue has beed addressed in the binutils 2.17/2.18 timeframe. I’m building binutils 2.32 and still hitting this same problem.
> >>
> >> What’s the fix?
> >
> > 1. Please get binutils 2.38.
>
> OK, I did. Same result.
>
> > 2. Configure binutils 2.38 to target Solaris/x86-64.
>
> Specifically, I did:
>
> configure --enable-gold=default --disable-ld --enable-lto --prefix=/solaris-x86_64 --disable-multilib --disable-nls --target=x86_64-sunos-solaris2.11 --with-sysroot=/solaris-x86_64 --disable-werror --enable-plugins
Gold doesn't support Solaris.
> which is what I’ve been doing.
>
> Assuming that you didn’t make a typo when you typed "x86-64” (with a dash, not an underscore), I also tried:
>
> --target=x86-64-sunos-solaris2.11
>
> but then the target triple parser presumably gets confused and complains:
>
> Kernel `sunos' not known to work with OS `solaris2.11’
>
> Looking at the binutils source code, the literal string "/lib/ld64.so.1” still occurs and the literal string "/lib/amd64/ld.so.1” still doesn’t.
>
> - Paul
>
--
H.J.
prev parent reply other threads:[~2022-05-13 0:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 19:13 Paul Lucas
2022-05-12 20:37 ` H.J. Lu
2022-05-12 23:32 ` Paul Lucas
2022-05-13 0:05 ` H.J. Lu [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='CAMe9rOqtka7yyEfw3VFhKMN=gs2mQ9yrOkN_L_j+Yp8B76GROw@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=binutils@sourceware.org \
--cc=plucas@splunk.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).