From: Joel Sherrill <joel@rtems.org>
To: Michael Eager <eager@eagercon.com>
Cc: GCC <gcc@gcc.gnu.org>
Subject: Re: Proper Place for builtin_define(__ELF__)
Date: Wed, 21 Jul 2021 19:22:58 -0500 [thread overview]
Message-ID: <CAF9ehCUGAFLiMZU9DQ0nN81u=UaoRaozePfPLqdsvrB-5WjnKQ@mail.gmail.com> (raw)
In-Reply-To: <2edcb737-484b-41ed-f05d-4e005cf5759f@eagercon.com>
On Wed, Jul 21, 2021, 7:12 PM Michael Eager <eager@eagercon.com> wrote:
> On 7/21/21 2:28 PM, Joel Sherrill wrote:
> > Hi
> >
> > We are in the process of porting RTEMS to the Microblaze and gcc does
> > not have __ELF__ as a predefine. In looking around at where to add it,
> > it looks like there are multiple ways to do it. We see variations on
> > the following patterns:
> >
> > + dbxelf.h
> > + OS specific header in config/
> > + Arch/OS specific header
> >
> > Integrating dbxelf.h into the microblaze seems risky for one simple
> > builtin_define(). Adding it to config/microblaze/rtems.h won't address
> > the microblaze-elf target.
> >
> > A suggestion on where to add the builtin_predefine is appreciated.
>
> There are very few defines for __ELF__ in the GCC target files.
>
Many targets include dbxelf.h from the config.gcc script. There are 130
references to that file there. That seems to be where most architectures
get it.
> Why don't you put this in rtems.h?
>
That's ok for a hack but we haven't had to do that on the other ports so it
seems wrong.
I didn't mention but without this defined the cdefs.h file in newlib
produces incorrect macro definitions for at the weak_reference macro.
> Alternately, you might put it in microblaze-s.c, wrapped with
> #ifdef OBJECT_FORMAT_ELF/#endif.
>
Ok. This should fix it for microblaze-elf also.
Thanks.
--joel
>
> --
> Michael Eager
>
next prev parent reply other threads:[~2021-07-22 0:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-21 21:28 Joel Sherrill
2021-07-22 0:12 ` Michael Eager
2021-07-22 0:22 ` Joel Sherrill [this message]
2021-07-22 0:31 ` Michael Eager
2021-07-22 3:08 ` Jeff Law
2021-07-22 14:12 ` Joel Sherrill
2021-07-23 16:42 ` Jeff Law
2021-07-22 14:34 ` David Edelsohn
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='CAF9ehCUGAFLiMZU9DQ0nN81u=UaoRaozePfPLqdsvrB-5WjnKQ@mail.gmail.com' \
--to=joel@rtems.org \
--cc=eager@eagercon.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).