From nobody Mon Apr 18 03:20:49 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 22CDF5D01B5; Mon, 18 Apr 2022 03:20:58 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KhXJT0LdQz3mFJ; Mon, 18 Apr 2022 03:20:56 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.16.1/8.16.1) with ESMTPS id 23I3Knlq005340 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 17 Apr 2022 20:20:49 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.16.1/8.16.1/Submit) id 23I3Knlv005339; Sun, 17 Apr 2022 20:20:49 -0700 (PDT) (envelope-from sgk) Date: Sun, 17 Apr 2022 20:20:49 -0700 From: Steve Kargl To: Mark Millard Cc: freebsd-ports@freebsd.org, FreeBSD Hackers Subject: Re: 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: Reply-To: sgk@troutmask.apl.washington.edu References: <90BF482E-BE98-4783-8440-9FA0E03E3D88.ref@yahoo.com> <90BF482E-BE98-4783-8440-9FA0E03E3D88@yahoo.com> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <90BF482E-BE98-4783-8440-9FA0E03E3D88@yahoo.com> X-Rspamd-Queue-Id: 4KhXJT0LdQz3mFJ X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=washington.edu (policy=none); spf=none (mx1.freebsd.org: domain of sgk@troutmask.apl.washington.edu has no SPF policy when checking 128.95.76.21) smtp.mailfrom=sgk@troutmask.apl.washington.edu X-Spamd-Result: default: False [2.40 / 15.00]; HAS_REPLYTO(0.00)[sgk@troutmask.apl.washington.edu]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.56)[-0.565]; MIME_GOOD(-0.10)[text/plain]; SUBJECT_ENDS_QUESTION(1.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; R_SPF_NA(0.00)[no SPF record]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.96)[0.963]; MLMMJ_DEST(0.00)[freebsd-ports,freebsd-hackers]; FREEMAIL_TO(0.00)[yahoo.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:73, ipnet:128.95.0.0/16, country:US]; RCVD_TLS_ALL(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[washington.edu : No valid SPF, No valid DKIM,none] X-ThisMailContainsUnwantedMimeParts: N On Sun, Apr 17, 2022 at 07:21:11PM -0700, Mark Millard wrote: > 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: > You're best bet is to have small shell scripts. For gfortran testing with it built in my home directory, I have % cat ~/bin/gfcx #! /bin/sh DIR=`id -P kargl | sed 's/\:/\ /g' | awk '{print $9}'` export DIR LD_LIBRARY_PATH=$DIR/work/lib export LD_LIBRARY_PATH LD_RUN_PATH=$DIR/work/lib export LD_RUN_PATH $DIR/work/bin/gfortran -fno-backtrace $@ You'll need to figure out how to get the build to use your scripts. PS: When clang/llvm was imported into FreeBSD, /lib/libgcc_s.so.1 should have been renamed to libllvm_s_so.1. Usurping a well-known name from a well-known open-source compiler is simply stupid. -- Steve