From nobody Mon Apr 18 02:21:11 2022 X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1E3DE11D3FB4 for ; Mon, 18 Apr 2022 02:21:26 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic317-21.consmr.mail.gq1.yahoo.com (sonic317-21.consmr.mail.gq1.yahoo.com [98.137.66.147]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KhVzm6L7Vz3Nyr for ; Mon, 18 Apr 2022 02:21:24 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1650248476; bh=hGij0/XqQMB/uGYzlnm+RZWPHv+2R1DdiO+s6Hgwf+I=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=V0HLcCO9I+C52atSF2zHr/qEt6+nAyb1oD7XuWseMHgpoP+ELNE4TrnT/f27zoYHDCmKUP3eJE0E5dElat7T0k1hMu+TeIKatFTGcsxNN4UCWgF/U557C5csqSElwXDWvw2Js7+/8/WiJWA/wA4jh/9JuI3SC1nnaTiCpSmfNciOv5x2hSaCSBz+3I+klySukr2hM0TQlz8zZYsaz3FjQDvbA5RAhJj7TTVgSuGIJSq4y2FSNhMfYz8SFbwgwlH55qAst7tEsmlRXnQRO8Hnw3hIRoAihihtqatFDneVDVGOUvtHOh8GTWIWH47LMC7/r4LYzxW/ubPn+V2TEa91Lg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1650248476; bh=QIHyq2WvBa/KcqbbL679B8WKgtNpVWnegOhfv2omvAu=; h=X-Sonic-MF:From:Sub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ykyeLvi 8CYliHi7NtdYDKieLlS_VOYPBlN_00psPm1XWIrt99X.JcdQO3ab784C5IIsVT3GX6iubN7JqD7G BSFkxKe52M_fzQOo8E6nkQ6VQ8kIwQnSLtyHIboGc0udTglO1J6P.dAa8s2_1TvwCRxjFY49CK4w ARrekNckYXikzQTSvq266VvRa.yGqGr0nExr6aE0vAx3oVv8SDYabWmqUtRDdfb3J1T6wehRuiiP uymfII_IdFmjVSTu0LvDIPUerg4Vy1m6RArfaed.z9saPYVs7xyfCI8m2ldIjx_hGnkj2rGL1bmd Y8OoXtQseToVH8Gp7RNLG1KRBBvZHZIIDJ4EW4zqqJeqv_lblHkHjwSO0E6X8ySBtQ38u8SGy7cp AtogMdxbHQzfLn8aLPJqRMjHqKvQPTUQeho7qYHumk0SbGI8r00xJI5XILLYsiSVDsriFP9kG_3N 3Cg.qI7WJtDLE7NHZn5iCfh1hsSppPTD7.phYO0VaclrFsqRFj5mpj17Zui1EOyd8xGT0e.hfgW1 3swiOBHgT6mo- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.gq1.yahoo.com with HTTP; Mon, 18 Apr 2022 02:21:16 +0000 Received: by hermes--canary-production-bf1-5f49dbcd6-7hbzw (VZM Hermes SMTP Server) with ESMTPA ID 04673f41a482f91c5a16fdc77b0558f0; Mon, 18 Apr 2022 02:21:14 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Use of lang/gcc*'s g++* via the likes of USE_GCC=11:build+ in ports when a -Wl,-rpath=/usr/local/lib/gcc* is required: How? Message-Id: <90BF482E-BE98-4783-8440-9FA0E03E3D88@yahoo.com> Date: Sun, 17 Apr 2022 19:21:11 -0700 To: freebsd-ports@freebsd.org, FreeBSD Hackers X-Mailer: Apple Mail (2.3654.120.0.1.13) References: <90BF482E-BE98-4783-8440-9FA0E03E3D88.ref@yahoo.com> X-Rspamd-Queue-Id: 4KhVzm6L7Vz3Nyr X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=V0HLcCO9; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.66.147 as permitted sender) smtp.mailfrom=marklmi@yahoo.com X-Spamd-Result: default: False [-2.50 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.66.147:from]; MLMMJ_DEST(0.00)[freebsd-ports]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.66.147:from]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N I'll use g++11 as an example here. By no means is the issue limited to g++11 . Also, the general issue is not limited to the specifics of the other aspects of the example I report below. EXAMPLE PROBLEM: FreeBSD's /lib/libgcc_s.so.1 is insufficient for what aarch64 g++11 code generation expects to be provided. Programs can be built but end up with notices that start with: ld-elf.so.1: /lib/libgcc_s.so.1: version GCC_4.5.0 required by . . . not found Sometimes the ". . ." is /usr/local/lib/gcc11/libstdc++.so.6 . Other times it does not get that far because the program itself has the issue before shared libraries are bound. A simple 6 line program on aarch64 can show the issue: # more fp-binding-failure-aarch64.cpp #include volatile long double v=3DNAN; int main() { return std::isnan(v) ? 1 : 0; } # g++11 fp-binding-failure-aarch64.cpp # ./a.out ld-elf.so.1: /lib/libgcc_s.so.1: version GCC_4.5.0 required by = /usr/home/root/c_tests/a.out not found The a.out has its own reference to=20 __unordtf2@GCC_4.5.0 : # nm -a a.out | grep '@GCC_[4-9]\.' | more U=20 __unordtf2@GCC_4.5.0 For reference . . . # ldd a.out a.out: libstdc++.so.6 =3D> /usr/local/lib/gcc11/libstdc++.so.6 = (0x83000000) libm.so.5 =3D> /lib/libm.so.5 (0x81834000) libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x8275a000) libc.so.7 =3D> /lib/libc.so.7 (0x845f3000) Use of -Wl,-rpath=3D/usr/local/lib/gcc11 avoids the example's failure by using gcc11's libgcc_s.so.1 instead of FreeBSD's. gcc11's libgcc_s.so.1 is more likely to accurately cover the g++11 compiler's potential range of code generation. I've no clue what all g++11 targeting aarch64 generates that also would not be found in /lib/libgcc_s.so.1 on aarch64. Similarly, I do not know what examples might exist for other FreeBSD platforms. But aarch64 is tier 1 these days, if that matters for this subject area. THE QUESTION: How does one use the likes of USE_GCC=3D11:build+ and also supply the appropriate -Wl,-rpath=3D/usr/local/lib/gcc?? to match which g++ is actually used? There is an analogous question for when using a linker command line directly instead (no -Wl, prefix). =3D=3D=3D Mark Millard marklmi at yahoo.com