From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1ols9j-0008RH-Kx for mharc-grub-devel@gnu.org; Fri, 21 Oct 2022 09:33:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ols9F-0007vB-9T for grub-devel@gnu.org; Fri, 21 Oct 2022 09:33:17 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ols97-0006X4-Ks for grub-devel@gnu.org; Fri, 21 Oct 2022 09:33:14 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29LD4CC1030772; Fri, 21 Oct 2022 13:33:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2022-7-12; bh=9pahmiTERNYi08ntclV6etyw5ofref5JdZQneU+kl2g=; b=vBtq3erKOh4wj4XFSbdkvJxcEKGOR0NaCzEqtPBiBgNcpdRCfnFWPhDNLWTO6mNQYYXN cdu6eIOj2mjRwYv53yAGtV2knO+cnjyESDnh/tEaofgyBLx0dxpVj35M+Hw/6EOyOJ// Ow5vK5ab1wPVkW/+W9e3VUZJQJiqwmwwZbL9ncVpPCWsGyh/FXiE4rGjaCvtVsdkQM+7 o43exxjz8zUn+5EgjhK3oHZWT9zsfS+D6bcoKQToImOCLwdLGj/PFmUVP1gR3pz4a78Y QsT+jc1Gh/RV/rguOAqnTtbfVgbnSd4puHFqxfUuFAhhwPTjolDp88HcTZQN/EG9T7bO Jw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7mu08fr6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Oct 2022 13:33:04 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29LCSnHv007143; Fri, 21 Oct 2022 13:33:04 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hrdupjb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Oct 2022 13:33:03 +0000 Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 29LDU4Ab028041; Fri, 21 Oct 2022 13:33:03 GMT Received: from darrenk-20210928-1216.osdevelopm1lhr.oraclevcn.com (darrenk-20210928-1216.allregionallhrs.osdevelopm1lhr.oraclevcn.com [100.110.7.94]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3k8hrduph3-1; Fri, 21 Oct 2022 13:33:03 +0000 From: Darren Kenny To: grub-devel@gnu.org Cc: Vladimir 'phcoder' Serbinenko , Robbie Harwood , Glenn Washburn , daniel.kiper@oracle.com, darren.kenny@oracle.com Subject: [PATCH v2 0/3] Fix building with clang Date: Fri, 21 Oct 2022 13:32:58 +0000 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210210081 X-Proofpoint-ORIG-GUID: G7NN57Fi7krZ89YVIHCigfiJphaICMlh X-Proofpoint-GUID: G7NN57Fi7krZ89YVIHCigfiJphaICMlh Received-SPF: pass client-ip=205.220.177.32; envelope-from=darren.kenny@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2022 13:33:19 -0000 The abiltiy to build with clang was broken in the last release after the upgrade of gnulib, but it would also appear to have been broken too with versions of clang prior to 8.0.0. There were two main issues: - The use of __builtin_trap in the abort() macro. This builtin doesn't exist for clang builds After some discussion between Daniel and Vladimir, it was requested that I should revert some past changes in this area, and re-introduce the use of grub_abort(). - The is some use of variable length arrays (vla) in gnulib's code, and when an attempt was made to resolve this in gnulib itself, I was informed that we shouldn't be building gnulib with -Werror. Rather than totally disabling -Werror, it seemed better to just limit it for the specific case that is causing problems, i.e. vla. - Attempts to build clang with versions prior to 8.0.0 are also failing due to the use of the previously introduced safematch function usage. So we're also bumping the minimum version of clang in the INSTALL file and safemath.h where the test is done for the requisite version. Thanks, Darren. v1 -> v2 -------- - Update with changes to INSTALL and safemath.h after testing various clang versions from 3.8 and up. Darren Kenny (3): gnulib: Provide abort() implementation for gnulib configure: Fix building with clang build: Update to reflect minimum clang version 8.0 INSTALL | 2 +- config.h.in | 10 ---------- configure.ac | 4 ++++ grub-core/kern/compiler-rt.c | 9 --------- grub-core/kern/misc.c | 2 +- grub-core/lib/posix_wrap/stdlib.h | 6 ++++++ include/grub/misc.h | 5 +---- include/grub/safemath.h | 6 +++--- 8 files changed, 16 insertions(+), 28 deletions(-) -- 2.31.1