From: Chung-Lin Tang <chunglin_tang@mentor.com>
To: "Maciej W. Rozycki" <macro@wdc.com>,
Julian Brown <julian@codesourcery.com>
Cc: Mike Stump <mikestump@comcast.net>, <gcc-patches@gcc.gnu.org>,
Thomas Schwinge <thomas@codesourcery.com>
Subject: Re: [PING^4][PATCH 0/4] Fix library testsuite compilation for build sysroot
Date: Tue, 14 Jan 2020 13:43:00 -0000 [thread overview]
Message-ID: <ccd949e3-dfbf-8cc9-321c-bc011922573e@mentor.com> (raw)
In-Reply-To: <alpine.LFD.2.21.2001061459150.30965@redsun52.ssa.fujisawa.hgst.com>
[-- Attachment #1: Type: text/plain, Size: 1782 bytes --]
On 2020/1/6 11:25 PM, Maciej W. Rozycki wrote:
> Overall if libgomp-test-support.exp is considered appropriate for
> standalone testing, then I think two solutions are possible here:
>
> 1. An option is added to libgomp's $CC such that the compiler is able to
> make builds involving the offload compiler where requested, and this
> then propagates to GCC_UNDER_TEST as it stands.
>
> 2. The definition of GCC_UNDER_TEST in libgomp-test-support.exp is only
> made if inexistent, and then you can predefine the variable in site.exp
> however you find appropriate.
Hi Maciej,
I understand your situation with --with-build-sysroot/--without-sysroot, but the
way you set GCC_UNDER_TEST in libgomp-test-support.exp appears to override too
much of the machinery in libgomp/testsuite/lib/libgomp.exp that sets GCC_UNDER_TEST
using DejaGNU find_gcc, etc.
Can you test if the attached patch works for you? The patch exports the build sysroot
setting from the toplevel to target library subdirs, and adds the --sysroot= option
when doing build-tree testing (I assume that blddir != "" test is sufficient from the
surrounding comments)
I can only verify that it no longer "interferes" with our installed-mode testing.
Also, if this does work, then other library testsuites (e.g. libatomic.exp) might
also need considering updating, I think.
Thanks,
Chung-Lin
2020-01-14 Chung-Lin Tang <cltang@codesourcery.com>
* Makefile.tpl (NORMAL_TARGET_EXPORTS): Add export of
SYSROOT_CFLAGS_FOR_TARGET variable.
* Makefile.in: Regenerate.
libgomp/
* testsuite/lib/libgomp.exp (ALWAYS_CFLAGS): Add
--sysroot=$SYSROOT_CFLAGS_FOR_TARGET option when doing build-tree testing.
Fix comment typo.
* testsuite/libgomp-test-support.exp.in (GCC_UNDER_TEST): Delete definition.
[-- Attachment #2: m.diff --]
[-- Type: text/plain, Size: 2393 bytes --]
Index: libgomp/testsuite/lib/libgomp.exp
===================================================================
--- libgomp/testsuite/lib/libgomp.exp (revision 279954)
+++ libgomp/testsuite/lib/libgomp.exp (working copy)
@@ -171,9 +171,16 @@ proc libgomp_init { args } {
lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/../../include"
lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
- # For build-tree testing, also consider the library paths used for builing.
+ # For build-tree testing, also consider the library paths used for building.
# For installed testing, we assume all that to be provided in the sysroot.
if { $blddir != "" } {
+
+ # If --with-build-sysroot= was specified, we assume it will be needed
+ # for build-tree testing.
+ if [info exists SYSROOT_CFLAGS_FOR_TARGET] {
+ lappend ALWAYS_CFLAGS "additional_flags=--sysroot=$SYSROOT_CFLAGS_FOR_TARGET"
+ }
+
# The `-fopenacc' and `-fopenmp' options imply `-pthread', and
# that implies `-latomic' on some hosts, so wire in libatomic
# build directories.
Index: libgomp/testsuite/libgomp-test-support.exp.in
===================================================================
--- libgomp/testsuite/libgomp-test-support.exp.in (revision 279954)
+++ libgomp/testsuite/libgomp-test-support.exp.in (working copy)
@@ -1,5 +1,3 @@
-set GCC_UNDER_TEST {@CC@}
-
set cuda_driver_include "@CUDA_DRIVER_INCLUDE@"
set cuda_driver_lib "@CUDA_DRIVER_LIB@"
set hsa_runtime_lib "@HSA_RUNTIME_LIB@"
Index: Makefile.in
===================================================================
--- Makefile.in (revision 279954)
+++ Makefile.in (working copy)
@@ -319,6 +319,7 @@ RAW_CXX_TARGET_EXPORTS = \
NORMAL_TARGET_EXPORTS = \
$(BASE_TARGET_EXPORTS) \
+ SYSROOT_CFLAGS_FOR_TARGET="$(SYSROOT_CFLAGS_FOR_TARGET)"; export SYSROOT_CFLAGS_FOR_TARGET; \
CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
# Where to find GMP
Index: Makefile.tpl
===================================================================
--- Makefile.tpl (revision 279954)
+++ Makefile.tpl (working copy)
@@ -322,6 +322,7 @@ RAW_CXX_TARGET_EXPORTS = \
NORMAL_TARGET_EXPORTS = \
$(BASE_TARGET_EXPORTS) \
+ SYSROOT_CFLAGS_FOR_TARGET="$(SYSROOT_CFLAGS_FOR_TARGET)"; export SYSROOT_CFLAGS_FOR_TARGET; \
CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
# Where to find GMP
next prev parent reply other threads:[~2020-01-14 13:31 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 18:12 [PATCH " Maciej W. Rozycki
2019-11-11 18:12 ` [PATCH 1/4] libatomic/test: Fix " Maciej W. Rozycki
2019-11-11 18:12 ` [PATCH 2/4] libffi/test: " Maciej W. Rozycki
2019-11-11 18:23 ` [golang-dev] [PATCH 0/4] Fix library testsuite " Ulderico Cirello
2019-11-11 18:29 ` Kaz Kylheku (libffi)
2019-11-11 18:42 ` Ian Lance Taylor
2019-11-11 18:35 ` Ian Lance Taylor
2019-11-11 18:45 ` Maciej W. Rozycki
2019-11-11 23:29 ` Ian Lance Taylor
2019-11-11 18:44 ` Maciej W. Rozycki
2019-11-26 15:56 ` [PING][PATCH " Maciej W. Rozycki
2019-12-02 14:49 ` [PING^2][PATCH " Maciej W. Rozycki
2019-12-09 21:30 ` [PING^3][PATCH " Maciej W. Rozycki
2019-12-17 0:06 ` [PING^4][PATCH " Maciej W. Rozycki
2019-12-21 1:30 ` Mike Stump
2019-12-22 1:34 ` Maciej W. Rozycki
2020-01-03 11:34 ` Julian Brown
2020-01-06 15:25 ` Maciej W. Rozycki
2020-01-09 21:00 ` Tobias Burnus
2020-01-14 13:43 ` Chung-Lin Tang [this message]
2020-01-21 3:21 ` Maciej W. Rozycki
2020-01-31 22:36 ` Maciej W. Rozycki
2020-02-11 8:35 ` Chung-Lin Tang
2020-02-11 21:31 ` Maciej W. Rozycki
2023-06-02 9:52 ` Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] Thomas Schwinge
2023-06-03 20:32 ` Maciej W. Rozycki
2023-09-12 9:35 ` libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951] (was: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]) Thomas Schwinge
2023-09-12 9:35 ` Pass 'SYSROOT_CFLAGS_FOR_TARGET' down to target libraries [PR109951] " Thomas Schwinge
2020-01-06 15:47 ` [PING^5][PATCH 0/4] Fix library testsuite compilation for build sysroot Maciej W. Rozycki
2020-01-13 21:20 ` [PING^6][PATCH " Maciej W. Rozycki
2020-01-21 2:44 ` [PING^7][PATCH " Maciej W. Rozycki
2020-01-26 21:07 ` Jeff Law
2020-02-13 23:37 ` 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=ccd949e3-dfbf-8cc9-321c-bc011922573e@mentor.com \
--to=chunglin_tang@mentor.com \
--cc=cltang@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=julian@codesourcery.com \
--cc=macro@wdc.com \
--cc=mikestump@comcast.net \
--cc=thomas@codesourcery.com \
/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).