From patchwork Tue Oct 6 12:35:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Valkov X-Patchwork-Id: 1377402 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=abv.bg Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=nma+WM8l; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=abv.bg header.i=@abv.bg header.a=rsa-sha256 header.s=smtp-out header.b=JwNQhNC4; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C5H7y6ZBlz9sTf for ; Tue, 6 Oct 2020 23:38:37 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:To:Message-Id:Subject:Date:Mime-Version:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=H5cp5VvqyoQz/+IBpZ4HKNpxi2ZjYowwEdW9vegF250=; b=nma+WM8lnVdLqxQsvC8gTcdFOT YDNCAq8zkI4JCaJf44gWs1n+lY+26tI0UQBFLORm/fJ2755tbmlIXqrqZ+rzMniy5luRTJywq31Kq lom6pQLaRbxUbsURAZlhkrM43BGJQnAw5MLUsbI8BrgBtZnHZkvnVym0pfkPjcnEEfGNhPYSjkf/I Q57yjjii1IIOnLY+TQCna969wQAJWjsJ8X1F21AHVGEDlSw51CT21Pu0qO4fqnbIOqAoxwtlQWwDW FngOZj1l9hpt2r5ife/2mTC50by1bDDQf1Tn3V8MU42PSX3zf82kelsXe/lr7OaIa2GX9VwhE+YJF U4HI9Dpw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPmCP-0002Tx-HY; Tue, 06 Oct 2020 12:36:09 +0000 Received: from pop31.abv.bg ([194.153.145.221]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPmCJ-0002SQ-AG for openwrt-devel@lists.openwrt.org; Tue, 06 Oct 2020 12:36:07 +0000 Received: from smtp.abv.bg (localhost [127.0.0.1]) by pop31.abv.bg (Postfix) with ESMTP id 4AF8418052D9; Tue, 6 Oct 2020 15:35:53 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=abv.bg; s=smtp-out; t=1601987753; bh=MvfMFpph/oplqxkmUVQrAq7ujlcIXmhiNg1hat/vZEY=; h=From:Date:Subject:To:From; b=JwNQhNC4kaYGZDzTdsoBykw+ZAQzAp6lDSd/FPK4C78GOaa7hXRnpIai9g74E1N6u DIZE2Jdjk9snfbI/MINJef1EeHQnzrxaq38YtWU7rRO/CwFWIf6PQ31K8hdrrFAyvM Deh06lXStYxnSKHWBEz9nTPpUHgqkRd8YcLSWp74= X-HELO: [192.168.192.3] Authentication-Results: smtp.abv.bg; auth=pass (plain) smtp.auth=gvalkov@abv.bg Received: from Unknown (HELO [192.168.192.3]) (87.118.177.198) by smtp.abv.bg (qpsmtpd/0.96) with ESMTPSA (ECDHE-RSA-AES256-GCM-SHA384 encrypted); Tue, 06 Oct 2020 15:35:53 +0300 From: Georgi Valkov Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Date: Tue, 6 Oct 2020 15:35:50 +0300 Subject: bc fakeroot libelf gdb: corrected build errors with clang 12 on macOS Message-Id: <786C685F-DFB5-4C39-80A6-DC76A94CBBEB@abv.bg> To: openwrt-devel@lists.openwrt.org X-Mailer: Apple Mail (2.3608.120.23.2.4) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201006_083603_723682_ED6BC335 X-CRM114-Status: GOOD ( 20.55 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gvalkov[at]abv.bg] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Corrected build errors for bc fakeroot libelf gdb, with clang 12 on macOS. Hello Mars Lin! Thank you for fixing bc! Your patch helped me understand how ./configure works and implement fixes for fakeroot, libelf, and gdb. The complete patch is at the end of this letter. I tested a fresh build on macOS Catalina Xcode 12, and also on Ubuntu 20. Pull request https://github.com/openwrt/openwrt/pull/3493 From 031832bc8abe153a29921e9b2eb37ba01b672273 Mon Sep 17 00:00:00 2001 From: Georgi Valkov Date: Tue, 6 Oct 2020 11:36:52 +0300 Subject: [PATCH] bc, fakeroot, libelf, gdb: corrected build errors with clang 12 on macOS Signed-off-by: Georgi Valkov --- toolchain/gdb/patches/130-conf_darwin.patch | 59 ++++++++++++++++++++ tools/bc/patches/002-conf_darwin.patch | 14 +++++ tools/fakeroot/patches/101-conf_darwin.patch | 12 ++++ tools/libelf/patches/901-conf_darwin.patch | 56 +++++++++++++++++++ 4 files changed, 141 insertions(+) create mode 100644 toolchain/gdb/patches/130-conf_darwin.patch create mode 100644 tools/bc/patches/002-conf_darwin.patch create mode 100644 tools/fakeroot/patches/101-conf_darwin.patch create mode 100644 tools/libelf/patches/901-conf_darwin.patch diff --git a/toolchain/gdb/patches/130-conf_darwin.patch b/toolchain/gdb/patches/130-conf_darwin.patch new file mode 100644 index 0000000000..483e18ae4a --- /dev/null +++ b/toolchain/gdb/patches/130-conf_darwin.patch @@ -0,0 +1,59 @@ +Index: gdb-8.3.1/readline/rltty.c +=================================================================== +--- gdb-8.3.1.orig/readline/rltty.c ++++ gdb-8.3.1/readline/rltty.c +@@ -37,9 +37,9 @@ + + #include "rldefs.h" + +-#if defined (GWINSZ_IN_SYS_IOCTL) ++#if defined (HAVE_SYS_IOCTL_H) + # include +-#endif /* GWINSZ_IN_SYS_IOCTL */ ++#endif /* HAVE_SYS_IOCTL_H */ + + #include "rltty.h" + #include "readline.h" +Index: gdb-8.3.1/readline/terminal.c +=================================================================== +--- gdb-8.3.1.orig/readline/terminal.c ++++ gdb-8.3.1/readline/terminal.c +@@ -51,9 +51,9 @@ + /* System-specific feature definitions and include files. */ + #include "rldefs.h" + +-#if defined (GWINSZ_IN_SYS_IOCTL) && !defined (TIOCGWINSZ) ++#if defined (HAVE_SYS_IOCTL_H) + # include +-#endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */ ++#endif /* HAVE_SYS_IOCTL_H */ + + #ifdef __MSDOS__ + # include +Index: gdb-8.3.1/readline/config.h.in +=================================================================== +--- gdb-8.3.1.orig/readline/config.h.in ++++ gdb-8.3.1/readline/config.h.in +@@ -142,6 +142,9 @@ + /* Define if you have the header file. */ + #undef HAVE_FCNTL_H + ++/* Define if you have the header file. */ ++#undef HAVE_SYS_IOCTL_H ++ + /* Define if you have the header file. */ + #undef HAVE_LANGINFO_H + +Index: gdb-8.3.1/readline/configure +=================================================================== +--- gdb-8.3.1.orig/readline/configure ++++ gdb-8.3.1/readline/configure +@@ -4580,7 +4580,7 @@ $as_echo "#define HAVE_STRCOLL 1" >>conf + fi + + +-for ac_header in fcntl.h unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \ ++for ac_header in fcntl.h sys/ioctl.h unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \ + limits.h locale.h pwd.h memory.h termcap.h termios.h termio.h + do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` diff --git a/tools/bc/patches/002-conf_darwin.patch b/tools/bc/patches/002-conf_darwin.patch new file mode 100644 index 0000000000..47b81d4b82 --- /dev/null +++ b/tools/bc/patches/002-conf_darwin.patch @@ -0,0 +1,14 @@ +Index: bc-1.06.95/configure +=================================================================== +--- bc-1.06.95.orig/configure ++++ bc-1.06.95/configure +@@ -288,6 +288,9 @@ ac_includes_default="\ + # if HAVE_STDLIB_H + # include + # endif ++# if HAVE_STDDEF_H ++# include ++# endif + #endif + #if HAVE_STRING_H + # if !STDC_HEADERS && HAVE_MEMORY_H diff --git a/tools/fakeroot/patches/101-conf_darwin.patch b/tools/fakeroot/patches/101-conf_darwin.patch new file mode 100644 index 0000000000..5bb158bc90 --- /dev/null +++ b/tools/fakeroot/patches/101-conf_darwin.patch @@ -0,0 +1,12 @@ +Index: fakeroot-1.24/configure +=================================================================== +--- fakeroot-1.24.orig/configure ++++ fakeroot-1.24/configure +@@ -12847,6 +12847,7 @@ for first in size_t int; do + #include + #endif + #include ++#include + #ifdef HAVE_GRP_H + #include + #endif diff --git a/tools/libelf/patches/901-conf_darwin.patch b/tools/libelf/patches/901-conf_darwin.patch new file mode 100644 index 0000000000..0e0d8d0ec7 --- /dev/null +++ b/tools/libelf/patches/901-conf_darwin.patch @@ -0,0 +1,56 @@ +Index: libelf-0.8.13/config.h.in +=================================================================== +--- libelf-0.8.13.orig/config.h.in ++++ libelf-0.8.13/config.h.in +@@ -141,6 +141,9 @@ + /* Define if you have the header file. */ + #undef HAVE_STDINT_H + ++/* Define if you have the header file. */ ++#undef HAVE_STDLIB_H ++ + /* Define if you have the header file. */ + #undef HAVE_SYS_ELF_H + +Index: libelf-0.8.13/configure +=================================================================== +--- libelf-0.8.13.orig/configure ++++ libelf-0.8.13/configure +@@ -1146,7 +1146,7 @@ EOF + + fi + +-for ac_hdr in unistd.h stdint.h fcntl.h ++for ac_hdr in unistd.h stdint.h stdlib.h fcntl.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +@@ -1186,6 +1186,13 @@ else + fi + done + ++cat >> confdefs.h < ++#endif ++EOF ++ + for ac_hdr in elf.h sys/elf.h link.h sys/link.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +Index: libelf-0.8.13/lib/private.h +=================================================================== +--- libelf-0.8.13.orig/lib/private.h ++++ libelf-0.8.13/lib/private.h +@@ -37,6 +37,10 @@ + #endif + #include + ++#ifdef HAVE_STDLIB_H ++#include ++#endif ++ + #if STDC_HEADERS + # include + # include