From owner-freebsd-ports@freebsd.org Thu Sep 26 17:48:49 2019 Return-Path: Delivered-To: freebsd-ports@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 820B412EEBA for ; Thu, 26 Sep 2019 17:48:49 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 46fMqP2DDDz4cgg for ; Thu, 26 Sep 2019 17:48:49 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 4A2E612EEB9; Thu, 26 Sep 2019 17:48:49 +0000 (UTC) Delivered-To: ports@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 48E1512EEB8 for ; Thu, 26 Sep 2019 17:48:49 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46fMqP0yLwz4cgf; Thu, 26 Sep 2019 17:48:49 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 1A4C8A032; Thu, 26 Sep 2019 17:48:49 +0000 (UTC) From: Jan Beich To: Willem Jan Withagen Cc: "ports\@freebsd.org" Subject: Re: Using a different linker in a CMake project References: <9e4e72ba-f08a-667d-076a-f4d20614b41f@digiware.nl> Date: Thu, 26 Sep 2019 19:48:45 +0200 In-Reply-To: <9e4e72ba-f08a-667d-076a-f4d20614b41f@digiware.nl> (Willem Jan Withagen's message of "Thu, 26 Sep 2019 18:18:17 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2019 17:48:49 -0000 Willem Jan Withagen writes: > Hi, > > For building ceph14 in I need to use ld from the ports binutils. > Mainly because of versioning that I can not get to work with the llvm > linker, and is a know difference between GNU ld en LLVM ld. > > Just building in the project I was able to do that with: > -D CMAKE_CXX_FLAGS_DEBUG=" -fuse-ld=/usr/local/bin/ld > -Wno-unused-command-line-argument" Try defining LLD_UNSAFE=yes in port's Makefile. It'd be translated to LDFLAGS+=-fuse-ld=bfd and then by USES=cmake into -DCMAKE_EXE_LINKER_FLAGS:STRING="${LDFLAGS}" \ -DCMAKE_MODULE_LINKER_FLAGS:STRING="${LDFLAGS}" \ -DCMAKE_SHARED_LINKER_FLAGS:STRING="${LDFLAGS}" \ $ make -V CMAKE_ARGS:M\*bfd\* LLD_UNSAFE= -DCMAKE_EXE_LINKER_FLAGS:STRING=" -fstack-protector-strong -fuse-ld=bfd " -DCMAKE_MODULE_LINKER_FLAGS:STRING=" -fstack-protector-strong -fuse-ld=bfd " -DCMAKE_SHARED_LINKER_FLAGS:STRING=" -fstack-protector-strong -fuse-ld=bfd " However, if you need /usr/local/bin/ld.bfd rather than /usr/bin/ld.bfd on FreeBSD 11.* define USE_BINUTILS and pass LDFLAGS+=-B${LOCALBASE}/bin .