From owner-freebsd-ports@freebsd.org Fri Jan 11 14:37:44 2019 Return-Path: Delivered-To: freebsd-ports@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 C47821492478 for ; Fri, 11 Jan 2019 14:37:44 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f178.google.com (mail-it1-f178.google.com [209.85.166.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCB906E6E4 for ; Fri, 11 Jan 2019 14:37:43 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f178.google.com with SMTP id a6so3140454itl.4 for ; Fri, 11 Jan 2019 06:37:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=FdBM7TodHOpyx1AJ3o1afoRuTo0/ZhPvKpJnZ44h/hA=; b=UW/joOWe2w6I1ue7cxNW2ECw3hjp9XVCZ09qRcgyb8nScqbAhnfEDgTukLx0EN8gR+ X0ZpV3LIzhFr292SCbvzWeS3wXecb57YJ9TAiLE4/8vdFIr3+MCM4eF0+TsdBacGsAT7 +BKL/hpBCfZRIinj3Li3KoRugJWrI8K5sv/wBCf5APuW7pHCKjMZtObLU3MT9q8NJ0HF CaWBBj4i1cxPNagCmEh31XXSLYCuHSabc2YeC4ONwT1SiDQTxinubeEemg2ZdI/WppTf 8Z19qk8C+OstyoTz4vmgqDLYy2va6gsqM/0d6b52FvMGSGi115rBP03tgwZzj7UpAGBD dwYw== X-Gm-Message-State: AJcUukcUXSWmXYR8/NRqLQW2sFHnvntKKspZfn43/MlDunD8IWD98NPi FMSrSYYFHm4VcelFU7HAUquVSH+9vlIctqDn+P7eOA== X-Google-Smtp-Source: ALg8bN4/OQJ+lpFIhUYb48HeiNkm4DYPzYWLziXklhUYDfQSidLT5IrDaT1oCO5eWZvcJnmLKSTT5BO6tZtzJHErFcg= X-Received: by 2002:a24:8ac7:: with SMTP id v190mr1292700itd.174.1547217457319; Fri, 11 Jan 2019 06:37:37 -0800 (PST) MIME-Version: 1.0 From: Ed Maste Date: Fri, 11 Jan 2019 09:37:24 -0500 Message-ID: Subject: HEADS-UP: switching i386 to lld as system linker To: FreeBSD Ports Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: BCB906E6E4 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.178 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-5.80 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.86)[-0.858,0]; RCVD_IN_DNSWL_NONE(0.00)[178.166.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; IP_SCORE(-2.93)[ip: (-9.10), ipnet: 209.85.128.0/17(-3.74), asn: 15169(-1.75), country: US(-0.08)]; TO_DOM_EQ_FROM_DOM(0.00)[] 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: Fri, 11 Jan 2019 14:37:45 -0000 As you may know I've been working on migrating to LLVM's lld as our system linker, to replace the outdated GNU binutils ld 2.17.50. lld is currently the system linker (i.e., is /usr/bin/ld) on amd64, arm64, and armv7. i386 was not switched over at the same time as the other architectures because many ports failed to build with lld, primarily due to linking non-PIC code into shared objects. Thanks to Antoine's sustained effort we've run through many exp-runs[1], iterating on addressing ports that fail to build with lld. The most recent i386 exp-run[2] had a little over 40 new failures which resulted in about 70 skipped ports; a few of the failing ports responsible for the most skipped have since been addressed. PRs are open for the remaining failures and can be found via the dependency tree[3] for the exp-run PR 214864. I intend to enable lld as the system linker for i386 in -CURRENT in the next week or so, and will continue helping address new failures before and after the default is switched over. The easiest way to configure an existing -CURRENT i386 system for testing with lld as the system linker is to run as root: # ln -fs ld.lld /usr/bin/ld conversely, to switch (back) to GNU binutils ld: # ln -fs ld.bfd /usr/bin/ld There are a few ways to address failures with lld: 1. Add LLD_UNSAFE to the Makefile, which will cause the port to (attempt to) depend on the binutils port/package and link with GNU ld. This may not work if the port's build infrastructure does not honour LD or LDFLAGS environment variables. 2. Add LDFLAGS_i386=-Wl,-z,notext to the Makefile. This will override lld's default of disallowing .text relocations (and is a no-op with GNU ld, just reaffirming GNU ld's default). As with #1 above, this may not work if the port does not properly honour LDFLAGS. 3. Ensure that -fPIC is included in CFLAGS when compiling objects to be linked into shared objects. 4. Rewrite assembly files to be linked into shared objects to be PIC. Please let me know if you have any questions or want assistance with a specific port. [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214864 [2] http://package18.nyi.freebsd.org/build.html?mastername=headi386PR214864-default&build=2019-01-05_21h00m02s [3] https://bugs.freebsd.org/bugzilla/showdependencytree.cgi?id=214864&hide_resolved=1