public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jojo R <rjiejie@linux.alibaba.com>
To: GCC Development <gcc@gcc.gnu.org>
Subject: Why does GCC(libgcc) pack libgcc_eh.a into libgcc.a in baremetal ?
Date: Fri, 22 Apr 2022 14:44:43 +0800	[thread overview]
Message-ID: <efc84e36-20a5-41b4-b68d-cb797809cf62@Spark> (raw)
In-Reply-To: <7fea0954-2d74-4014-9684-b39598b8ec60@Spark>

Hi,

	Are there some history or reason for this design ?
	I think it’s clear & simple to keep coherent logic,
	namely that there should be libgcc_eh.a for exceptions :)

	Add Makefile.in segment of libgcc as following:

# Build LIB2ADDEH, LIB2ADDEHSTATIC, and LIB2ADDEHSHARED.  If we don't have
# libgcc_eh.a, only LIB2ADDEH matters.  If we do, only LIB2ADDEHSTATIC and
# LIB2ADDEHSHARED matter.  (Usually all three are identical.)

c_flags := -fexceptions

ifeq ($(enable_shared),yes)

libgcc-eh-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEHSTATIC))))
libgcc-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIB2ADDEHSHARED))))

iter-items := $(sort $(LIB2ADDEHSTATIC) $(LIB2ADDEHSHARED))
include $(iterator)

else
# Not shared.  LIB2ADDEH are added to libgcc.a.

libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEH))))

iter-items := $(LIB2ADDEH)
include $(iterator)

endif

— Jojo

           reply	other threads:[~2022-04-22  6:44 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <7fea0954-2d74-4014-9684-b39598b8ec60@Spark>]

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=efc84e36-20a5-41b4-b68d-cb797809cf62@Spark \
    --to=rjiejie@linux.alibaba.com \
    --cc=gcc@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).