From nobody Tue Apr 11 13:21:00 2023 X-Original-To: freebsd-toolchain@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 4Pwmgw5ZBJz44rW4; Tue, 11 Apr 2023 13:21:16 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 4Pwmgv38dGz3sQv; Tue, 11 Apr 2023 13:21:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.208.173 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com; dmarc=none Received: by mail-lj1-f173.google.com with SMTP id x31so4429947ljq.10; Tue, 11 Apr 2023 06:21:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681219273; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=v60PDIV+Tl3Kp0UgE7QzazOLzaPN2C6jSjCEFiH7Q8c=; b=yARSs3bMQuq+/vU+cJRXzYRc8vKgjqpSYpBUQkBDhG1wvGFS3ZFI+MibkMtlY0yQ9Z KmhdCnimvQ93dXAXJdMLe9YG1WloVwBXa/CSYeBHu/aOtJwufBXnHekvJjS2ZZ+Rdjf2 Fd2B7yKyROibREoqKuW4m1ls6ehyA1rr9OWDC8xC8gR+qDhJY3U7rhXnrRzaoFSXxMqY aLQYifhLeIF5zFWJI2uxWfiDTh2cbjlTxtWJsXQdKUztwZ03vcDB4xRLn95mQLW2Jq43 nNYZoOP0lQMBK0RG2kMqegtbGZBTLJyB8+SJGOVQWNDmu6BPjW89TmzGEs0bdM8Dq6W5 PMfA== X-Gm-Message-State: AAQBX9di2HrsNdOP31RVwLw83mmuVVM7KyIdmjCEc26cU5Pkp1KeQByC JhjmQv5zablNHd9k1Qli0ATIcDVUaUACqBxK3wYG6r254mc= X-Google-Smtp-Source: AKy350Zv/25hw9DM0qZ8lyeRCtPAw+YRhYCBum9uQogUqrlZ8PP45cEzehm3y/fgCm+oK+b8GSKu8N0XJvwlNQGC+FY= X-Received: by 2002:a2e:800e:0:b0:2a7:83fa:2392 with SMTP id j14-20020a2e800e000000b002a783fa2392mr1358841ljg.8.1681219272614; Tue, 11 Apr 2023 06:21:12 -0700 (PDT) List-Id: Maintenance of FreeBSD s integrated toolchain List-Archive: https://lists.freebsd.org/archives/freebsd-toolchain List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Ed Maste Date: Tue, 11 Apr 2023 09:21:00 -0400 Message-ID: Subject: Re: Migrating to LLVM binutils tools (ar, nm, addr2line, etc.) To: "freebsd-toolchain@FreeBSD.org" , FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-2.36 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.94)[-0.943]; NEURAL_HAM_SHORT(-0.41)[-0.413]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.173:from]; MLMMJ_DEST(0.00)[freebsd-toolchain@freebsd.org,freebsd-hackers@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.173:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; DMARC_NA(0.00)[freebsd.org]; FREEFALL_USER(0.00)[carpeddiem]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4Pwmgv38dGz3sQv X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On Mon, 5 Jul 2021 at 11:09, Ed Maste wrote: > > FreeBSD migrated from GNU binutils to versions from ELF Tool Chain, > starting in 2014. At that time there were no usable LLVM versions of > those tools, but they have been developing rapidly since then. Now I > think it may be prudent to migrate to the LLVM tools where they exist, > for both functionality and maintainability reasons. Functionality arguments still stand, but ELF Tool Chain's maintainability situation has likely improved in the time since I wrote the original email. > I'd like to allow use of link-time optimization (LTO) in the FreeBSD > base system. LTO runs optimization passes over the entire executable > (or library) at link time and thus allows for more effective > optimization than when performed on individual compilation units. ... > Potential next steps are: > - Introduce new build knob Alex introduced WITH_LLVM_BINUTILS in 021385aba562. > - Iterate on exp-runs and call for testing The exp-run is open in 258872. Perl initially failed to build, which caused thousands of ports to be skipped. That issue was fixed by markj in 27f35b7dd418. The next issue is both tcl86 and postgresql13-client failing to build, resulting in a little over 5000 skipped ports. The error is of the form: strip: error: 'libtclstub86.a': not stripping symbol '.L.str.1' because it is named in a relocation tcl's build is requesting to discard all non-global symbols (-x) but has a local symbol referenced by a relocation entry. Both ELF Tool Chain and GNU strip leave the symbol intact in this case, and llvm-strip likely needs to do the same. There's an LLVM ticket for this open at https://github.com/llvm/llvm-project/issues/47468. When switching to LLVM's lld linker we introduced an LLD_UNSAFE tag which had the port fall back to using GNU ld. As a short term workaround for LLVM strip issues we could use a similar approach here. However, it looks like ports USE_BINUTILS infrastructure does not currently override strip, and that would first need to be fixed. See PR270663. > - Switch to LLVM tools by default Given the open ports issues we are not yet ready to entertain this change, and I am not sure there's enough time in advance of FreeBSD 14 to do so.