From owner-freebsd-bugs@freebsd.org Wed Sep 23 11:25:15 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAA363F6237 for ; Wed, 23 Sep 2020 11:25:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4BxG7H5Vl5z4dt5 for ; Wed, 23 Sep 2020 11:25:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id BAD983F6069; Wed, 23 Sep 2020 11:25:15 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B98CF3F5FC8 for ; Wed, 23 Sep 2020 11:25:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BxG7H4PCnz4dlP for ; Wed, 23 Sep 2020 11:25:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 760F8F5F6 for ; Wed, 23 Sep 2020 11:25:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 08NBPFtu003187 for ; Wed, 23 Sep 2020 11:25:15 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 08NBPFtV003186 for bugs@FreeBSD.org; Wed, 23 Sep 2020 11:25:15 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 249546] Ports using gfortran broken due to bsd.sys.mk (-fuse-ld=/...) Date: Wed, 23 Sep 2020 11:25:15 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: se@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2020 11:25:15 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D249546 Bug ID: 249546 Summary: Ports using gfortran broken due to bsd.sys.mk (-fuse-ld=3D/...) Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: se@FreeBSD.org --- This is not a ports bug, AFAICT, but affects building of some ports --- Compiling ports that use gfortran is broken on systems that use clang as default compiler. The cause is the following fragment of bsd.sys.mk, which is also included w= hen building ports: # Please keep this if in sync with kern.mk=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 .if ${LD} !=3D "ld" && (${CC:[1]:H} !=3D ${LD:[1]:H} || ${LD:[1]:T} !=3D "l= d") # Add -fuse-ld=3D${LD} if $LD is in a different directory or not called "ld= ".=20=20=20=20=20 # Note: Clang 12+ will prefer --ld-path=3D over -fuse-ld=3D.=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 .if ${COMPILER_TYPE} =3D=3D "clang" # Note: Clang does not like relative paths in -fuse-ld so we map ld.lld -> = lld.=20 LDFLAGS+=3D -fuse-ld=3D${LD:[1]:S/^ld.//1W} .else # GCC does not support an absolute path for -fuse-ld so we just print this= =20=20=20=20=20=20 # warning instead and let the user add the required symlinks.=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 .warning LD (${LD}) is not the default linker for ${CC} but -fuse-ld=3D is = not supported .endif .endif This causes a build error in lang/ratfor, for example: gfortran9 -O -Wl,-rpath=3D/usr/local/lib/gcc9 -Wl,-rpath=3D/usr/local/li= b/gcc9=20 -L/usr/local/lib/gcc9 -B/usr/local/bin -fstack-protector-strong=20=20=20 -fuse-ld=3D/usr/local/bin/ld test.f -o test gfortran9: error: unrecognized command line option '-fuse-ld=3D/usr/local/b= in/ld' (Full build log: http://beefy18.nyi.freebsd.org/data/head-amd64-default/p549547_s365984/logs= /errors/ratfor-1985.06_13.log) This particular -fuse-ld option should only be passed to compilers that actually accept it. For GCC or GFORTRAN only -fuse-ld=3Dbfd is acceptable to use the GNU linker. I have not found any method to suppress the addition of that -fuse-ld optio= n to the gfortran command line (and this should affect all ports that use gfortr= an as part of the build process) other than patching a ".f:" rule into the internal Makefile of the port. That should not be required and it caused me quite some effort to track down the cause of the build failure in this syst= em make file. Inclusion of bsd.sys.mk into the ports system provides useful defaults for a number of parameters, but it should be robust if used in constellations tha= t do not occur in the base system (i.e. use of gfortran in this particular case). --=20 You are receiving this mail because: You are the assignee for the bug.=