public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rose.garcia-eggl2fk at yopmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/58427] New: xgcc target compilation depends on installed libgcc_s.so
Date: Sun, 15 Sep 2013 14:02:00 -0000	[thread overview]
Message-ID: <bug-58427-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58427

            Bug ID: 58427
           Summary: xgcc target compilation depends on installed
                    libgcc_s.so
           Product: gcc
           Version: 4.5.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rose.garcia-eggl2fk at yopmail dot com

during target compilation (for example libssp or libstdc++) xgcc is invoked
with the usual specs:

/src/build/gcc454/gcc-4.5.4/host-x86_64-unknown-linux-gnu/gcc/xgcc
-B/src/build/gcc454/gcc-4.5.4/host-x86_64-unknown-linux-gnu/gcc/ ... conftest.c

specs:
%{static|static-libgcc:-lgcc
-lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed -lgcc_s
--no-as-needed}%{shared-
libgcc:-lgcc_s%{!shared: -lgcc}}}}

in case binutils ld decides for some reason that libgcc_s is needed, it will
hardcode a reference to libgcc_s into DT_NEEDED.
binutils itself finds the libgcc_s.so in the -B path, and adds it, but
launching the resulting executable will fail because the *dynamic linker* has
no way of knowing that it should look for the .so in
host-x86_64-unknown-linux-gnu/gcc.

this causes the configure check for libssp and libstdc++ to fail with
"C compiler cannot create working executables".

possible solutions:
1) the spec file used by xgcc to compile target libraries should use
libgcc_eh.a instead of libgcc_s.so
2) LD_LIBRARY_PATH has to be set to host-x86_64-unknown-linux-gnu/gcc (the -B
path) so the dynamic linker can find libgcc_s.so

imo, 1) is preferable.


             reply	other threads:[~2013-09-15 14:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-15 14:02 rose.garcia-eggl2fk at yopmail dot com [this message]
2013-09-15 14:29 ` [Bug bootstrap/58427] " rose.garcia-eggl2fk at yopmail dot com
2020-11-06 22:12 ` egallager at gcc dot gnu.org
2021-07-18 19:42 ` pinskia at gcc dot gnu.org

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=bug-58427-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).