From nobody Tue Feb 08 19:21:07 2022 X-Original-To: haskell@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 2CEFC19A646A for ; Tue, 8 Feb 2022 19:21:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JtXtC1mTVz4dm1 for ; Tue, 8 Feb 2022 19:21:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15CD31EF25 for ; Tue, 8 Feb 2022 19:21:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 218JL72f087631 for ; Tue, 8 Feb 2022 19:21:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 218JL7R1087630 for haskell@FreeBSD.org; Tue, 8 Feb 2022 19:21:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" From: bugzilla-noreply@freebsd.org To: haskell@FreeBSD.org Subject: maintainer-feedback requested: [Bug 261798] lang/ghc: fix llvm code generation Date: Tue, 08 Feb 2022 19:21:07 +0000 X-Bugzilla-Type: request X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: haskell@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? Message-ID: In-Reply-To: References: X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: FreeBSD-specific Haskell issues and discussions List-Archive: https://lists.freebsd.org/archives/freebsd-haskell List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-haskell@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644348067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0QNVEhYz882/mOcPVTPpL3AM812TgNVNPeeVTOiYZLg=; b=tlv9Tft5dXx61WBerp5lEwbyeaZIMkXj2d8mrzruyDrA4JyPSFkhqOqvZG4fYtxlLpqV2G y1pNU7eJOK99F7ibqf3IQP293vwpriHRHp55hzDJFGJCVGH3hMWPcYmt9TqzlFgp2wi5yY l8pMThEhuy5fUCT1xe6floTtHkxO11ssjS9/voEK+iSHvNztHmeFgw/EI2CHXpwS/B3q1W VOj3PtwP33on3zKDLA13qo66zpfMsvliaG26r+0CKjzMoTSGZLTCEq2pxFwUoxyjkRwiL9 iLGPLFBVvuXatxhzuYav3VwcdUvxMv4Av23Hy7zhpZfrkDO8SlOv3fF7RIEv0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644348067; a=rsa-sha256; cv=none; b=tz1ydh9n9A4KAD4DNGS3Bq/rBugxWmhMUjL3Bbfvk6AQ2Zh7A/Ek8+TgeXXxEPFSBc7Wig Sf6KGJk+BZfxQs0iqFbnILwABSHbHKwbSBNyCY1txynx1xyD5TW8srNqaBmD5gwZAp9Mv7 Zl/sRHLo8ryvV5TFCur1X6Sg4u32VIre6AaDquqKtYXI7m6YpwM24mxkqZkVSJa0/SWxRz EENuZBjP0LUNTQnWaHYdvpgXqiz33w4CmqyXzEV1EiNqMHRpnMAyrcUGaqKvY/0qKdCagy e9XHzKItt/FuQiZ8wAM83tgbyGx386Rr4CdlG5+TVk9b5L5k19M7UjnKhC7SQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N Bugzilla Automation has asked freebsd-haskell (Nobod= y) for maintainer-feedback: Bug 261798: lang/ghc: fix llvm code generation https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D261798 --- Description --- Salve, salve! GHC searches for a `amd64-portbld-freebsd` version of LLVM, which does not match either base or ports version identifiers. If we try to compile a simple hello world: ``` $ ghc -fllvm main.hs -o main.o [1 of 1] Compiling Main ( main.hs, main.o ) : error: Warning: Couldn't figure out LLVM version! Make sure you have installed LLVM between [9 and 13) ghc: panic! (the 'impossible' happened) (GHC version 8.10.7: Failed to lookup LLVM data layout Target: x86_64-portbld-freebsd Available targets: i386-unknown-windows i686-unknown-windows x86_64-unknown-windows arm-unknown-linux-gnueabihf arm-unknown-linux-musleabihf armv6-unknown-linux-gnueabihf armv6-unknown-linux-musleabihf armv6l-unknown-linux-gnueabihf armv6l-unknown-linux-musleabihf armv7-unknown-linux-gnueabihf armv7-unknown-linux-musleabihf armv7a-unknown-linux-gnueabi armv7a-unknown-linux-musleabi armv7a-unknown-linux-gnueabihf armv7a-unknown-linux-musleabihf armv7l-unknown-linux-gnueabi armv7l-unknown-linux-musleabi armv7l-unknown-linux-gnueabihf armv7l-unknown-linux-musleabihf aarch64-unknown-linux-gnu aarch64-unknown-linux-musl aarch64-unknown-linux i386-unknown-linux-gnu i386-unknown-linux-musl i386-unknown-linux x86_64-unknown-linux-gnu x86_64-unknown-linux-musl x86_64-unknown-linux x86_64-unknown-linux-android armv7-unknown-linux-androideabi aarch64-unknown-linux-android armv7a-unknown-linux-androideabi powerpc64le-unknown-linux-gnu powerpc64le-unknown-linux-musl powerpc64le-unknown-linux s390x-ibm-linux i386-apple-darwin x86_64-apple-darwin arm64-apple-darwin aarch64-apple-darwin armv7-apple-ios aarch64-apple-ios i386-apple-ios x86_64-apple-ios amd64-portbld-freebsd x86_64-unknown-freebsd aarch64-unknown-freebsd armv6-unknown-freebsd-gnueabihf armv7-unknown-freebsd-gnueabihf arm-unknown-nto-qnx-eabi Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/utils/Outputable.hs:1179:37 in ghc:Outputable pprPanic, called at compiler/llvmGen/LlvmCodeGen.hs:113:20 in ghc:LlvmCodeGen Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug ``` It seems `amd64-portbld-freebsd` was in fact de identifier used on ports LL= VM (please see https://gitlab.haskell.org/ghc/ghc/-/issues/15718), but that is= not the case anymore. Now all versions (tested 90 (default), 10 (default on PowerPC) and 13) use `x86_64-portbld-freebsd`, causing GHC to fail. Although `x86_64-unknown-freebsd` (base LLVM) is correct, the way GHC searc= hes for LLVM is neither clear nor documented, and it does not seem to use base = LLVM at all. This patch addresses the problem renaming the identifier to the correct one. Poudriere testport does not complain. Built on both 13.0-RELEASE and 14.0-CURRENT. Cheers!