From patchwork Fri Aug 7 08:17:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Fischer X-Patchwork-Id: 1342137 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=go-sys.de Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BNJBZ5jC1z9sTN for ; Fri, 7 Aug 2020 18:17:42 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7AA0D886C0; Fri, 7 Aug 2020 08:17:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hd-SVSw6ZWHa; Fri, 7 Aug 2020 08:17:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 652BE88686; Fri, 7 Aug 2020 08:17:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 664121BF3A7 for ; Fri, 7 Aug 2020 08:17:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 62A7788637 for ; Fri, 7 Aug 2020 08:17:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QMZLNkmmCn9R for ; Fri, 7 Aug 2020 08:17:33 +0000 (UTC) X-Greylist: delayed 20:54:27 by SQLgrey-1.7.6 Received: from smtprelay05.ispgateway.de (smtprelay05.ispgateway.de [80.67.31.97]) by whitealder.osuosl.org (Postfix) with ESMTPS id 507C58862F for ; Fri, 7 Aug 2020 08:17:33 +0000 (UTC) Received: from [84.146.213.176] (helo=exchange.go-sys.de) by smtprelay05.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1k3xZB-0007C8-JD for buildroot@busybox.net; Fri, 07 Aug 2020 10:17:29 +0200 Received: from exchange.go-sys.local (192.168.1.17) by exchange.go-sys.local (192.168.1.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1531.3; Fri, 7 Aug 2020 10:17:29 +0200 Received: from go-sys.de (192.168.1.152) by exchange.go-sys.de (192.168.1.17) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Fri, 7 Aug 2020 10:17:29 +0200 From: Michael Fischer To: Date: Fri, 7 Aug 2020 10:17:27 +0200 Message-ID: <20200807081727.17947-1-mf@go-sys.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-C2ProcessedOrg: 77b28032-c882-4527-ad15-de6c89cb71cd X-CrossPremisesHeadersFilteredBySendConnector: exchange.go-sys.local X-OrganizationHeadersPreserved: exchange.go-sys.local X-Df-Sender: c21hcnRob3N0QGdvLXN5cy5kZQ== Subject: [Buildroot] [PATCH 1/1] package/python-rpi-gpio: fix build with gcc 10.x X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Fischer Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Michael Fischer --- ...hon-rpi-gpio-fix-build-with-gcc-10.x.patch | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 package/python-rpi-gpio/0001-package-python-rpi-gpio-fix-build-with-gcc-10.x.patch diff --git a/package/python-rpi-gpio/0001-package-python-rpi-gpio-fix-build-with-gcc-10.x.patch b/package/python-rpi-gpio/0001-package-python-rpi-gpio-fix-build-with-gcc-10.x.patch new file mode 100644 index 0000000000..961b8b398a --- /dev/null +++ b/package/python-rpi-gpio/0001-package-python-rpi-gpio-fix-build-with-gcc-10.x.patch @@ -0,0 +1,113 @@ +diff -Naur a/source/common.h b/source/common.h +--- a/source/common.h 2019-07-21 14:41:22.000000000 +0200 ++++ b/source/common.h 2020-08-07 09:31:33.948575964 +0200 +@@ -30,14 +30,14 @@ + #define I2C 42 + #define PWM 43 + +-int gpio_mode; +-const int pin_to_gpio_rev1[41]; +-const int pin_to_gpio_rev2[41]; +-const int pin_to_gpio_rev3[41]; +-const int (*pin_to_gpio)[41]; +-int gpio_direction[54]; +-rpi_info rpiinfo; +-int setup_error; +-int module_setup; ++extern int gpio_mode; ++extern const int pin_to_gpio_rev1[41]; ++extern const int pin_to_gpio_rev2[41]; ++extern const int pin_to_gpio_rev3[41]; ++extern const int (*pin_to_gpio)[41]; ++extern int gpio_direction[54]; ++extern rpi_info rpiinfo; ++extern int setup_error; ++extern int module_setup; + int check_gpio_priv(void); + int get_gpio_number(int channel, unsigned int *gpio); +diff -Naur a/source/constants.h b/source/constants.h +--- a/source/constants.h 2019-07-21 14:41:22.000000000 +0200 ++++ b/source/constants.h 2020-08-07 09:32:15.522196618 +0200 +@@ -23,22 +23,22 @@ + #define PY_PUD_CONST_OFFSET 20 + #define PY_EVENT_CONST_OFFSET 30 + +-PyObject *high; +-PyObject *low; +-PyObject *input; +-PyObject *output; +-PyObject *pwm; +-PyObject *serial; +-PyObject *i2c; +-PyObject *spi; +-PyObject *unknown; +-PyObject *board; +-PyObject *bcm; +-PyObject *pud_off; +-PyObject *pud_up; +-PyObject *pud_down; +-PyObject *rising_edge; +-PyObject *falling_edge; +-PyObject *both_edge; ++extern PyObject *high; ++extern PyObject *low; ++extern PyObject *input; ++extern PyObject *output; ++extern PyObject *pwm; ++extern PyObject *serial; ++extern PyObject *i2c; ++extern PyObject *spi; ++extern PyObject *unknown; ++extern PyObject *board; ++extern PyObject *bcm; ++extern PyObject *pud_off; ++extern PyObject *pud_up; ++extern PyObject *pud_down; ++extern PyObject *rising_edge; ++extern PyObject *falling_edge; ++extern PyObject *both_edge; + + void define_constants(PyObject *module); +diff -Naur a/source/event_gpio.c b/source/event_gpio.c +--- a/source/event_gpio.c 2019-07-21 14:41:22.000000000 +0200 ++++ b/source/event_gpio.c 2020-08-07 09:42:05.564483136 +0200 +@@ -57,7 +57,7 @@ + }; + struct callback *callbacks = NULL; + +-pthread_t threads; ++static pthread_t threads; + int event_occurred[54] = { 0 }; + int thread_running = 0; + int epfd_thread = -1; +diff -Naur a/source/py_pwm.h b/source/py_pwm.h +--- a/source/py_pwm.h 2019-07-21 14:41:22.000000000 +0200 ++++ b/source/py_pwm.h 2020-08-07 09:38:49.445646807 +0200 +@@ -20,5 +20,5 @@ + SOFTWARE. + */ + +-PyTypeObject PWMType; ++extern PyTypeObject PWMType; + PyTypeObject *PWM_init_PWMType(void); +diff -Naur a/source/soft_pwm.c b/source/soft_pwm.c +--- a/source/soft_pwm.c 2019-07-21 14:41:22.000000000 +0200 ++++ b/source/soft_pwm.c 2020-08-07 09:42:40.753160437 +0200 +@@ -25,7 +25,7 @@ + #include + #include "c_gpio.h" + #include "soft_pwm.h" +-pthread_t threads; ++static pthread_t threads; + + struct pwm + { +diff -Naur a/source/soft_pwm.h b/source/soft_pwm.h +--- a/source/soft_pwm.h 2019-07-21 14:41:22.000000000 +0200 ++++ b/source/soft_pwm.h 2020-08-07 09:39:25.916811352 +0200 +@@ -26,4 +26,4 @@ + void pwm_set_frequency(unsigned int gpio, float freq); + void pwm_start(unsigned int gpio); + void pwm_stop(unsigned int gpio); +-int pwm_exists(unsigned int gpio); ++extern int pwm_exists(unsigned int gpio);