From nobody Tue Dec 21 19:57:27 2021 X-Original-To: freebsd-arm@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 92742190EFC4; Tue, 21 Dec 2021 19:58:10 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JJS1Y6Y8Jz58qx; Tue, 21 Dec 2021 19:58:09 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f180.google.com with SMTP id r2so83315ilb.10; Tue, 21 Dec 2021 11:58:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G5+PkD+J48qk9v5vFxoSVH4yJ5UVfQ8tWMir/O/L8mk=; b=nq9kunY0oSWGiIF8gskpdhM+RuPMvARBEcYA6R4FcA139RVWZxaFkmXoEl6RstCQRi mpFJ2HW0QrWyAwpFMHs53VOrhVRAqz/obE20Ti+08Ce7RzL0wmpautU/8MliQccDLPct 4vXxih1/TrZYD8Bk7qhRaDo/s8jUJsGKM5hK64XMlec+2+Kbr8ao/X+UE/sOSAuFuCJG oSjd1BKSTSAFONhEHdsaRznHGMZKtxWmbgpZo7moaOYjpCe3iQYDp/vX8zoUzBngJwVU /BbWTfreiC8XZQmAwI2WJ5eJD58WNtvH3Nmo8McmVgnydiWVhLZ8iThADEvr/UsQkwGC BK+g== X-Gm-Message-State: AOAM533ln0y2tTOhd2US2f7SSACKr5oaPFnLODFBUYOo5b0xdgE+6fuP u6/MWZ595+6fKqhH0wgsprq2jnsrrSvGmIf+kDj+O6Ewa8g= X-Google-Smtp-Source: ABdhPJwG78GNQEzEt0BTncoyxMjRg4nKXNnGmSjr8UjDU7SwOJtsfkdrzF71larf+AK0Gn1V3fnoY8Z4QEW4XdxrFqU= X-Received: by 2002:a05:6e02:1528:: with SMTP id i8mr2639517ilu.312.1640116682455; Tue, 21 Dec 2021 11:58:02 -0800 (PST) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 References: <5CA8FE25-F46A-4902-9FFC-266347C88021@FreeBSD.org> In-Reply-To: From: Ed Maste Date: Tue, 21 Dec 2021 14:57:27 -0500 Message-ID: Subject: Re: /stable/12 future To: Dimitry Andric Cc: Jan Beich , "freebsd-toolchain@FreeBSD.org" , freebsd-arm Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4JJS1Y6Y8Jz58qx X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, 20 Dec 2021 at 15:54, Dimitry Andric wrote: > > The obvious solution would seem to be to switch to lld as the default > linker, however that also runs into a snag. Since lld uses the blx > instruction for interworking, it prints a warning "lld uses blx > instruction, no object with architecture supporting feature detected". > > And because we link with the --fatal-warnings option, this stops> buildworld dead in its tracks. Obviously, this warning could be ignored > (by removing --fatal-warnings, or patching it out), but I think this > might result in issues when the actual binaries are run. I believe this warning is emitted in any environment that a blx instruction might be necessary, not that the instruction is actually used. From ELF/InputFiles.cpp: // The ARM support in lld makes some use of instructions that are not available // on all ARM architectures. Namely: // - Use of BLX instruction for interworking between ARM and Thumb state. // - Use of the extended Thumb branch encoding in relocation. // - Use of the MOVT/MOVW instructions in Thumb Thunks. I wonder if we could remove the warning from ELF/Driver.cpp in the case that config->armHasBlx == false, and replace it with an error in ELF/Arch/ARM.cpp if we actually need to emit a blx instruction?