From owner-freebsd-riscv@freebsd.org Wed Jul 25 17:42:17 2018 Return-Path: Delivered-To: freebsd-riscv@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 270F41050831 for ; Wed, 25 Jul 2018 17:42:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D228586AFB; Wed, 25 Jul 2018 17:42:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id EB3A010B45D; Wed, 25 Jul 2018 13:42:15 -0400 (EDT) Subject: Re: What's the 'fbsd' linker emulations? To: Li-Wen Hsu References: Cc: freebsd-riscv@freebsd.org From: John Baldwin Message-ID: <3ad0b3dd-20e9-9db8-84a9-6eb4493fc87e@FreeBSD.org> Date: Wed, 25 Jul 2018 10:42:14 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 25 Jul 2018 13:42:16 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2018 17:42:17 -0000 On 7/24/18 11:38 AM, Li-Wen Hsu wrote: > Hi John, > > In https://reviews.freebsd.org/D16319 you talked about 'fbsd' linker > emulations. What's that and what we can do to have that for RISC-V? If you look at the list of linker emulations used in, e.g. sys/conf/kern.mk you will find that on almost all architectures we have a 'foo_fbsd' linker emulation rather than using 'foo'. My guess is that this is used to specify alternate paths for rtld among other things. Hmm, looking in binutils they aren't used for the rtld path though but to set the OSABI in binaries and other things. This makes me wonder though why your original patch is needed at all. binutils doesn't use FreeBSD's rtld path for any of its backends. I believe the compiler driver always specifies the path to rtld, so I wonder if the bug was an incorrectly configured/built GCC and the previous patch should be reverted? -- John Baldwin