From: Thomas Schwinge <thomas@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Cc: "Maciej W. Rozycki" <macro@orcam.me.uk>,
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>,
Mike Stump <mikestump@comcast.net>,
"Iain Sandoe" <idsandoe@googlemail.com>
Subject: libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] (was: [PATCH v4 1/5] libatomic/test: Fix compilation for build sysroot)
Date: Tue, 12 Sep 2023 13:03:28 +0200 [thread overview]
Message-ID: <87y1hby7pb.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <alpine.LFD.2.21.2004031734460.461@redsun52.ssa.fujisawa.hgst.com>
[-- Attachment #1: Type: text/plain, Size: 1866 bytes --]
Hi!
On 2020-04-04T00:00:44+0100, "Maciej W. Rozycki via Gcc-patches" <gcc-patches@gcc.gnu.org> wrote:
> Fix a problem with the libatomic testsuite using a method to determine
> the compiler to use resulting in the tool being different from one the
> library has been built with, and causing a catastrophic failure from the
> lack of a suitable `--sysroot=' option where the `--with-build-sysroot='
> configuration option has been used to build the compiler resulting in
> the inability to link executables.
>
> Address this problem by providing a DejaGNU configuration file defining
> the compiler to use, via the GCC_UNDER_TEST TCL variable, set from $CC
> by autoconf, which will have all the required options set for the target
> compiler to build executables in the environment configured
As we've found, this is conceptually problematic, as discussed in
<https://inbox.sourceware.org/875y868a4b.fsf@euler.schwinge.homeip.net>
"Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.)
[PR109951]".
I therefore suggest to apply to libatomic the conceptually same changes
as I've just pushed for libgomp:
<https://inbox.sourceware.org/874jjzzqc2.fsf@euler.schwinge.homeip.net>
"libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC'
etc.) [PR91884, PR109951]".
OK to push the attached
"libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]"?
Grüße
Thomas
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-libatomic-Consider-with-build-sysroot-.-for-target-l.patch --]
[-- Type: text/x-diff, Size: 4685 bytes --]
From 584bfb74e802b94c490b963bd05ed520b5c6e453 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Mon, 11 Sep 2023 11:36:31 +0200
Subject: [PATCH] libatomic: Consider '--with-build-sysroot=[...]' for target
libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]
Similar to commit fb5d27be272b71fb9026224535fc73f125ce3be7
"libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]",
this is commit 5ff06d762a88077aff0fb637c931c64e6f47f93d
"libatomic/test: Fix compilation for build sysroot" done differently,
avoiding build-tree testing use of any random gunk that may appear in
build-time 'CC'.
PR testsuite/109951
libatomic/
* configure.ac: 'AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)'.
* Makefile.in: Regenerate.
* configure: Likewise.
* testsuite/Makefile.in: Likewise.
* testsuite/lib/libatomic.exp (libatomic_init): If
'--with-build-sysroot=[...]' was specified, use it for build-tree
testing.
* testsuite/libatomic-site-extra.exp.in (GCC_UNDER_TEST): Don't
set.
(SYSROOT_CFLAGS_FOR_TARGET): Set.
---
libatomic/Makefile.in | 1 +
libatomic/configure | 7 +++++--
libatomic/configure.ac | 2 ++
libatomic/testsuite/Makefile.in | 1 +
libatomic/testsuite/lib/libatomic.exp | 5 +++++
| 2 +-
6 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in
index 83efe7d2694..2d2d64ee947 100644
--- a/libatomic/Makefile.in
+++ b/libatomic/Makefile.in
@@ -328,6 +328,7 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SIZES = @SIZES@
STRIP = @STRIP@
+SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
VERSION = @VERSION@
XCFLAGS = @XCFLAGS@
XLDFLAGS = @XLDFLAGS@
diff --git a/libatomic/configure b/libatomic/configure
index 57f320753e1..629ad22e833 100755
--- a/libatomic/configure
+++ b/libatomic/configure
@@ -656,6 +656,7 @@ LIBAT_BUILD_VERSIONED_SHLIB_FALSE
LIBAT_BUILD_VERSIONED_SHLIB_TRUE
OPT_LDFLAGS
SECTION_LDFLAGS
+SYSROOT_CFLAGS_FOR_TARGET
enable_aarch64_lse
libtool_VERSION
MAINT
@@ -11402,7 +11403,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11405 "configure"
+#line 11406 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11508,7 +11509,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11511 "configure"
+#line 11512 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11866,6 +11867,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
;;
esac
+
+
# Get target configury.
. ${srcdir}/configure.tgt
if test -n "$UNSUPPORTED"; then
diff --git a/libatomic/configure.ac b/libatomic/configure.ac
index 318b605a1d7..4beff2d681f 100644
--- a/libatomic/configure.ac
+++ b/libatomic/configure.ac
@@ -170,6 +170,8 @@ case "$target" in
;;
esac
+AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
+
# Get target configury.
. ${srcdir}/configure.tgt
if test -n "$UNSUPPORTED"; then
diff --git a/libatomic/testsuite/Makefile.in b/libatomic/testsuite/Makefile.in
index b874ac527a9..247268f1949 100644
--- a/libatomic/testsuite/Makefile.in
+++ b/libatomic/testsuite/Makefile.in
@@ -198,6 +198,7 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SIZES = @SIZES@
STRIP = @STRIP@
+SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
VERSION = @VERSION@
XCFLAGS = @XCFLAGS@
XLDFLAGS = @XLDFLAGS@
diff --git a/libatomic/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp
index 10f38475bc8..43b54212d90 100644
--- a/libatomic/testsuite/lib/libatomic.exp
+++ b/libatomic/testsuite/lib/libatomic.exp
@@ -146,6 +146,11 @@ proc libatomic_init { args } {
set ALWAYS_CFLAGS ""
if { $blddir != "" } {
+ # If '--with-build-sysroot=[...]' was specified, use it for build-tree
+ # testing.
+ global SYSROOT_CFLAGS_FOR_TARGET
+ lappend ALWAYS_CFLAGS "additional_flags=${SYSROOT_CFLAGS_FOR_TARGET}"
+
lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs"
--git a/libatomic/testsuite/libatomic-site-extra.exp.in b/libatomic/testsuite/libatomic-site-extra.exp.in
index c0d26660bad..5c81b7750bb 100644
--- a/libatomic/testsuite/libatomic-site-extra.exp.in
+++ b/libatomic/testsuite/libatomic-site-extra.exp.in
@@ -1 +1 @@
-set GCC_UNDER_TEST {@CC@}
+set SYSROOT_CFLAGS_FOR_TARGET {@SYSROOT_CFLAGS_FOR_TARGET@}
--
2.34.1
next prev parent reply other threads:[~2023-09-12 11:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-03 23:00 [PATCH v4 0/5] Fix library testsuite compilation for build sysroot Maciej W. Rozycki
2020-04-03 23:00 ` [PATCH v4 1/5] libatomic/test: Fix " Maciej W. Rozycki
2020-04-06 18:10 ` Jeff Law
2020-04-06 22:34 ` Maciej W. Rozycki
2023-09-12 11:03 ` Thomas Schwinge [this message]
2023-10-25 8:32 ` [PING] libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] (was: [PATCH v4 1/5] libatomic/test: Fix compilation for build sysroot) Thomas Schwinge
2023-10-26 13:34 ` [PING] libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] Jeff Law
2020-04-03 23:01 ` [PATCH v4 GCC 2/5] libffi/test: Fix compilation for build sysroot Maciej W. Rozycki
2020-04-06 18:06 ` Jeff Law
2020-04-06 20:21 ` Maciej W. Rozycki
2020-04-03 23:01 ` [PATCH v4 GCC 3/5] libffi/test: Make `libffi-init' use $CC_FOR_TARGET Maciej W. Rozycki
2020-04-03 23:01 ` [PATCH v4 4/5] libgo/test: Complement compilation fix for build sysroot Maciej W. Rozycki
2020-04-03 23:01 ` [PATCH v4 5/5] libgomp/test: Remove a build sysroot fix regression Maciej W. Rozycki
2020-04-06 18:11 ` Jeff Law
2020-04-06 22:34 ` Maciej W. Rozycki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y1hby7pb.fsf@euler.schwinge.homeip.net \
--to=thomas@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=idsandoe@googlemail.com \
--cc=macro@orcam.me.uk \
--cc=mikestump@comcast.net \
--cc=ro@CeBiTec.Uni-Bielefeld.DE \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).