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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA4FAC433FE for ; Tue, 29 Nov 2022 22:25:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 377D960B2B; Tue, 29 Nov 2022 22:25:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 377D960B2B X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oDADNLXKycUe; Tue, 29 Nov 2022 22:25:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 1B86D60BE0; Tue, 29 Nov 2022 22:25:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 1B86D60BE0 Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 4B8011BF5AD for ; Tue, 29 Nov 2022 22:25:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 2542D41675 for ; Tue, 29 Nov 2022 22:25:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 2542D41675 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id asD8yxBdpuQJ for ; Tue, 29 Nov 2022 22:25:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 579AA415FA Received: from smtpcmd01-sp1.aruba.it (smtpcmd01-sp1.aruba.it [62.149.158.218]) by smtp4.osuosl.org (Postfix) with ESMTPS id 579AA415FA for ; Tue, 29 Nov 2022 22:25:35 +0000 (UTC) Received: from smtpclient.apple ([146.241.87.80]) by Aruba Outgoing Smtp with ESMTPA id 092hpjl0WcXav092ipHQtl; Tue, 29 Nov 2022 23:25:32 +0100 From: Giulio Benetti Mime-Version: 1.0 (1.0) Date: Tue, 29 Nov 2022 23:25:29 +0100 Message-Id: <0D32AFEE-0712-48AE-A855-3FFC249371DD@benettiengineering.com> References: In-Reply-To: To: Arnout Vandecappelle X-Mailer: iPhone Mail (20B101) X-CMAE-Envelope: MS4xfM41+dbbIYmAkElkEjx+IiTKqzYpA+bz7+N5XFhIfykoUFsQEzmVO9TA0TZ5yYc5j50D0MhV+DLiznw9yTDaayqXYsn5jdKUKBkbYHDY2GPeQG7baAb1 h4D+rUl7MkR02oJBX+DtxPoHlmZCyU3SSxhPHcSj+6SybcKdz3BJlOoJsMN24Hf1uJ9j01a1WZO/DMiojVnK510jPlQJE0sgkvwukRp4ZlPhpuPekmx3qlqL mJx4nwuj0OOIPUxU2HmwAa5y++YXb8p/gGQr2AmtlbrUGEGiZjnHrZSRi5uPhCpC X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1669760732; bh=1p4j1DrUQmPyz35dzvW1IwvT5R3eEJpRv4G1Q7/ScPE=; h=Content-Type:From:Mime-Version:Subject:Date:To; b=aQ9Qi/eonfrlaoiBnAbxM2IYU65RKzOD5tgRJUUruQaegpB9P8HwjHI5056EeQwNk OBcJTbnvAqCQ96mU4bg1mF+8WR6CwWaglTsSfYnUsD/iSsb2gAXdpFUcTgEQyDiyf+ 7eV1tULm/Wzfi+1/yk2bkG3XJ+3X0Ty//7RitS6CzUEWuD96DYMU6JrKLB2F5PIwzO reUpkCcPFxAcRJh3Kov8oI/QsZdkAWzDxdELb/AZKkDSztuIhWh9PIeBJ40xUDvshR IR2me3QNHZ2vevsS8iDWbQYgUHT7fvXHbv8AibkhX1l0JFO5ZEtNiLG4GXntYHXesQ MflNOBvflqfpw== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=aruba.it header.i=@aruba.it header.a=rsa-sha256 header.s=a1 header.b=aQ9Qi/eo Subject: Re: [Buildroot] [PATCH 2/2] package/rtl8192eu: fix build failure on Big Endian architectures X-BeenThere: buildroot@buildroot.org 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: James Hilliard , buildroot@buildroot.org Content-Type: multipart/mixed; boundary="===============8250391226719741085==" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" --===============8250391226719741085== Content-Type: multipart/alternative; boundary=Apple-Mail-D2C1F9F5-F3EB-41AE-825D-6135BD49EC66 Content-Transfer-Encoding: 7bit --Apple-Mail-D2C1F9F5-F3EB-41AE-825D-6135BD49EC66 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Arnout, > Il giorno 29 nov 2022, alle ore 23:16, Arnout Vandecappelle ha scritto: >=20 > =EF=BB=BF >=20 >> On 29/11/2022 22:08, Giulio Benetti wrote: >> Add local patch that allows to override CONFIG_LITTLE_ENDIAN in case we'r= e >> building for Big Endian architectures. Then let's undefine >> CONFIG_LITTLE_ENDIAN and define endianness according to $(BR2_ENDIAN). >> Fixes: >> http://autobuild.buildroot.net/results/13a/13a809570423ead33628663033db4c= 3c4001a79b/ >> Signed-off-by: Giulio Benetti >> --- >> ...TRA_CFLAGS-USER_EXTRA_CFLAGS-at-the-.patch | 40 +++++++++++++++++++ >> package/rtl8192eu/rtl8192eu.mk | 9 ++++- >> 2 files changed, 48 insertions(+), 1 deletion(-) >> create mode 100644 package/rtl8192eu/0001-Makefile-move-EXTRA_CFLAGS-USE= R_EXTRA_CFLAGS-at-the-.patch >> diff --git a/package/rtl8192eu/0001-Makefile-move-EXTRA_CFLAGS-USER_EXTRA= _CFLAGS-at-the-.patch b/package/rtl8192eu/0001-Makefile-move-EXTRA_CFLAGS-US= ER_EXTRA_CFLAGS-at-the-.patch >> new file mode 100644 >> index 0000000000..2f6ecfb210 >> --- /dev/null >> +++ b/package/rtl8192eu/0001-Makefile-move-EXTRA_CFLAGS-USER_EXTRA_CFLAGS= -at-the-.patch >> @@ -0,0 +1,40 @@ >> +=46rom f51cbcbeafd8d60e9b8f35b7ca62b6c941d72e3b Mon Sep 17 00:00:00 2001= >> +From: Giulio Benetti >> +Date: Wed, 28 Sep 2022 21:17:17 +0200 >> +Subject: [PATCH] Makefile: move 'EXTRA_CFLAGS +=3D $(USER_EXTRA_CFLAGS)'= at the >> + end of EXTRA_FLAGS assignment >> + >> +At the moment USER_EXTRA_CFLAGS can't override local Makfile EXTRA_CFLAG= S >> +since it's assigned at the beginning of the Makefile. For example it's n= ot >> +possible to undefine the hardcoded CONFIG_LITTLE_ENDIAN and this doesn't= >> +allow to build these modules for big endian architectures. So let's move= >> +the assignment of USER_EXTRA_CFLAGS to EXTRA_CFLAGS after the last >> +EXTRA_CFLAGS assignment. >> + >> +[Upstream status: https://github.com/clnhub/rtl8192eu-linux/pull/65] >> +Signed-off-by: Giulio Benetti >> +--- >> + Makefile | 3 ++- >> + 1 file changed, 2 insertions(+), 1 deletion(-) >> + >> +diff --git a/Makefile b/Makefile >> +index 32a1898..b67a5a4 100755 >> +--- a/Makefile >> ++++ b/Makefile >> +@@ -1,4 +1,3 @@ >> +-EXTRA_CFLAGS +=3D $(USER_EXTRA_CFLAGS) >> + EXTRA_CFLAGS +=3D -O1 >> + #EXTRA_CFLAGS +=3D -O3 >> + #EXTRA_CFLAGS +=3D -Wall >> +@@ -2329,6 +2328,8 @@ ifneq ($(USER_MODULE_NAME),) >> + MODULE_NAME :=3D $(USER_MODULE_NAME) >> + endif >> + >> ++EXTRA_CFLAGS +=3D $(USER_EXTRA_CFLAGS) >> ++ >> + ifneq ($(KERNELRELEASE),) >> + >> + ########### this part for *.mk ############################ >> +-- >> +2.34.1 >> + >> diff --git a/package/rtl8192eu/rtl8192eu.mk b/package/rtl8192eu/rtl8192eu= .mk >> index 0e8ffea5cb..589cb7f59e 100644 >> --- a/package/rtl8192eu/rtl8192eu.mk >> +++ b/package/rtl8192eu/rtl8192eu.mk >> @@ -7,9 +7,16 @@ >> RTL8192EU_VERSION =3D 1e15b6d451731bc4d3ffd587194dc4bd0f286ac0 >> RTL8192EU_SITE =3D $(call github,clnhub,rtl8192eu-linux,$(RTL8192EU_VERS= ION)) >> RTL8192EU_LICENSE =3D GPL-2.0 >> + >> +# Undefine the hardcoded CONFIG_LITTLE_ENDIAN >> +RTL8192EU_USER_EXTRA_CLAGS =3D -UCONFIG_LITTLE_ENDIAN >=20 > It is not actually hardcoded. The only thing that is hardcoded is CONFIG_P= LATFORM_I386_PC=3Dy, which triggers the following fragment in the Makefile: >=20 > ifeq ($(CONFIG_PLATFORM_I386_PC), y) > EXTRA_CFLAGS +=3D -DCONFIG_LITTLE_ENDIAN > EXTRA_CFLAGS +=3D -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT >=20 > SUBARCH :=3D $(shell uname -m | sed -e s/i.86/i386/) > ARCH ?=3D $(SUBARCH) > CROSS_COMPILE ?=3D > KVER :=3D $(shell uname -r) > KSRC :=3D /lib/modules/$(KVER)/build > MODDESTDIR :=3D /lib/modules/$(KVER)/kernel/drivers/net/wireless/ > INSTALL_PREFIX :=3D > STAGINGMODDIR :=3D /lib/modules/$(KVER)/kernel/drivers/staging > endif >=20 >=20 > Clearly, all of this is rubbish in Buildroot context. So what we should do= is to set >=20 > RTL8192EU_MODULE_MAKE_OPTS =3D ... CONFIG_PLATFORM_I386_PC=3Dn >=20 > At that point, we can set all the appropriate config options we like, whic= h would be the -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT in USER_= EXTRA_CFLAGS. Yes, this is another approach, but there is only a patch with my proposed so= lution applied [1] so maybe for consistency we could keep it the same, what about it? Thanks for reviewing Giulio [1]: https://github.com/buildroot/buildroot/commit/354f9387f33b5fab023cb98e5= 2d84d58624f0ecf >=20 >=20 > Regards, > Arnout >=20 >> +# Set endianness >> +RTL8192EU_USER_EXTRA_CLAGS +=3D -DCONFIG_$(call qstrip,$(BR2_ENDIAN))_EN= DIAN >> +RTL8192EU_USER_EXTRA_CLAGS +=3D -Wno-error >> + >> RTL8192EU_MODULE_MAKE_OPTS =3D \ >> CONFIG_RTL8192EU=3Dm \ >> - USER_EXTRA_CFLAGS=3D"-Wno-error" >> + USER_EXTRA_CFLAGS=3D"$(RTL8192EU_USER_EXTRA_CLAGS)" >> define RTL8192EU_LINUX_CONFIG_FIXUPS >> $(call KCONFIG_ENABLE_OPT,CONFIG_NET) > _______________________________________________ > buildroot mailing list > buildroot@buildroot.org > https://lists.buildroot.org/mailman/listinfo/buildroot --Apple-Mail-D2C1F9F5-F3EB-41AE-825D-6135BD49EC66 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Arnout,

