From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id EB102385781E for ; Mon, 8 Nov 2021 15:05:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EB102385781E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636383922; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=6oqVCveIlUJs48fKiOW0YVZGCgTgfLyr4pxVx6jAYf0=; b=IOZK0Jv8mh8adEyBsBhnm7+svmFrMVuGXzylAeDZkAn9djEvdk+TTkyKdelBxcO0DOfyyh aYcU6plp9UJmwKGUStLP5FOcHHhfS/EyQmhp2bfdCnHKVeN9d18ZfXgYgKtcppLOfxzjQg qkGnOrUhpPzagJmI2W9BwhL45ld9c0Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-504-VzWJkdnjO4-_KW780ZwwFw-1; Mon, 08 Nov 2021 10:05:21 -0500 X-MC-Unique: VzWJkdnjO4-_KW780ZwwFw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6ED1019251B4 for ; Mon, 8 Nov 2021 15:05:20 +0000 (UTC) Received: from calimero.vinschen.de (ovpn-112-10.ams2.redhat.com [10.36.112.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 40875101E5BF for ; Mon, 8 Nov 2021 15:05:20 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id BF98EA80D53; Mon, 8 Nov 2021 16:05:18 +0100 (CET) Date: Mon, 8 Nov 2021 16:05:18 +0100 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: what's up with _COMPILING_NEWLIB Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vinschen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2021 15:05:24 -0000 On Nov 8 06:46, Mike Frysinger wrote: > On 08 Nov 2021 11:05, Corinna Vinschen wrote: > > On Nov 6 20:21, Mike Frysinger wrote: > > > i stumbled across _COMPILING_NEWLIB and it seems to be what i want: a symbol > > > that indicates the code currently being compiled is newlib itself so that the > > > header can change behavior for that environment specifically. is that what > > > it's meant for ? > > > > > > if so, why does it seem to be inconsistently defined ? newlib/configure.host > > > will add it for a few random targets, as does the mips-specific > > > newlib/libc/machine/mips/Makefile.am, as do a few specific winsup/cygwin/ > > > files. it feels like the patch below is what we should have. > > > > > > if that's not what this is for, is there a define that has this meaning ? > > > in the glibc & gnulib world, the plain _LIBC define indicates this. > > > > _COMPILING_NEWLIB might be older than that. In Cygwin we certainly need > > it during build. Your patch looks good to me, did you test it for some > > targets? > > yes, i tested it for bfin-elf and with a change that needed it in ctype.h. > the ctype.h change didn't work until i updated the build this way. uhm... why does a change in a header file depend on the build system? That sounds weird. I tested building on Cygwin, which looks good. So, here's a question: The patch is ok, just a change to the commit message would be nice. However, would you like to take the opportunity to change _COMPILING_NEWLIB to _LIBC throughout? That's something we should have done long ago, I guess. Thanks, Corinna