From nobody Thu Nov 24 18:23:14 2022 X-Original-To: dev-commits-ports-main@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 4NJ5w23PnHz4hq6w; Thu, 24 Nov 2022 18:23:14 +0000 (UTC) (envelope-from git@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 4NJ5w22s81z3mJj; Thu, 24 Nov 2022 18:23:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669314194; 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; bh=qju1B2tVNNKTmBMTAjXtCQ8ftlWp+ONngTClc7G2Qws=; b=hZoSVAnSPV+wIahIAEivuBqEa9kDRAVzZdggCWjV+fuWzGVF3dx6Fe9ZhUyZcsgwz0hj4o Rb2oke+JigvcKYlc1weUGoQPN+D79UajSLeOqvyaj9Ved6aWWg9vRvBi264GU+SUsX+Q8P wbE958dQG/XjTUGuZoeLWi6EUx7tc/af8Q5+oNQA2KEjmd5tEZOu0KBjRp6pEaZklNMFtV r1o23/4y/xSdsQS+17QhBemAjIrTsuqlj+VwIEXQwmzxT6XlwhGOryIyGDtPBJTdNRicrm DuhZWiLiaArNT6pOH2sYrOs/ikkpCSjq2NZ8vnlK/4EGHHAK8nYtuSsIkr2xAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669314194; 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; bh=qju1B2tVNNKTmBMTAjXtCQ8ftlWp+ONngTClc7G2Qws=; b=t9u5QsGuAAR7moZoSIcCyNJ/N/09A/sHwjfSBPoH6cDmNO+MYIcj8HnC82IgUMLUXF8b0s xpowMNYKNq2TwJjMexevLvKZ2GdOGTKqbWPOwDAoVb5wduqrdPsN9zRYnrRZZl+R34DyEu AaEPLFu7O7/hR4tN7jHgdNJhiJcqQ29WvzewX5oG5ZQw1szuZJAeskkMsCCTiMrl1imX1k STsHrkFtQRI/sc+KvUOEJLAJF1JH715mZSeL5WXjZ6i5hxE5RCuwky9r0WyTNBRq6C21Yn SM2GeAOvWnyu7t7idWuAu3goPngbl7nlp+RczdxxuF2wPc0aY4KHXW4H+fvgeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669314194; a=rsa-sha256; cv=none; b=sWHCtr4F/Ba7S9Yz6pjVsvi1Bra6iebGJmGdAG5OW0bL1gvPI6Tp42v7+61DcSfJvwg9GS mf0G16WeV4iOJqcFRwvqj5wDGLQ5hbX67SBvhNlmnG9LS8OpzKNuOHPMq/tim9zjytH6Kf fWQB/UqHlN4jFI89rjfuguJClVQVUcPy0Z7eQA4xi1Cil1k9MRNvXWgiojm/4F2cEzt279 DZXQmeb62HNRsHwPjj7ihynxsVLyaLjufonFbD2yK54Sp/CLj+uBW4vVeQHZofBCoWrg+T rH4IeTMQoM3u4mdfc7WtlHNnrfWlvJ9R8EFqMuJulvfNM8TMfVAOvdEQYEa8WQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4NJ5w21wYwz19yt; Thu, 24 Nov 2022 18:23:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AOINEu5094025; Thu, 24 Nov 2022 18:23:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AOINErd094024; Thu, 24 Nov 2022 18:23:14 GMT (envelope-from git) Date: Thu, 24 Nov 2022 18:23:14 GMT Message-Id: <202211241823.2AOINErd094024@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Piotr Kubaj Subject: git: f0ee4a852421 - main - lang/rust: fix build on armv7 the same way as for powerpc List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0ee4a8524218edb81fe0be3fce56b7f15b2dae1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=f0ee4a8524218edb81fe0be3fce56b7f15b2dae1 commit f0ee4a8524218edb81fe0be3fce56b7f15b2dae1 Author: Piotr Kubaj AuthorDate: 2022-11-24 18:02:15 +0000 Commit: Piotr Kubaj CommitDate: 2022-11-24 18:17:45 +0000 lang/rust: fix build on armv7 the same way as for powerpc --- lang/rust/Makefile | 7 ++-- .../rust/files/patch-compiler_rustc__llvm_build.rs | 42 ++++++++++++++++++++++ .../powerpc/patch-compiler_rustc__llvm_build.rs | 29 --------------- 3 files changed, 47 insertions(+), 31 deletions(-) diff --git a/lang/rust/Makefile b/lang/rust/Makefile index 19b7cc66e748..48abb4cb624f 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -111,12 +111,15 @@ IGNORE= is only for FreeBSD .if ${ARCH} == powerpc # bfd to link rustc_driver; lld currently can't BUILD_DEPENDS+= ld.bfd:devel/binutils -LIB_DEPENDS+= libatomic.so:lang/gcc${GCC_DEFAULT} -MAKE_ENV+= RUSTFLAGS="-L/usr/local/lib/gcc${GCC_DEFAULT}" .else MAKE_ENV+= RUST_BACKTRACE=1 .endif +.if ${ARCH} == armv7 || ${ARCH} == powerpc +LIB_DEPENDS+= libatomic.so:lang/gcc${GCC_DEFAULT} +MAKE_ENV+= RUSTFLAGS="-L/usr/local/lib/gcc${GCC_DEFAULT}" +.endif + # rls doesn't build on rust nightly # rls needs 64-bit atomics: it doesn't build on powerpc .if !defined(NIGHTLY_DATE) && ${ARCH} != powerpc diff --git a/lang/rust/files/patch-compiler_rustc__llvm_build.rs b/lang/rust/files/patch-compiler_rustc__llvm_build.rs new file mode 100644 index 000000000000..4509c7b9d54c --- /dev/null +++ b/lang/rust/files/patch-compiler_rustc__llvm_build.rs @@ -0,0 +1,42 @@ +From cbeec86a5594ef6ca36d0ea24b4cb7e3dbaded87 Mon Sep 17 00:00:00 2001 +From: pkubaj +Date: Fri, 18 Nov 2022 12:36:49 +0000 +Subject: [PATCH] Fix build on powerpc-unknown-freebsd + +Probably also fixes build on arm and mips*. Related to https://github.com/rust-lang/rust/issues/104220 +--- + compiler/rustc_llvm/build.rs | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs +index d35e4191cc0b1..afdf9ac8883e9 100644 +--- compiler/rustc_llvm/build.rs ++++ compiler/rustc_llvm/build.rs +@@ -237,18 +237,21 @@ fn main() { + + if !is_crossed { + cmd.arg("--system-libs"); +- } else if target.contains("windows-gnu") { +- println!("cargo:rustc-link-lib=shell32"); +- println!("cargo:rustc-link-lib=uuid"); +- } else if target.contains("netbsd") || target.contains("haiku") || target.contains("darwin") { +- println!("cargo:rustc-link-lib=z"); +- } else if target.starts_with("arm") ++ } ++ ++ if target.starts_with("arm") + || target.starts_with("mips-") + || target.starts_with("mipsel-") + || target.starts_with("powerpc-") + { + // 32-bit targets need to link libatomic. + println!("cargo:rustc-link-lib=atomic"); ++ println!("cargo:rustc-link-lib=z"); ++ } else if target.contains("windows-gnu") { ++ println!("cargo:rustc-link-lib=shell32"); ++ println!("cargo:rustc-link-lib=uuid"); ++ } else if target.contains("netbsd") || target.contains("haiku") || target.contains("darwin") { ++ println!("cargo:rustc-link-lib=z"); + } + cmd.args(&components); + diff --git a/lang/rust/files/powerpc/patch-compiler_rustc__llvm_build.rs b/lang/rust/files/powerpc/patch-compiler_rustc__llvm_build.rs deleted file mode 100644 index efe5542e0e1b..000000000000 --- a/lang/rust/files/powerpc/patch-compiler_rustc__llvm_build.rs +++ /dev/null @@ -1,29 +0,0 @@ ---- compiler/rustc_llvm/build.rs.orig 2022-11-15 08:26:08.366900000 +0100 -+++ compiler/rustc_llvm/build.rs 2022-11-15 08:29:07.101616000 +0100 -@@ -235,20 +235,18 @@ fn main() { - let mut cmd = Command::new(&llvm_config); - cmd.arg(llvm_link_arg).arg("--libs"); - -- if !is_crossed { -+ if target.starts_with("arm") -+ || target.starts_with("powerpc-") -+ { -+ println!("cargo:rustc-link-lib=atomic"); -+ println!("cargo:rustc-link-lib=z"); -+ } else if !is_crossed { - cmd.arg("--system-libs"); - } else if target.contains("windows-gnu") { - println!("cargo:rustc-link-lib=shell32"); - println!("cargo:rustc-link-lib=uuid"); - } else if target.contains("netbsd") || target.contains("haiku") || target.contains("darwin") { - println!("cargo:rustc-link-lib=z"); -- } else if target.starts_with("arm") -- || target.starts_with("mips-") -- || target.starts_with("mipsel-") -- || target.starts_with("powerpc-") -- { -- // 32-bit targets need to link libatomic. -- println!("cargo:rustc-link-lib=atomic"); - } - cmd.args(&components); -