From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id D3BA53858D20; Thu, 31 Aug 2023 17:05:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D3BA53858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=axis.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1693501521; x=1725037521; h=from:to:cc:in-reply-to:subject:mime-version: content-transfer-encoding:references:message-id:date; bh=n2fjrxzAqYHCBmdvu5q45AO52d/jVxXcMMGKC4rExv8=; b=BbLQSGSmNc8ZMW+CY8BOhcobBamwtOFKmks/zkRWlKN4+AdlVgb04jSo aj+ohcd2T7F10gHGV9OdI9oms8Nng0VqKBuE+F9SzEB1lKpB14gGWRpjR kQ2E+x8T5DwWo3yYuCQRRetw9I0yRK5rEYgLrQIlDQgl/9SbErNTR8hEo tAJx2LbG05dvs0GjbG5CTP9P9AO9Wb1wL081OUaPBQpz+gvX+Td98UF25 Hmw73d13dBT3IBVAWjuCcvv5GaCwOyZtR4sRkpikRgcR70fNtFTJTxf18 4lAuSf9ulfjdw6gNaYZr1Fj66IW2rnEbR/CYk0wfZcOG8GyWP64CnZnft Q==; From: Hans-Peter Nilsson To: Christophe Lyon CC: , , In-Reply-To: (message from Christophe Lyon via Gcc-patches on Thu, 31 Aug 2023 17:25:45 +0200) Subject: Re: [PATCH] libstdc++: Use GLIBCXX_CHECK_LINKER_FEATURES for cross-builds (PR111238) MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT References: Message-ID: <20230831170519.8B84620425@pchp3.se.axis.com> Date: Thu, 31 Aug 2023 19:05:19 +0200 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,TXREP,URI_HEX autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Thu, 31 Aug 2023 17:25:45 +0200 > From: Christophe Lyon via Gcc-patches > As discussed in PR104167 (comments #8 and below), and PR111238, using > -Wl,-gc-sections in the libstdc++ testsuite for arm-eabi > (cross-toolchain) avoids link failures for a few tests: > > 27_io/filesystem/path/108636.cc > std/time/clock/gps/1.cc > std/time/clock/gps/io.cc > std/time/clock/tai/1.cc > std/time/clock/tai/io.cc > std/time/clock/utc/1.cc > std/time/clock/utc/io.cc > std/time/clock/utc/leap_second_info.cc > std/time/exceptions.cc > std/time/format.cc > std/time/time_zone/get_info_local.cc > std/time/time_zone/get_info_sys.cc > std/time/tzdb/1.cc > std/time/tzdb/leap_seconds.cc > std/time/tzdb_list/1.cc > std/time/zoned_time/1.cc > std/time/zoned_time/custom.cc > std/time/zoned_time/io.cc > std/time/zoned_traits.cc > > This patch achieves this by calling GLIBCXX_CHECK_LINKER_FEATURES in > cross-build cases, like we already do for native builds. We keep not > doing so in Canadian-cross builds. > > However, this would hide the fact that libstdc++ somehow forces the > user to use -Wl,-gc-sections to avoid undefined references to chdir, > mkdir, chmod, pathconf, ... so maybe it's better to keep the status > quo and not apply this patch? Datapoint: no failures for cris-elf in the listed tests - but it instead passes --gc-sections if -O2 or -O3 is seen for linking; see cris/cris.h. It's been like that forever, modulo a patch in 2002 not passing it if "-r" is seen. Incidentally, I've been sort-of investigating a recent-ish commit to newlib (8/8) that added a stub for getpriority, which was apparently added due to testsuite breakage for libstdc++ and arm-eabi, but that instead broke testsuite results for *other* targets, as warning at link-time. Film at 11. > 2023-08-31 Christophe Lyon > > libstdc++-v3/ChangeLog: > > PR libstdc++/111238 > * configure: Regenerate. > * configure.ac: Call GLIBCXX_CHECK_LINKER_FEATURES in cross, > non-Canadian builds. On this actual patch, I can't say yay or nay though (but leaning towards yay), but I'll test for cris-elf. Would you mind holding off committing for a day or two? brgds, H-P