public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jim Wilson <jimw@sifive.com>
To: gcc-patches@gcc.gnu.org
Cc: Jim Wilson <jimw@sifive.com>
Subject: [PATCH] RISC-V: Add --specs=nosys.specs support.
Date: Fri, 26 Jan 2018 23:11:00 -0000	[thread overview]
Message-ID: <20180126212814.22324-1-jimw@sifive.com> (raw)

This makes --specs=nosys.specs work correctly.  Without this patch, libnosys
is ignored because libgloss gets pulled in first.  We may have to revisit this
in the future when we have some proper BSPs defined for various RISC-V
hardware.  Meanwhile, adding libgloss by default makes things easier for
inexperienced users and I don't want to break that.

This was tested with a testsuite run for a newlib target, there were no
regressions.  Also tested by hand to verify that --specs=nosys.specs works
correctly.

Committed.

Jim

	gcc/
	* config/riscv/elf.h (LIB_SPEC): Don't include -lgloss when nosys.specs
	specified.
---
 gcc/config/riscv/elf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/riscv/elf.h b/gcc/config/riscv/elf.h
index 43ad68bbdf2..f39e83234d2 100644
--- a/gcc/config/riscv/elf.h
+++ b/gcc/config/riscv/elf.h
@@ -24,7 +24,7 @@ along with GCC; see the file COPYING3.  If not see
 /* Link against Newlib libraries, because the ELF backend assumes Newlib.
    Handle the circular dependence between libc and libgloss. */
 #undef  LIB_SPEC
-#define LIB_SPEC "--start-group -lc -lgloss --end-group"
+#define LIB_SPEC "--start-group -lc %{!specs=nosys.specs:-lgloss} --end-group"
 
 #undef  STARTFILE_SPEC
 #define STARTFILE_SPEC "crt0%O%s crtbegin%O%s"
-- 
2.14.1

                 reply	other threads:[~2018-01-26 21:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20180126212814.22324-1-jimw@sifive.com \
    --to=jimw@sifive.com \
    --cc=gcc-patches@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).