From patchwork Fri Sep 26 07:11:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Deepesh Varatharajan X-Patchwork-Id: 71054 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E4DFCAC5AC for ; Fri, 26 Sep 2025 07:12:29 +0000 (UTC) Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by mx.groups.io with SMTP id smtpd.web11.11870.1758870746773736953 for ; Fri, 26 Sep 2025 00:12:27 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@windriver.com header.s=PPS06212021 header.b=H2N0r+Sf; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.178.238, mailfrom: prvs=1364670208=deepesh.varatharajan@windriver.com) Received: from pps.filterd (m0250811.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 58Q4FkVQ1581083 for ; Fri, 26 Sep 2025 07:12:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :message-id:mime-version:subject:to; s=PPS06212021; bh=CI/PGSg3E yB5wH08wbI9aQkNnEXFXFpZDeB97S8QDYQ=; b=H2N0r+SftcqVLIYcPOheaY7e9 3XFukK8xjPMex/PLU0a87N+e20+oImz4JPy3zPgjFC2O+egSL4Ti+I3lLHwtmqzC +4Bxf3oWnE+lxpj0rrpZAJOJHrSGbRD3/Sunpv0xfrIS2cjJyzL+Jr5I5OXurVhW YDKtmLjHHrtqcioYUshliSXL2YNjStG1EqbyNh5qaX6DuL4KbwPfqxyQsr5Y2Rit PDWLGr8Bqq+tqkSqzIDMfCweumEkVSzY0Jts4TO1ltmByUCxhlH0mborLEqAImjS qvxSR1/LJPnK0Fh52sYL0or9Qdn3DQQ8w5tL6nzMeiP+tfnRrdV7txX+DcpAg== Received: from cy3pr05cu001.outbound.protection.outlook.com (mail-westcentralusazon11013065.outbound.protection.outlook.com [40.93.201.65]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 49dbsm8gcj-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 26 Sep 2025 07:12:25 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PT+ZXpnt8eREsTiOQcPbcq4vjo6j4rL5YW2zR5NoffSFID3Nwo6OtD6znBWfR91Gn4LoIVfWIFhKP0lkrjBgET80LBlVLm3JULKoQpI18N71NpLDK4IekmF3c4T+n7w8F/tkBJwVkw9XTCq39NS9L2LbHQFLLlwDBfmeaWydikaeXx8psL+i8ilelu0wZt/XHYMaXpx16kHJq4ffAma2/JK6m9uPBK+0KyRosiGu6V5iyHpN4qeBgZ4R/xp/EnRT7G+ve4sk6+CiH/ynR345s9OIpUad3cREvigYnHUNpKqqmnz2ovzC2eFuHq9FRSY6tSiGgprF3lpwAgr1ujwKWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CI/PGSg3EyB5wH08wbI9aQkNnEXFXFpZDeB97S8QDYQ=; b=ZIWCZlY2tFkxHsJiNA61HDJiw6SZ7felRHQv/HSEgsa03nmTuv68XugIU0CblFCImfX+RLxLn+rUB+wqzQ+R11drQEqPkB0tau2fMo+y1IsN2n8yNCK1bC6KK7vtNcwVrXhOSmN36W+qNE240s4XDJD5/bfSFqEjCS/NuXfQCF0GMePREHiP/SgPGY8tiZ7Gmwuglcf1a4l3E+fa+x92KC7oYSapL4J9w26JTscMyDAThg4tUWN4RyV7ekjbbN4YXhkHw+t93jOYtqDz+aq5F8uEDMLWt71nSOShXKfss9BJ8EruVKd28z7yQ8ITJFrmNQt0I9bebtaQQ4W+FyvjgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from SJ0PR11MB5648.namprd11.prod.outlook.com (2603:10b6:a03:302::11) by SJ5PPF8225D2149.namprd11.prod.outlook.com (2603:10b6:a0f:fc02::83a) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9137.19; Fri, 26 Sep 2025 07:12:22 +0000 Received: from SJ0PR11MB5648.namprd11.prod.outlook.com ([fe80::c784:dce5:4b7b:54f]) by SJ0PR11MB5648.namprd11.prod.outlook.com ([fe80::c784:dce5:4b7b:54f%5]) with mapi id 15.20.9160.008; Fri, 26 Sep 2025 07:12:22 +0000 From: Deepesh.Varatharajan@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, Deepesh.Varatharajan@windriver.com Subject: [PATCH] rust: Drop rust-llvm use clang instead Date: Fri, 26 Sep 2025 00:11:52 -0700 Message-ID: <20250926071158.3439500-1-Deepesh.Varatharajan@windriver.com> X-Mailer: git-send-email 2.49.0 X-ClientProxiedBy: SJ0PR13CA0233.namprd13.prod.outlook.com (2603:10b6:a03:2c1::28) To SJ0PR11MB5648.namprd11.prod.outlook.com (2603:10b6:a03:302::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR11MB5648:EE_|SJ5PPF8225D2149:EE_ X-MS-Office365-Filtering-Correlation-Id: cbf0735c-3ab6-4101-1b34-08ddfccc09df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?eh78y7PbAgoxyRvnVhSd/VXHy5icbz2?= =?utf-8?q?lNtmymrpfEhQutl1I7ggXgeKXk6ekUAJGe4LmpnhMHuadTmtsUSCIgyfmYW91xkZa?= =?utf-8?q?wTRawSDr3AKM7l9/9VClGf/f+VLGx2/f/Nwq/bsF7VIN4d4iqpHOq442LF38hBjER?= =?utf-8?q?nsnndCxxRROaKmxkjcMSETxUfTm5N0BKBJANzw3P29nHsoIYG9eEZoTl9N6Hsb1l9?= =?utf-8?q?GmyeZP1W6RQ7DGRfXr2runJu1DVFtXvwP9ARk7bQ44N7jOH2Z53Fimb0GdpktwiSF?= =?utf-8?q?j6f3nVyOoGyWMkLr9dnaBxAcVHicNnAwN/C9tSoYTQC5VIxM/LZjf5t6Y2T92w4TI?= =?utf-8?q?4/YSbH+v16j5oQjjeRmQ/NrRG6aWnGI0RSAjF2bxxT/hO2hXPD5JeFZvOMf3XQLkq?= =?utf-8?q?QkkcJuZ0Mz/rh9mQkTc5NzZutNOn0UTZJGlkuekk3Oqft+/ZDOt1MjWBJ4gOsxnII?= =?utf-8?q?TgM7EpGoZYukH0Y/CZyPIYZLIVj0iWgSnW864Ju5QNzVbdhQC5XFHuKPKFfED2on8?= =?utf-8?q?nHQUM95vJN5QhgYwTkVa+hDPZaBYrMvWXzvSL+H92XxHYXkMS99dG0oO+nFHM0beO?= =?utf-8?q?MQPxIW+k02wQ3SC/30rw7cmgx9R55KDqWQ7W+PwihxiUW3Ntbety0NiPtuyx9Og9p?= =?utf-8?q?3/a3X5U84wzqtdpW5HLJx5o27r3rEAJf0ttRXcs8fKVhnPRLEAHcPHNDEyrSxgCSa?= =?utf-8?q?oM0NGhvC2fBKgNSW88rsLqlpRu7ppq0KeUOenSILEnz+GKkhaP7KxlTzTWBpcU0j7?= =?utf-8?q?mxxTuhymn56ULfU9dbeB2csMmKXRLK3QS4h4QCRR/vcnVBq2F0EpQ2fYY1tKey9pk?= =?utf-8?q?P3o+LVY4X/CRVlCXMPXJDobqQjaqPhFTbwClJ20/6GKzGaNI1aUs9A5q6dRl92VzY?= =?utf-8?q?0FUvOLREZsKwfxrCHklQOE+3A585FiBweWrPjWS2Z3s+mqX1fZMlyIUTF93oBVP8V?= =?utf-8?q?Um+dReeJy/4/bzi9vgGEZnmjpP/7WRIG06f2OHogXKmRgPhwz/xp1Ua0u0SQHDuTr?= =?utf-8?q?bEffbXJb/hUAlAL1iNFe4hVHo0rzqeIZPf/Nj+7gW0Bms7E8eL+kWfbdAHxDSew/c?= =?utf-8?q?UJAZaSju8aVsbUf2DMPVXsUa5TgsR0rwVa5HNVqiZ4pxTk2oO/sfjREILp+s2enLq?= =?utf-8?q?3KdHZvvXTyTe/0Co4yPsql3zI1y15xD7Td0Kmz76UTj9EG/Uo5hIknSsLpfMY9zst?= =?utf-8?q?MK0906+FZciGWug+jQdW0zvt2/oNVT8dbsJM7N8aboxhCVoTET9Xu0kFmQmC0GziV?= =?utf-8?q?xSzlTWf8wqI9tzPKaTpr3qmbsNnpDEng/yP5TK6aT5pjIdEo/LYL2siXrUSrBAR4y?= =?utf-8?q?AmAr2AxZNdbjlHFBY01gegCro9RmexczCyPBA0gAIxcEqb9i4JYJfO4phnr+hKDFu?= =?utf-8?q?0WKS0A6qn4bTIMyc2leXaVvRVM4n9NRig=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB5648.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?hUWGaHkXC7mDaoU3nnWBp0/kvwQi?= =?utf-8?q?N+APJ69auauhRCTCEHtbbqbOEt4VWnV1UufoWfghw2dH+2aLuxmCKGw9AYrbS0WIg?= =?utf-8?q?GYc6657ZXXzzWZ6w5L6hcOaB+7+mc/AT0T+YCOr0C2u+uMpXMNFoi9E2c1b19hfWK?= =?utf-8?q?CythzOkkf8TPvYnYE7RokPK7ZkkoFas5+UJuesgx5RdnFW0pu2UJc7Fqb1GKN8WIS?= =?utf-8?q?RssmInUAcj2R5/2YCTyg13FeGEJPkpMuj2NgqzA5M2vrCZj76bZQwAXrZKiE29B4D?= =?utf-8?q?P+6vaID5kZRAiglc31POgw0lZuxGkVyjXJWWQNyv0SAhqNKZCNj2wzwu6TZ1siLDw?= =?utf-8?q?yDLu4uK/wyI1mr65fOCgXIAv7Q5/xlvjtrEptLeehCQCOlR7oPVGVtuPiBLc3lpiK?= =?utf-8?q?C3XI6D1I2enRlvl0ZSp8FMeue74xWRhvff3KTW6MdrnBJ0+FaDbvbUqQtUTNzOCTE?= =?utf-8?q?2fUtuux8DAkaP9bep6iT7Zy14lnFEETODgja911nW02RBJOlu+OrqU7ZWj6bsm48q?= =?utf-8?q?mJLqvJUXopQMz88NtggmhD4o0xtAv499mU5HnFkodRYhXcXFoXOIAB1w7NrnZBjQJ?= =?utf-8?q?vlhfH4FKBv2qpHh7MpgwxmUIA4rBk5GMMFtNPCWoaIz4jt9J/UMRYJ//Fwd1BFU0X?= =?utf-8?q?d6EtjtWIzuARWEcGyGbrHhsX/TI8sx+M1Qe38Emvzj5NngTR6l+E23WtyEB5VpoAO?= =?utf-8?q?WKX3tHWgS9F04waXrGyzJHzXPDxWPToV5RkQU/iG+2gGZ01CPdclbIKXE9VAQSpll?= =?utf-8?q?VOHX4xFSYZ/iQrqplgEdFYVzMELm+vJ+Sa9yFXw8pgN0AUFRWwygUlQnodEsPM4/+?= =?utf-8?q?1OswbVNVq389QFuxWiQN8Fk0U7pan+NFyxKb53stRLR61AubgEl2QEw5175QdLg3K?= =?utf-8?q?HzFJmgcxd6x1vXV6G7hZgBSiVm99hX03xpOSvhiZRS1oqCB91qsFTYyHFB+u9GkDQ?= =?utf-8?q?vW4Bm7FetFvw3+Aj5aVS56WIsoGJzuLxgvkzps57zbDnecI/M3bCRECyIhSRShr0z?= =?utf-8?q?2aIlDviA7SgSPspffzo9pzs1+ixuuEg0jdrRee2RWqB/aXQTVhfKxjTHWavJxSayP?= =?utf-8?q?EeQpWiBJRyPREx/vWbYjEXfmQrmzVWUNvJdIbqMydNgUIhtBunK7ioAgGGhsXt/Ig?= =?utf-8?q?tzethcQJEr9dcwVLezOckhyF9BDqnovmf5KarIBceUyv52ICZwFQpJCYpEmznfupx?= =?utf-8?q?au3DKJA/ve8uoC6VILurm4BSmZ6LFsblPH1xYMOT49NhaqvSlYiFmVBGoLCuHEi08?= =?utf-8?q?WIxqtEveQMihbEDjiv1BuB3l5Nd5SgOOO2PPrZGAnVg4nWkQR9BgTlR+T/tWAERap?= =?utf-8?q?/QftMKl4SPDUbrrs9RJx7Zn09RwrgxWwNotCgtWN+9f4dDN2IOZk1refwNfOZil6f?= =?utf-8?q?u8qJAGoeSdVGHIYmi4xD/6DwGiepTxrhE0pOWeH0+nIQuPcBrZE2KsfrZv+MxZNuy?= =?utf-8?q?VL2ParCEItA1tNkdkKsoCnN2W8+msj2VNO/4RT2WslI0YfAvA4OsXEDPPaBAvZR86?= =?utf-8?q?YPVsKH1c+GpwkBjRv/rwP1kTJOxTxEfu+r8BWnSdk+CkfhlveyUgXg0=3D?= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbf0735c-3ab6-4101-1b34-08ddfccc09df X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5648.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2025 07:12:22.7159 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5fzK7u1gX9/SaM27fvNXX3sgYNHwNW2JMhY68Hx9HRGKv32BmwXbpDzVxFWjyANl9tGmNS9utg5/zH2f6lpgPr0tW5nkBP0/wRDHwZMW0viEfryIibPI7msi7fhWPlex X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ5PPF8225D2149 X-Proofpoint-GUID: yUyDGuUJdVY-SUYFwFqupba6hSB6UIRQ X-Authority-Analysis: v=2.4 cv=TJhIilla c=1 sm=1 tr=0 ts=68d63cd9 cx=c_pps a=aMvkJueGaHUSD5gdo5rTxw==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=ei4SEBeUAAAA:8 a=NEAV23lmAAAA:8 a=mDV3o1hIAAAA:8 a=Twlkf-z8AAAA:8 a=t7CeM3EgAAAA:8 a=7CQSdrXTAAAA:8 a=iGHA9ds3AAAA:8 a=8wEic9LhAAAA:8 a=pGLkceISAAAA:8 a=IvTj1HvjAAAA:8 a=ies9aqoq9IkWzbJyAFoA:9 a=RNcOj5fWOn7y6IS6:21 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=Hqou25T6mLgA:10 a=8zIOOLb7Ym0NljyPXbuS:22 a=-74SuR6ZdpOK_LpdRCUo:22 a=FdTzh2GWekK77mhwV6Dw:22 a=a-qgeE7W1pNrGK8U0ZQC:22 a=nM-MV4yxpKKO9kiQg6Ot:22 a=M9VCcFR7d36vLOFuqMn8:22 a=kmyLcwvAnC_t3PsnBtKb:22 X-Proofpoint-ORIG-GUID: yUyDGuUJdVY-SUYFwFqupba6hSB6UIRQ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTI2MDA2NSBTYWx0ZWRfX0ObP1RAUuyYR wgFVt4TFVw90e81Ny4qm9asC/Ji0qClNgTP3nm0+uYXriwQfg8RqiRRxo1cBbzuOPx4/6UKgKpf lxGkW7qJh+Bp15FB/qCE184zTfUOw8NXN48/xwqCBOzIzOB2bCv5WX44ZHIMujw3cDs6kbfwUWB Oy7EDJhos4H9Sv9j7UdhLl/GSQffMuyE0pv9oyOvROo2JJrbU+opC7kSUYYg4tV0NetjUWGdNYU nUSvq4jS3+iCEXweupuFVWZlTFwr8YUjKDP4zmwokDucDWRoj+vcuPI7CyWP83IDlVOIMkyviGb sstpK2wZgqQtEY5y0uXAsSgMuLAY1vigtyNLPBZbWeZzRlzbSdha5SN2rgV2aQ+2xSEk4/WhvZp 5eXhJTQRaF4NEZbntX4UuPUVWVPUqA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-26_02,2025-09-26_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2509150000 definitions=main-2509260065 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-0064b401.pphosted.com id 58Q4FkVQ1581083 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 26 Sep 2025 07:12:29 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224055 From: Deepesh Varatharajan Removed rust-llvm and updated the Rust build to depend on Clang instead. Summary of discussion with the rust upstream about using latest LLVM instead of Rust maintained LLVM fork. https://internals.rust-lang.org/t/can-we-use-proper-clang-instead-of-llvm-fork-what-rust-uses/23489 Upstream LLVM is generally compatible: - Rust does support building with upstream (vanilla) LLVM, especially the latest major release and the one or two preceding ones. https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html#updating-llvm *Impact on Yocto Rust upgrades: - Rust upgrades shall always check for updates on rust forked llvm and backport the relevant patches to clang's llvm. *Regarding the rust forked llvm local patches: - There are no local patches on rust forked llvm other than the backported fixes from llvm master. *We now add these flags "-Clink-arg=-lz -Clink-arg=-lzstd" because of this following diff otherwise we will get errors during link time. Setup in rust-llvm -DLLVM_ENABLE_ZLIB=OFF \ -DLLVM_ENABLE_ZSTD=OFF \ -DLLVM_ENABLE_FFI=OFF \ Setup in clang -DLLVM_ENABLE_FFI=ON \ -DLLVM_ENABLE_ZSTD=ON \ *When multilibs enabled: llvm-config expects static libraries to be located in the lib directory rather than lib64. However, since LLVM is built as a non-multilib component, the lib directory doesn't contain any library files. To accommodate this without breaking multilib behavior, we copy the required library files appropriately. Previously, when we depended on rust-llvm, this worked because we specified: -DCMAKE_INSTALL_PREFIX:PATH=${libdir}/llvm-rust With this setup, llvm-config was installed inside ${libdir}/llvm-rust, which included its own bin and lib directories. Thus, llvm-config located in bin would correctly find the libraries in the adjacent lib directory. Even when multilib was enabled or not, llvm-config would still look for libraries under lib in this structure, so everything functioned as expected. *Dropped Patches: 0001-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch(Merged) https://github.com/llvm/llvm-project/commit/b46f34452e9dec50eee6ddbe07875f05e421a81c 0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch 0002-llvm-allow-env-override-of-exe-path.patch (We have the above two patches in clang) Signed-off-by: Deepesh Varatharajan --- meta/conf/distro/include/maintainers.inc | 1 - meta/recipes-devtools/clang/clang_git.bb | 4 +- meta/recipes-devtools/clang/common-clang.inc | 6 +- ...-gcs-instead-of-gcs-target-attribute.patch | 66 ------------- ...r-sort-ClassInfo-lists-by-name-as-we.patch | 31 ------ ...-llvm-allow-env-override-of-exe-path.patch | 33 ------- .../recipes-devtools/rust/rust-llvm_1.90.0.bb | 98 ------------------- meta/recipes-devtools/rust/rust-source.inc | 1 - meta/recipes-devtools/rust/rust_1.90.0.bb | 18 +++- 9 files changed, 19 insertions(+), 239 deletions(-) delete mode 100644 meta/recipes-devtools/rust/files/0001-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch delete mode 100644 meta/recipes-devtools/rust/rust-llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch delete mode 100644 meta/recipes-devtools/rust/rust-llvm/0002-llvm-allow-env-override-of-exe-path.patch delete mode 100644 meta/recipes-devtools/rust/rust-llvm_1.90.0.bb diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 0988bf50a7..7eec664619 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -773,7 +773,6 @@ RECIPE_MAINTAINER:pn-ruby = "Ross Burton " RECIPE_MAINTAINER:pn-run-postinsts = "Ross Burton " RECIPE_MAINTAINER:pn-rust = "Randy MacLeod " RECIPE_MAINTAINER:pn-rust-cross-canadian-${TRANSLATED_TARGET_ARCH} = "Randy MacLeod " -RECIPE_MAINTAINER:pn-rust-llvm = "Randy MacLeod " RECIPE_MAINTAINER:pn-rxvt-unicode = "Unassigned " RECIPE_MAINTAINER:pn-sassc = "Simone Weiß " RECIPE_MAINTAINER:pn-sato-screenshot = "Ross Burton " diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb index 53bca1c24f..3e117b308b 100644 --- a/meta/recipes-devtools/clang/clang_git.bb +++ b/meta/recipes-devtools/clang/clang_git.bb @@ -83,7 +83,6 @@ OECMAKE_SOURCEPATH = "${S}/llvm" # https://github.com/llvm/llvm-project/blob/main/llvm/CMakeLists.txt LLVM_TARGETS_GPU ?= "${@bb.utils.contains_any('DISTRO_FEATURES', 'opencl opengl vulkan', 'AMDGPU;NVPTX;SPIRV', '', d)}" LLVM_TARGETS_TO_BUILD ?= "AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86;LoongArch;${LLVM_TARGETS_GPU}" -LLVM_TARGETS_TO_BUILD:class-target ?= "${@get_clang_host_arch(bb, d)};BPF;${LLVM_TARGETS_GPU}" LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ?= "" @@ -107,6 +106,7 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_ENABLE_PIC=ON \ -DCLANG_DEFAULT_PIE_ON_LINUX=ON \ -DLLVM_BINDINGS_LIST='' \ + -DLLVM_INSTALL_UTILS=ON \ -DLLVM_ENABLE_FFI=ON \ -DLLVM_ENABLE_ZSTD=ON \ -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \ @@ -137,7 +137,7 @@ EXTRA_OECMAKE:append:class-target = "\ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ -DCMAKE_STRIP=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-strip \ - -DLLVM_TARGET_ARCH=${HOST_ARCH} \ + -DLLVM_TARGET_ARCH=${@get_clang_target_arch(bb, d)} \ -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_SYS}${HF} \ -DLLVM_HOST_TRIPLE=${TARGET_SYS}${HF} \ -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ diff --git a/meta/recipes-devtools/clang/common-clang.inc b/meta/recipes-devtools/clang/common-clang.inc index bf3a63914a..c22e3c1b19 100644 --- a/meta/recipes-devtools/clang/common-clang.inc +++ b/meta/recipes-devtools/clang/common-clang.inc @@ -30,10 +30,10 @@ def get_clang_arch(bb, d, arch_var): elif re.match('aarch64$', a): return 'AArch64' elif re.match('aarch64_be$', a): return 'AArch64' elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'Mips' - elif re.match('riscv32$', a): return 'RISCV' - elif re.match('riscv64$', a): return 'RISCV' + elif re.match('riscv32$', a): return 'riscv32' + elif re.match('riscv64$', a): return 'riscv64' elif re.match('p(pc|owerpc)(|64)', a): return 'PowerPC' - elif re.match('loongarch64$', a): return 'LoongArch' + elif re.match('loongarch64$', a): return 'loongarch64' else: bb.fatal("Unhandled architecture %s" % arch_val) return "" diff --git a/meta/recipes-devtools/rust/files/0001-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch b/meta/recipes-devtools/rust/files/0001-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch deleted file mode 100644 index a704671fb9..0000000000 --- a/meta/recipes-devtools/rust/files/0001-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch +++ /dev/null @@ -1,66 +0,0 @@ -From e4f4094de8ddcbe6d5ff1cdf782d2b89e0563903 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 30 Apr 2025 19:51:19 -0700 -Subject: [PATCH] libunwind: Use +gcs instead of gcs target attribute - -__attribute__((target("gcs"))) does not work with gcc - -GCC-15 has added gcs intrinsics [1] but the syntax for enabling it is -slightly different. This syntax works with clang too. - -With gcc15 compiler libunwind's check for this macros is succeeding and it -ends up enabling 'gcs' by using function attribute, this works with clang -but not with gcc but '+gcs' works with both - -We can see this in rust compiler bootstrap for aarch64/musl when system -uses gcc15, it ends up with these errors - -Building libunwind.a for aarch64-poky-linux-musl -cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:191:1: error: arch extension 'gcs' should be prefixed by '+' -cargo:warning= 191 | unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) { -cargo:warning= | ^~~~~~~~~~~~~ -cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:337:22: error: arch extension 'gcs' should be prefixed by '+' -cargo:warning= 337 | _Unwind_Stop_Fn stop, void *stop_parameter) { -cargo:warning= | ^~~~~~~~~~~~~~~ - -[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5a6af707f0af - -Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/138077] - -Signed-off-by: Khem Raj ---- - src/llvm-project/libunwind/src/UnwindLevel1.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/src/llvm-project/libunwind/src/UnwindLevel1.c -+++ b/src/llvm-project/libunwind/src/UnwindLevel1.c -@@ -185,7 +185,7 @@ extern int __unw_step_stage2(unw_cursor_ - - #if defined(_LIBUNWIND_USE_GCS) - // Enable the GCS target feature to permit gcspop instructions to be used. --__attribute__((target("gcs"))) -+__attribute__((target("+gcs"))) - #endif - static _Unwind_Reason_Code - unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) { -@@ -329,7 +329,7 @@ unwind_phase2(unw_context_t *uc, unw_cur - - #if defined(_LIBUNWIND_USE_GCS) - // Enable the GCS target feature to permit gcspop instructions to be used. --__attribute__((target("gcs"))) -+__attribute__((target("+gcs"))) - #endif - static _Unwind_Reason_Code - unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor, ---- a/src/llvm-project/libunwind/src/cet_unwind.h -+++ b/src/llvm-project/libunwind/src/cet_unwind.h -@@ -42,7 +42,8 @@ - #include - - // We can only use GCS if arm_acle.h defines the GCS intrinsics. --#ifdef _CHKFEAT_GCS -+// Enable gcs with clang for now, gcc does not build unwindlevel1.c correctly -+#if defined(_CHKFEAT_GCS) && defined(__clang__) - #define _LIBUNWIND_USE_GCS 1 - #endif - diff --git a/meta/recipes-devtools/rust/rust-llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch b/meta/recipes-devtools/rust/rust-llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch deleted file mode 100644 index 48af6fc283..0000000000 --- a/meta/recipes-devtools/rust/rust-llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 86940d87026432683fb6741cd8a34d3b9b18e40d Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Fri, 27 Nov 2020 10:11:08 +0000 -Subject: [PATCH] AsmMatcherEmitter: sort ClassInfo lists by name as well - -Otherwise, there are instances which are identical in -every other field and therefore sort non-reproducibly -(which breaks binary and source reproducibiliy). - -Upstream-Status: Submitted [https://reviews.llvm.org/D97477] -Signed-off-by: Alexander Kanavin ---- - llvm/utils/TableGen/AsmMatcherEmitter.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp -index ccf0959389b..1f801e83b7d 100644 ---- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp -+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp -@@ -359,7 +359,10 @@ public: - // name of a class shouldn't be significant. However, some of the backends - // accidentally rely on this behaviour, so it will have to stay like this - // until they are fixed. -- return ValueName < RHS.ValueName; -+ if (ValueName != RHS.ValueName) -+ return ValueName < RHS.ValueName; -+ // All else being equal, we should sort by name, for source and binary reproducibility -+ return Name < RHS.Name; - } - }; - diff --git a/meta/recipes-devtools/rust/rust-llvm/0002-llvm-allow-env-override-of-exe-path.patch b/meta/recipes-devtools/rust/rust-llvm/0002-llvm-allow-env-override-of-exe-path.patch deleted file mode 100644 index 9be26677a9..0000000000 --- a/meta/recipes-devtools/rust/rust-llvm/0002-llvm-allow-env-override-of-exe-path.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 7111770e8290082530d920e120995bf81431b0aa Mon Sep 17 00:00:00 2001 -From: Martin Kelly -Date: Fri, 19 May 2017 00:22:57 -0700 -Subject: [PATCH 12/18] llvm: allow env override of exe path - -When using a native llvm-config from inside a sysroot, we need llvm-config to -return the libraries, include directories, etc. from inside the sysroot rather -than from the native sysroot. Thus provide an env override for calling -llvm-config from a target sysroot. - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Martin Kelly -Signed-off-by: Khem Raj ---- - llvm/tools/llvm-config/llvm-config.cpp | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/llvm/tools/llvm-config/llvm-config.cpp -+++ b/llvm/tools/llvm-config/llvm-config.cpp -@@ -226,6 +226,13 @@ Typical components:\n\ - - /// Compute the path to the main executable. - std::string GetExecutablePath(const char *Argv0) { -+ // Hack for Yocto: we need to override the root path when we are using -+ // llvm-config from within a target sysroot. -+ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); -+ if (Sysroot != nullptr) { -+ return Sysroot; -+ } -+ - // This just needs to be some symbol in the binary; C++ doesn't - // allow taking the address of ::main however. - void *P = (void *)(intptr_t)GetExecutablePath; diff --git a/meta/recipes-devtools/rust/rust-llvm_1.90.0.bb b/meta/recipes-devtools/rust/rust-llvm_1.90.0.bb deleted file mode 100644 index 42d4031da1..0000000000 --- a/meta/recipes-devtools/rust/rust-llvm_1.90.0.bb +++ /dev/null @@ -1,98 +0,0 @@ -SUMMARY = "LLVM compiler framework (packaged with rust)" -LICENSE ?= "Apache-2.0-with-LLVM-exception" -HOMEPAGE = "http://www.rust-lang.org" - -# check src/llvm-project/llvm/CMakeLists.txt for llvm version in use -# -LLVM_RELEASE = "20.1.8" - -require rust-source.inc - -SRC_URI += "file://0002-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \ - file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch;striplevel=2 \ - " - -S = "${RUSTSRC}/src/llvm-project/llvm" - -LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8a15a0759ef07f2682d2ba4b893c9afe" - -inherit cmake - -DEPENDS += "ninja-native rust-llvm-native" - -ARM_INSTRUCTION_SET:armv5 = "arm" -ARM_INSTRUCTION_SET:armv4t = "arm" - -# rustc_llvm with debug info is not recognized as a valid crate that's -# generated by rust-llvm-native. -CFLAGS:remove = "-g" -CXXFLAGS:remove = "-g" - -LLVM_DIR = "llvm${LLVM_RELEASE}" - -RUST_LLVM_TARGETS ?= "ARM;AArch64;Mips;PowerPC;RISCV;X86" - -EXTRA_OECMAKE = " \ - -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_TARGETS_TO_BUILD='${RUST_LLVM_TARGETS}' \ - -DLLVM_BUILD_DOCS=OFF \ - -DLLVM_ENABLE_TERMINFO=OFF \ - -DLLVM_ENABLE_ZLIB=OFF \ - -DLLVM_ENABLE_ZSTD=OFF \ - -DLLVM_ENABLE_LIBXML2=OFF \ - -DLLVM_ENABLE_FFI=OFF \ - -DLLVM_ENABLE_LIBEDIT=OFF \ - -DLLVM_INSTALL_UTILS=ON \ - -DLLVM_BUILD_EXAMPLES=OFF \ - -DLLVM_BUILD_LLVM_DYLIB=ON \ - -DLLVM_LINK_LLVM_DYLIB=ON \ - -DLLVM_INCLUDE_EXAMPLES=OFF \ - -DLLVM_BUILD_TESTS=OFF \ - -DLLVM_INCLUDE_TESTS=OFF \ - -DLLVM_INCLUDE_BENCHMARKS=OFF \ - -DLLVM_TARGET_ARCH=${TARGET_ARCH} \ - -DCMAKE_INSTALL_PREFIX:PATH=${libdir}/llvm-rust \ -" - -# Forcibly disable the detection of these packages as otherwise -# it will look at the host Python install -EXTRA_OECMAKE += "\ - -DPY_PYGMENTS_FOUND=OFF \ - -DPY_PYGMENTS_LEXERS_C_CPP_FOUND=OFF \ - -DPY_YAML_FOUND=OFF \ -" - -EXTRA_OECMAKE:append:class-target = "\ - -DLLVM_BUILD_TOOLS=OFF \ - -DLLVM_TABLEGEN=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-tblgen \ - -DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \ -" - -EXTRA_OECMAKE:append:class-nativesdk = "\ - -DLLVM_BUILD_TOOLS=OFF \ - -DLLVM_TABLEGEN=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-tblgen \ - -DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \ -" - -# The debug symbols are huge here (>2GB) so suppress them since they -# provide almost no value. If you really need them then override this -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" - -export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config" - -do_install:append () { - # we don't need any of this stuff to build Rust - rm -rf "${D}/usr/lib/cmake" -} - -PACKAGES =+ "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-liblto" - -# Add the extra locations to avoid the complaints about unpackaged files -FILES:${PN}-bugpointpasses = "${libdir}/llvm-rust/lib/BugpointPasses.so" -FILES:${PN}-llvmhello = "${libdir}/llvm-rust/lib/LLVMHello.so" -FILES:${PN}-liblto = "${libdir}/llvm-rust/lib/libLTO.so.*" -FILES:${PN}-staticdev =+ "${libdir}/llvm-rust/*/*.a" -FILES:${PN} += "${libdir}/libLLVM*.so.* ${libdir}/llvm-rust/lib/*.so.* ${libdir}/llvm-rust/bin" -FILES:${PN}-dev += "${datadir}/llvm ${libdir}/llvm-rust/lib/*.so ${libdir}/llvm-rust/include ${libdir}/llvm-rust/share ${libdir}/llvm-rust/lib/cmake" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc index cf8274b443..ac814c67b6 100644 --- a/meta/recipes-devtools/rust/rust-source.inc +++ b/meta/recipes-devtools/rust/rust-source.inc @@ -7,7 +7,6 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n file://oeqa-selftest-Increase-timeout-in-process-sigpipe-ru.patch;patchdir=${RUSTSRC} \ file://0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch;patchdir=${RUSTSRC} \ file://revert-link-std-statically-in-rustc_driver-feature.patch;patchdir=${RUSTSRC} \ - file://0001-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch;patchdir=${RUSTSRC} \ file://0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch;patchdir=${RUSTSRC} \ " SRC_URI[rust.sha256sum] = "6bfeaddd90ffda2f063492b092bfed925c4b8c701579baf4b1316e021470daac" diff --git a/meta/recipes-devtools/rust/rust_1.90.0.bb b/meta/recipes-devtools/rust/rust_1.90.0.bb index 5d804c7398..c2cb8f8829 100644 --- a/meta/recipes-devtools/rust/rust_1.90.0.bb +++ b/meta/recipes-devtools/rust/rust_1.90.0.bb @@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=11a3899825f4376896e438c8c753f8dc" inherit rust inherit cargo_common -DEPENDS += "rust-llvm" +DEPENDS += "ninja-native clang" # native rust uses cargo/rustc from binary snapshots to bootstrap # but everything else should use our native builds DEPENDS:append:class-target = " cargo-native rust-native" @@ -28,8 +28,8 @@ PV .= "${@bb.utils.contains('RUST_CHANNEL', 'stable', '', '-${RUST_CHANNEL}', d) export FORCE_CRATE_HASH = "${BB_TASKHASH}" -RUST_ALTERNATE_EXE_PATH ?= "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config" -RUST_ALTERNATE_EXE_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config" +RUST_ALTERNATE_EXE_PATH ?= "${STAGING_BINDIR}/llvm-config" +RUST_ALTERNATE_EXE_PATH_NATIVE = "${STAGING_BINDIR_NATIVE}/llvm-config" # We don't want to use bitbakes vendoring because the rust sources do their # own vendoring. @@ -188,6 +188,16 @@ python do_configure() { bb.build.exec_func("setup_cargo_environment", d) } +#llvm-config expecting static libraries in 'lib' instead of 'lib64'. +#Since LLVM is built as a non-multilib component, the 'lib' directory +#doesn't have any library files when multilibs enabled. So, copying +#library files without impacting multilib behavior. +do_compile:append:class-target() { +if [ -d ${STAGING_DIR_TARGET}/usr/lib64 ]; then + cp ${STAGING_DIR_TARGET}/usr/lib64/libLLVM*.a ${STAGING_DIR_TARGET}/usr/lib/. +fi +} + rust_runx () { echo "COMPILE ${PN}" "$@" @@ -199,7 +209,7 @@ rust_runx () { unset CXXFLAGS unset CPPFLAGS - export RUSTFLAGS="${RUST_DEBUG_REMAP}" + export RUSTFLAGS="${RUST_DEBUG_REMAP} -Clink-arg=-lz -Clink-arg=-lzstd" # Copy the natively built llvm-config into the target so we can run it. Horrible, # but works!