From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bee.birch.relay.mailchannels.net (bee.birch.relay.mailchannels.net [23.83.209.14]) by sourceware.org (Postfix) with ESMTPS id 26A303858D29 for ; Thu, 22 Jul 2021 00:31:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 26A303858D29 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=eagercon.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=eagercon.com X-Sender-Id: dreamhost|x-authsender|eager@eagerm.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 95DC4922B5E; Thu, 22 Jul 2021 00:31:52 +0000 (UTC) Received: from pdx1-sub0-mail-a39.g.dreamhost.com (100-96-17-89.trex.outbound.svc.cluster.local [100.96.17.89]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E43079221F5; Thu, 22 Jul 2021 00:31:51 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|eager@eagerm.com Received: from pdx1-sub0-mail-a39.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.17.89 (trex/6.3.3); Thu, 22 Jul 2021 00:31:52 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|eager@eagerm.com X-MailChannels-Auth-Id: dreamhost X-Oafish-Slimy: 341d22190d51c314_1626913912439_787426649 X-MC-Loop-Signature: 1626913912439:1383806696 X-MC-Ingress-Time: 1626913912439 Received: from pdx1-sub0-mail-a39.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a39.g.dreamhost.com (Postfix) with ESMTP id A51AB7F452; Wed, 21 Jul 2021 17:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=eagercon.com; h=subject:to :cc:references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; s=eagercon.com; bh=c2hV GTwT4CYsUMA/ttCkytlQYl0=; b=HpKItEHr06PIUTo0lN4GBQJ1OXhCzzMfAZct J5DwxPWBN543b5eERdsWCDKn9NEFGam/1kYQ0Oo+z0aFZ5KDxsWuWHtu54mqAwzA sgiZnHTkb+/Iwk/Nd30B4ydClPaJ+XUe1muN4/x0nrgCeMZ/cySqa8gKGMVeiKrv zU0c2jI= Received: from [192.168.20.41] (c-24-6-12-13.hsd1.ca.comcast.net [24.6.12.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: eager@eagerm.com) by pdx1-sub0-mail-a39.g.dreamhost.com (Postfix) with ESMTPSA id AD8F97F44F; Wed, 21 Jul 2021 17:31:48 -0700 (PDT) Subject: Re: Proper Place for builtin_define(__ELF__) To: joel@rtems.org Cc: GCC References: <2edcb737-484b-41ed-f05d-4e005cf5759f@eagercon.com> X-DH-BACKEND: pdx1-sub0-mail-a39 From: Michael Eager Message-ID: Date: Wed, 21 Jul 2021 17:31:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 00:31:58 -0000 On 7/21/21 5:22 PM, Joel Sherrill wrote: >=20 >=20 > On Wed, Jul 21, 2021, 7:12 PM Michael Eager > wrote: >=20 > 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 variation= s 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 sim= ple > > 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 appreciate= d. >=20 > There are very few defines for __ELF__ in the GCC target files. >=20 >=20 > Many=C2=A0 targets include dbxelf.h from the config.gcc script. There a= re 130=20 > references to that file there. That seems to be where most architecture= s=20 > get it. AFAIK, no one has ever tried to build microblaze to generate stabs, and I can't see a good reason why anyone would. Including dbxelf.h seems wrong. I don't have an answer why other arch's do that. >=20 >=20 >=20 > Why don't you put this in rtems.h? >=20 >=20 > That's ok for a hack but we haven't had to do that on the other ports s= o=20 > it seems wrong. Yep. >=20 > I didn't mention but without this defined the cdefs.h file in newlib=20 > produces incorrect macro definitions for at the weak_reference macro. >=20 >=20 > Alternately, you might put it in microblaze-s.c, wrapped with > #ifdef OBJECT_FORMAT_ELF/#endif. >=20 >=20 > Ok. This should fix it for microblaze-elf also. ARM does something which looks screwy to me. Instead of defining __ELF__, they pass -D__ELF__ on the CPP command line. >=20 > Thanks. >=20 > --joel >=20 >=20 > --=20 > Michael Eager >=20 --=20 Michael Eager