From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by sourceware.org (Postfix) with ESMTPS id 25088383D839 for ; Thu, 22 Jul 2021 00:23:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 25088383D839 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rtems.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f173.google.com with SMTP id b16so3963692ljq.9 for ; Wed, 21 Jul 2021 17:23:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=HuSMCiZb8Uv7ptxQlBnyleEdQopcRjnX34x/jWEQ6ps=; b=EhxmigOTaboRvZXSrNj0d376WX9/d6giapMBv0F/hnODqEy4Jmgu65n62j1hpUre98 3CQ028GvHBd7iM1ZdBAvVjRlSC/tF647Wp/9Z8u02Cb21yT74OndylPvI8jGxmxkWARb pBSeQhWnPE27P/pxuuqXF8R3GXkNWH3Wh6dkjbdDP1ax6QAaMuK6rXqjyAdX/zHrXSzB uocEeW7Lf/YasqIEkxOmtRCZGaxZPVJgrFnUiBThJYf8ZxlvbKyQb3BZVw6IwkZX8oqQ O9OlQWKBHUxPPSByfAth3WPLvTyz5TNOJg30uI5jfXeB1486VOKvxBJ+1Y0w/22z8QN+ qtSg== X-Gm-Message-State: AOAM533EzqwFqEVwMA/txjCP5GMAUuW14+40yxS9cAlnTSLSi0o6tBUK 55H2MkMN3hNTREWK3X+vI8xnahlqFZKIzA== X-Google-Smtp-Source: ABdhPJzCvn1Bl4nV0+RMc8/VL8WIQ8LlVo16vA6pmUIq5EP7UWNl3scKlevsjZLxZRYtjfxm9wzgXg== X-Received: by 2002:a2e:9a96:: with SMTP id p22mr31160456lji.77.1626913390605; Wed, 21 Jul 2021 17:23:10 -0700 (PDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id y13sm2952196ljn.119.2021.07.21.17.23.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Jul 2021 17:23:10 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id c23so5199089ljr.8 for ; Wed, 21 Jul 2021 17:23:10 -0700 (PDT) X-Received: by 2002:a05:651c:38e:: with SMTP id e14mr32563986ljp.453.1626913390069; Wed, 21 Jul 2021 17:23:10 -0700 (PDT) MIME-Version: 1.0 References: <2edcb737-484b-41ed-f05d-4e005cf5759f@eagercon.com> In-Reply-To: <2edcb737-484b-41ed-f05d-4e005cf5759f@eagercon.com> Reply-To: joel@rtems.org From: Joel Sherrill Date: Wed, 21 Jul 2021 19:22:58 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Proper Place for builtin_define(__ELF__) To: Michael Eager Cc: GCC X-Spam-Status: No, score=-3031.8 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:23:13 -0000 On Wed, Jul 21, 2021, 7:12 PM Michael Eager 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 >