Il giorno 29 nov 2022, alle ore 23:16, Arnout Vandecappell= e <arnout@mind.be> ha scritto:

=EF=BB=BF

On 29/11/2022 22:08, Giulio Benetti wrote:
Add local patch that allows to override CONFIG_LITTLE_ENDIAN in c= ase we're
building fo= r Big Endian architectures. Then let's undefine
CONFIG_LITTLE_ENDIAN and define endianness accord= ing to $(BR2_ENDIAN).
Fixes:
http://autobu= ild.buildroot.net/results/13a/13a809570423ead33628663033db4c3c4001a79b/
Signed-off-by: Giulio Ben= etti <giulio.benetti@benettiengineering.com>
---
 ...TRA_CFLAGS-USER_EXTRA_CFLAGS-at-the-.patch | 40 +++++= ++++++++++++++
 = ;package/rtl8192eu/rtl8192eu.mk        &n= bsp;       |  9 ++++-
 2 files changed, 48 insertio= ns(+), 1 deletion(-)
=  create mode 100644 package/rtl8192eu/0001-Makefile-move-EXTRA_CFLAGS-= USER_EXTRA_CFLAGS-at-the-.patch
diff --git a/package/rtl8192eu/0001-Makefile-move-EXTRA_CFLAGS-US= ER_EXTRA_CFLAGS-at-the-.patch b/package/rtl8192eu/0001-Makefile-move-EXTRA_C= FLAGS-USER_EXTRA_CFLAGS-at-the-.patch
new file mode 100644
index 0000000000..2f6ecfb210
--- /dev/null
+++ b/package/rtl8192eu/0001-Makefile-move-EXTRA_CFLAGS-US= ER_EXTRA_CFLAGS-at-the-.patch
@@ -0,0 +1,40 @@
<= span>+=46rom f51cbcbeafd8d60e9b8f35b7ca62b6c941d72e3b Mon Sep 17 00:00:00 20= 01
+From: Giulio Bene= tti <giulio.benetti@benettiengineering.com>
+Date: Wed, 28 Sep 2022 21:17:17 +0200
+Subject: [PATCH] Makefile: m= ove 'EXTRA_CFLAGS +=3D $(USER_EXTRA_CFLAGS)' at the
<= blockquote type=3D"cite">+ end of EXTRA_FLAGS assignment
+
+At the moment USER_EXTRA_CFLAGS can't override local= Makfile EXTRA_CFLAGS
+since it's assigned at the beginning of the Makefile. For example it's not=
+possible to undefin= e the hardcoded CONFIG_LITTLE_ENDIAN and this doesn't
+allow to build these modules for big endia= n architectures. So let's move
+the assignment of USER_EXTRA_CFLAGS to EXTRA_CFLAGS after the las= t
+EXTRA_CFLAGS assig= nment.
+
+[Upstream status: https://github= .com/clnhub/rtl8192eu-linux/pull/65]
+Signed-off-by: Giulio Benetti <giulio.benetti@benettieng= ineering.com>
+---=
+ Makefile | 3 ++-
+ 1 file changed, 2 in= sertions(+), 1 deletion(-)
= +
+diff --git a= /Makefile b/Makefile
= +index 32a1898..b67a5a4 100755
+--- a/Makefile
<= span>++++ b/Makefile
= +@@ -1,4 +1,3 @@
+-EX= TRA_CFLAGS +=3D $(USER_EXTRA_CFLAGS)
+ EXTRA_CFLAGS +=3D -O1
+ #EXTRA_CFLAGS +=3D -O3
+ #EXTRA_CFLAGS +=3D -Wall
+@@ -2329,6 +2328,8 @@ ifneq ($(USER_MODULE_NAM= E),)
+ MODULE_NAME :=3D= $(USER_MODULE_NAME)
= + endif
+
<= /blockquote>
++EXTRA_CFLAGS +=3D $(USER_EXTRA= _CFLAGS)
++
+ ifneq ($(KERNELRELEASE),)
+
+ ########### this part for *.mk #########= ###################
+= --
+2.34.1
=
+
diff --git a/package/rtl8192eu/rtl8192eu.mk b/pack= age/rtl8192eu/rtl8192eu.mk
= index 0e8ffea5cb..589cb7f59e 100644
--- a/package/rtl8192eu/rtl8192eu.mk
+++ b/package/rtl8192eu/rtl8192eu.mk
@@ -7,9 +7,16 @@=
 RTL8192EU_VERSION =3D= 1e15b6d451731bc4d3ffd587194dc4bd0f286ac0
 RTL8192EU_SITE =3D $(call github,clnhub,rtl8192e= u-linux,$(RTL8192EU_VERSION))
 RTL8192EU_LICENSE =3D GPL-2.0
+
= +# Undefine the hardcoded CONFIG_LITTLE_ENDIAN
=
+RTL8192EU_USER_EXTRA_CLAGS =3D -UCONFIG_LIT= TLE_ENDIAN

It is not actually= hardcoded. The only thing that is hardcoded is CONFIG_PLATFORM_I386_PC=3Dy,= which triggers the following fragment in the Makefile:

ifeq ($(CONFIG_PLATFORM_I386_PC), y)
EXTRA_CFLA= GS +=3D -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS +=3D -DCONFIG_IO= CTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT

S= UBARCH :=3D $(shell uname -m | sed -e s/i.86/i386/)
ARCH ?=3D= $(SUBARCH)
CROSS_COMPILE ?=3D
KVER  :=3D= $(shell uname -r)
KSRC :=3D /lib/modules/$(KVER)/build
MODDESTDIR :=3D /lib/modules/$(KVER)/kernel/drivers/net/wireless= /
INSTALL_PREFIX :=3D
STAGINGMODDIR :=3D /li= b/modules/$(KVER)/kernel/drivers/staging
endif


Clearly, all of this is rubbish in Buil= droot context. So what we should do is to set

RTL8192EU_MODULE_MAKE_OPTS =3D ... CONFIG_PLATFORM_I386_PC=3Dn

=
At that point, we can set all the appropriate config o= ptions we like, which would be the -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG8021= 1_STA_EVENT in USER_EXTRA_CFLAGS.

Yes, this is another approach, but there is only a patch with my prop= osed solution applied [1]
so maybe for consistency we could keep i= t the same, what about it?

Thanks for reviewing
Giulio


=

Regards,
Arnout

+# Set endianness
+RTL8192EU_USER_EXTRA_CLAGS +=3D -D= CONFIG_$(call qstrip,$(BR2_ENDIAN))_ENDIAN
+RTL8192EU_USER_EXTRA_CLAGS +=3D -Wno-error
=
+
 RTL8192EU_MODULE_MAKE_OPTS =3D \
=
     CONFIG_RTL= 8192EU=3Dm \
-  =  USER_EXTRA_CFLAGS=3D"-Wno-error"
+    USER_EXTRA_CFLAGS=3D"$(RTL8192EU_USER_EXTR= A_CLAGS)"
 &nbs= p; define RTL8192EU_LINUX_CONFIG_FIXUPS
     $(call KCONFIG_ENABLE_OPT,CONFI= G_NET)
________________________________________= _______
buildroot mailing list
buildroot@bui= ldroot.org
https://lists.buildroot.org/mailman/listinfo/buil= droot
= --Apple-Mail-D2C1F9F5-F3EB-41AE-825D-6135BD49EC66-- --===============8250391226719741085== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot --===============8250391226719741085==--