From owner-svn-ports-all@freebsd.org Tue Apr 16 10:47:26 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9E6D156D798; Tue, 16 Apr 2019 10:47:26 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay117.isp.belgacom.be (mailrelay117.isp.belgacom.be [195.238.20.144]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FD1386953; Tue, 16 Apr 2019 10:47:25 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2BUAQCisbVc/03EQFdmGwEBAQEDAQE?= =?us-ascii?q?BBwMBAQGBZYIRVxFRIRIUFI0JijABAYIMNQGHYIIdkBAzhEoChgMkOBMBAwE?= =?us-ascii?q?BCgEBAQECbRwMhUsBBScTHCMQCxQECSUPKh4GE4MjggwLqGczhDIBCwGEZIE?= =?us-ascii?q?QgTKLYYF/gRGDEj6KAyIDkkyTZgmCCIYJjAInlHODXY41j30hgVZNMAiDJwm?= =?us-ascii?q?LBIVBPQMwkHIBAQ?= X-IPAS-Result: =?us-ascii?q?A2BUAQCisbVc/03EQFdmGwEBAQEDAQEBBwMBAQGBZYIRV?= =?us-ascii?q?xFRIRIUFI0JijABAYIMNQGHYIIdkBAzhEoChgMkOBMBAwEBCgEBAQECbRwMh?= =?us-ascii?q?UsBBScTHCMQCxQECSUPKh4GE4MjggwLqGczhDIBCwGEZIEQgTKLYYF/gRGDE?= =?us-ascii?q?j6KAyIDkkyTZgmCCIYJjAInlHODXY41j30hgVZNMAiDJwmLBIVBPQMwkHIBA?= =?us-ascii?q?Q?= Received: from 77.196-64-87.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([87.64.196.77]) by relay.skynet.be with ESMTP; 16 Apr 2019 12:46:15 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id x3GAkDqs019982; Tue, 16 Apr 2019 12:46:14 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Tue, 16 Apr 2019 12:46:13 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Gerald Pfeifer Cc: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: Re: svn commit: r499061 - in head/lang/gcc8: . files Message-ID: <20190416124613.4aeaacc1@kalimero.tijl.coosemans.org> In-Reply-To: <201904152308.x3FN84eO052473@repo.freebsd.org> References: <201904152308.x3FN84eO052473@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0FD1386953 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.977,0] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2019 10:47:27 -0000 On Mon, 15 Apr 2019 23:08:04 +0000 (UTC) Gerald Pfeifer wrote: > Author: gerald > Date: Mon Apr 15 23:08:04 2019 > New Revision: 499061 > URL: https://svnweb.freebsd.org/changeset/ports/499061 > > Log: > GCC has two runtime libraries: The static library libgcc.a (-lgcc) and > the shared library libgcc_s.so (-lgcc_s). Both implement many of the > same functions but they also each have their unique functions. When > GCC links programs and libraries there are three possibilities: > > 1. gcc -static-libgcc or gcc -static: -lgcc > => Just use libgcc.a. > > 2. gcc -shared-libgcc: -lgcc_s -lgcc > => Link with libgcc_s first, so libgcc.a is only used for its unique > functions. > > 3. gcc: -lgcc -Wl,--as-needed -lgcc_s -Wl,--no-as-needed > => Link with libgcc.a first so libgcc_s is only used for its unique > functions (_Unwind_* functions). > > Approach 3 is the default for gcc and it's also what clang and clang++ use; > approach 2 is the default for gfortran, g++ and probably other front ends. > > This patch makes 3 the default for gfortran. It significantly reduces > the use of libgcc_s. The _Unwind_* functions are also available in the > old base system libgcc_s which means this reduces the need for > -rpath /usr/local/lib/gccN in ports that depend on libraries built with > gfortran. Consider a dependency tree like this: > > prog -> libA -> libgcc_s (old base system libgcc_s is fine) > -> libB -> libgcc_s (libB built with gfortran, needs new libgcc_s) > > Here prog needs to be linked with -rpath /usr/local/lib/gccN even if it's > a normal C program compiled with clang. Without -rpath it will fail to > start because it loads old libgcc_s first as a dependency of libA and then > it fails to load libB. With this patch libB works with old base system > libgcc_s or may not need libgcc_s at all, so prog does not need to be > linked with -rpath. > > PR: 208120 > Submitted by: tijl > MFH: 2019Q2 (important user visible improvement) > > Added: > head/lang/gcc8/files/patch-gfortran-libgcc (contents, props changed) > Modified: > head/lang/gcc8/Makefile Thank you very much! Ports with USES=fortran could probably use a PORTREVISION bump so they can take advantage of the change.