From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116014 invoked by alias); 15 Nov 2017 19:39:46 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 115995 invoked by uid 89); 15 Nov 2017 19:39:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=walton, Walton, H*M:online, stanza X-HELO: mailout07.t-online.de Received: from mailout07.t-online.de (HELO mailout07.t-online.de) (194.25.134.83) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Nov 2017 19:39:44 +0000 Received: from fwd25.aul.t-online.de (fwd25.aul.t-online.de [172.20.26.130]) by mailout07.t-online.de (Postfix) with SMTP id 9C802427E31C; Wed, 15 Nov 2017 20:39:41 +0100 (CET) Received: from [192.168.2.28] (VroKv4Zlghr-66csninvlRiW+XpahyBzL208c35YvHVl4Wc5dGR7qIpu2NMT95HQyd@[91.59.1.55]) by fwd25.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1eF3XA-4e0nwm0; Wed, 15 Nov 2017 20:39:40 +0100 Subject: Re: Autoconf stanza to test for Newlib? To: noloader@gmail.com Cc: newlib@sourceware.org References: From: =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker?= Message-ID: <2b7e5ac5-6082-a517-626e-e9b9d683440c@t-online.de> Date: Mon, 20 Nov 2017 07:55:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017/txt/msg01122.txt.bz2 Am 13.11.2017 um 21:02 schrieb Jeffrey Walton: > I wanted to give this some more thought before replying, so sorry > about the late reply. I know the issue you are referring to - > libstdc++ running fast and loose, and making too many symbols > available in C++ by default. No, that's not the issue I was pointing at. libstdc++ has nothing to do with it. The feature test macros, including _XOPEN_SOURCE, exist to turn on/off various extensions of the bare ISO Standard C runtime library. C++ only gets those same extensions by references. The question whether code needs those macros set to work is determined by that source code itself, not by which libc is in use. That means the question whether to set that macro has no relation at all to whether the libc is newlib or not. You just don't need to know one to decide about the other. > At this point I think I would like to solve the concrete problem that > exists rather than problems that don't exist. And I remain unconvinced that the problem you claim exists, actually does. > I'm currently using: > > AC_MSG_CHECKING([if runtime library is Newlib]) > AC_PREPROC_IFELSE([AC_LANG_PROGRAM([#include <_newlib_version.h>])], > [AC_MSG_RESULT([yes]); AC_SUBST([tr_RESULT], [1])], > [AC_MSG_RESULT([no]); AC_SUBST([tr_RESULT], [0])] > ) That check is flawed because it doesn't test what it says it does. It detects whether the compiler can _find_ (some part of) newlib, not whether the active libc is newlib.