From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 237D83832C67 for ; Tue, 31 Jan 2023 14:44:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 237D83832C67 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=gmail.com Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMrld-0002S4-Oo for gcc-patches@gcc.gnu.org; Tue, 31 Jan 2023 09:37:52 -0500 Received: by mail-wr1-x429.google.com with SMTP id q5so14442530wrv.0 for ; Tue, 31 Jan 2023 06:37:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=pVomDTH3U/Cv7bE3eO/bUqD5aekDB26rYwFEyVat39M=; b=Q1Pmp7VmdwAUC78Qi8avCeDTn8wC8Wb5h9Vq5QgDdvbTRka5FMmxPOcnuFxWEjSGkA pqSPO24i9+9FPmBWUSg3/5NTNSKjtqjGkRZwRxonFcozScucH5UPEBtWg4w5kr8I9wwI J9BdEd9BhGaZcz/+sS6ZyEqYXHIh/9NGw07ZQVxyRKsiJHIzdnJMXPSXSrh9E3KEJyts QuU/zjUuzDPMkSPpxsciqMAOWivVjv+tBxAxxdjjATFhDAtwWL0TD5tUXIznJlRkttYa LiEYk3N8c22kFiqjJqGFYkpsID/nCCcdAzO7OM32lxUY/j2IO/etsR7eetDmwphsuymF iw9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=pVomDTH3U/Cv7bE3eO/bUqD5aekDB26rYwFEyVat39M=; b=grW4F9CGHQ1Bv+riXYhk+mjyzLSzTZE5vzREQlulhS6tD1HkhRM8GuNMGWDHm1b76z 3OM1hdhN2rJUM5ayqTLKNH/LgcunQqzetiJWFZEwC6zbLeTGJPnHqcnfRcTVEeOzVC5q jzJtTA1CDaczwrTzBNe3BZBaPxPE0Yfxw7/FLYx0JDueobxbdWn6L0HkzFM6K86ttDpz z7tElpvvi1b1uNCkpLsK6XnQLCgMnqVbT1LYLP8/dTTdgl+LadGYt176v5fxCUvzweGt LEL+sjqBxVd7yKisb9jeCoyeZhwjRf5gta20NQa+e5loxy3oS9LjoqcugytlAmdHb4yR S3Vg== X-Gm-Message-State: AO0yUKUeERqf1gjXwV0OovmOBIkXIPmYsJSRukcEI8SrO+E0K8Gq/JC2 tX32R6x0f4xukxTWCpM75tQ= X-Google-Smtp-Source: AK7set8hPw1lc6wutaCdvmVS/qQn5a0jiqhXH9uHUCCH5xio/Y/lSf9hFB14PNi+b9PzIkBgI3PeHg== X-Received: by 2002:a05:6000:54a:b0:2bf:ec0f:af79 with SMTP id b10-20020a056000054a00b002bfec0faf79mr7250412wrf.63.1675175744802; Tue, 31 Jan 2023 06:35:44 -0800 (PST) Received: from lancelot ([195.147.220.46]) by smtp.gmail.com with ESMTPSA id j11-20020a5d464b000000b002bfd687a96dsm11914458wrs.16.2023.01.31.06.35.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 06:35:44 -0800 (PST) Received: from gaius by lancelot with local (Exim 4.94.2) (envelope-from ) id 1pMrjN-00H5mq-N6; Tue, 31 Jan 2023 14:35:29 +0000 From: Gaius Mulley To: Thomas Schwinge Cc: , Rainer Orth , Mike Stump Subject: Re: For Modula-2 build-tree testing, also set up paths to compiler libraries References: <87zg9zaqp4.fsf@dem-tschwing-1.ger.mentorg.com> Date: Tue, 31 Jan 2023 14:35:29 +0000 In-Reply-To: <87zg9zaqp4.fsf@dem-tschwing-1.ger.mentorg.com> (Thomas Schwinge's message of "Tue, 31 Jan 2023 12:28:23 +0100") Message-ID: <87edradb66.fsf@debian> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=gaiusmod2@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DKIM_VALID_EF=-0.1,FREEMAIL_ENVFROM_END_DIGIT=0.25,FREEMAIL_FROM=0.001,RCVD_IN_DNSWL_NONE=-0.0001,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GIT_PATCH_0,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP 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: Thomas Schwinge writes: > Hi! > > On 2022-10-10T16:31:26+0100, Gaius Mulley via Gcc-patches wrote: >> Here are the dejagnu expect library scripts for the gm2 >> testsuite. > > This (or some variant thereof; haven't checked), became part of > commit r13-4704-g1eee94d351774cdc2efc8ee508b82d065184c6ee > "Merge modula-2 front end onto gcc". > > > For build-tree testing ('$gccpath !=3D ""'; such as standard 'make check'= ), > 'gm2_link_flags' takes care to set up paths to a number of libraries that > may be necessary: > >> --- /dev/null 2022-08-24 16:22:16.888000070 +0100 >> +++ gcc-git-devel-modula2/gcc/testsuite/lib/gm2.exp 2022-10-07 20:21:1= 8.718097775 +0100 > >> +set gm2_link_libraries "m2pim m2iso"; > >> +# gm2_link_flags - detects the whereabouts of libraries (-lstdc++). >> +# >> + >> +proc gm2_link_flags { paths } { >> + global srcdir; >> + global ld_library_path; >> + global gccpath; >> + global gm2_link_libraries; >> + >> + set gccpath ${paths} >> + set libio_dir "" >> + set flags "" >> + set ld_library_path "." >> + >> + set shlib_ext [get_shlib_extension] >> + verbose "shared lib extension: $shlib_ext" >> + >> + if { $gccpath =3D=3D "" } { >> + global tool_root_dir >> + >> + set libstdcpp [lookfor_file ${tool_root_dir} libstdc++] >> + if { $libstdcpp !=3D "" } { >> + append flags "-L${libstdcpp} " >> + append ld_library_path ":${libstdcpp}" >> + } >> + } else { >> + if [file exists "${gccpath}/lib/libstdc++.a"] { >> + append ld_library_path ":${gccpath}/lib" >> + } >> + if [file exists "${gccpath}/libstdc++/libstdc++.a"] { >> + append flags "-L${gccpath}/libstdc++ " >> + append ld_library_path ":${gccpath}/libstdc++" >> + } >> + if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.a"] { >> + append flags " -L${gccpath}/libstdc++-v3/src/.libs " >> + append ld_library_path ":${gccpath}/libstdc++-v3/src/.libs" >> + } >> + # Look for libstdc++.${shlib_ext}. >> + if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.${shl= ib_ext}"] { >> + append flags " -L${gccpath}/libstdc++-v3/src/.libs " >> + append ld_library_path ":${gccpath}/libstdc++-v3/src/.libs" >> + } >> + >> + # puts stderr "${gm2_link_libraries} before foreach" >> + foreach d [list {*}${gm2_link_libraries}] { >> + # puts stderr "${d} XXXX" >> + send_log "ld_library_path was ${ld_library_path}\n" >> + send_log "looking for ${gccpath}/lib${d}/.libs/lib${d}.a\n" >> + if [file exists "${gccpath}/libgm2/lib${d}/.libs/lib${d}.a"] { >> + send_log "good found ${gccpath}/libgm2/lib${d}/.libs/lib${= d}.a\n" >> + # append flags " -L${gccpath}/libgm2/lib${d}/.libs -l${d}" >> + append flags " ${gccpath}/libgm2/lib${d}/.libs/lib${d}.a" >> + append ld_library_path ":${gccpath}/libgm2/lib${d}/.libs" >> + } >> + send_log "ld_library_path is ${ld_library_path}\n" >> + } >> + } >> + >> + set_ld_library_path_env_vars >> + return "$flags" >> +} > > However, this misses compiler libraries (such as libgcc, which libstdc++ > may depend on). For example, I see my x86_64-pc-linux-gnu '-m32' testing > not pick up the build-tree libgcc, but instead some random system one, > which (expectedly) doesn't satisfy requirements of other build-tree > libraries: > > [...]/build-gcc/gcc/testsuite/gm225/m.x0: /lib/i386-linux-gnu/libgcc_= s.so.1: version `GCC_7.0.0' not found (required by [...]/build-gcc/x86_64-p= c-linux-gnu/32/libstdc++-v3/src/.libs/libstdc++.so.6) > > ..., and thus a lot of execution FAILs. > > To cure that, OK to push the attached > "For Modula-2 build-tree testing, also set up paths to compiler libraries= "? > > > Gr=C3=BC=C3=9Fe > Thomas > > > ----------------- > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 2= 01, 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch= =C3=A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellsc= haft: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 > >>>From 5d9c8bf1a5352317fc7fd3fffe66ba690d412a4f Mon Sep 17 00:00:00 2001 > From: Thomas Schwinge > Date: Tue, 31 Jan 2023 11:38:15 +0100 > Subject: [PATCH] For Modula-2 build-tree testing, also set up paths to > compiler libraries > > Currently, 'gcc/testsuite/lib/gm2.exp:gm2_link_flags' doesn't set up > paths to compiler libraries (such as libgcc, which libstdc++ > may depend on). For example, I see my x86_64-pc-linux-gnu '-m32' testing > not pick up the build-tree libgcc, but instead some random system one, > which (expectedly) doesn't satisfy requirements of other build-tree > libraries: > > [...]/build-gcc/gcc/testsuite/gm225/m.x0: /lib/i386-linux-gnu/libgcc_= s.so.1: version `GCC_7.0.0' not found (required by [...]/build-gcc/x86_64-p= c-linux-gnu/32/libstdc++-v3/src/.libs/libstdc++.so.6) > > ..., and thus a lot of execution FAILs. > > As seen in a number of other '[...]_link_flags' procedures, the standard = idiom > seems to be to also consider 'gcc-set-multilib-library-path' for > 'ld_library_path'. > > gcc/testsuite/ > * lib/gm2.exp (gm2_link_flags) [$gccpath !=3D ""]: Also consider > 'gcc-set-multilib-library-path' for 'ld_library_path'. > --- > gcc/testsuite/lib/gm2.exp | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gcc/testsuite/lib/gm2.exp b/gcc/testsuite/lib/gm2.exp > index 15e3729e5a3..560cb719a15 100644 > --- a/gcc/testsuite/lib/gm2.exp > +++ b/gcc/testsuite/lib/gm2.exp > @@ -316,6 +316,9 @@ proc gm2_link_flags { paths } { > } > send_log "ld_library_path is ${ld_library_path}\n" > } > + > + global GCC_UNDER_TEST > + append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST] > } >=20=20 > set_ld_library_path_env_vars Hi Thomas, many thanks - yes LGTM, regards, Gaius