Re: [Madwifi-devel] [PATCH]: add ARCH=x86 workaround in scripts/get_arch.mk

Previous thread: [Madwifi-devel] Unnecessay export? by Pavel Roskin on Wednesday, January 30, 2008 - 5:13 pm. (1 message)

Next thread: [Madwifi-devel] Words in my Heart by jose on Friday, February 1, 2008 - 3:29 am. (1 message)
To: <madwifi-devel@...>
Date: Thursday, January 31, 2008 - 8:34 am

Debian's linux-image-2.6.24 and above will report "x86" as ARCH for i386
and amd64 in linux-2.6.24 packages.

This break madwifi build:

/usr/bin/make -C /usr/src/modules/madwifi modules \
KERNELPATH=/lib/modules/2.6.24-1-686/build KERNELRELEASE=2.6.24-1-686 KERNELCONF=/lib/modules/2.6.24-1-686/build/.config
make[2]: Entering directory `/usr/src/modules/madwifi'
Checking requirements... ok.
Checking kernel configuration... ok.
/usr/bin/make -C /lib/modules/2.6.24-1-686/build SUBDIRS=/usr/src/modules/madwifi modules
make[3]: Entering directory `/usr/src/linux-headers-2.6.24-1-686'
/usr/src/modules/madwifi/scripts/get_arch.mk:44: *** ARCH mismatch: supplied "x86", determined "i386". Stop.
make[3]: *** [_module_/usr/src/modules/madwifi] Error 2
make[3]: Leaving directory `/usr/src/linux-headers-2.6.24-1-686'
make[2]: *** [modules] Error 2
make[2]: Leaving directory `/usr/src/modules/madwifi'
make[1]: *** [binary-modules] Error 2
make[1]: Leaving directory `/usr/src/modules/madwifi'
make: *** [kdist_build] Error 2

For more infomation, see http://bugs.debian.org/463353

Do you think there is better way to address this problem than what is attached
below?

Thanks, Kel.
---
--- a/scripts/get_arch.mk
+++ b/scripts/get_arch.mk
@@ -40,6 +40,14 @@
ifeq (,$(ARCH))
ARCH = $(ARCH-y)
else
+ifeq ($(filter-out x86,$(ARCH)),)
+ifeq (x86_64,$(ARCH-y))
+ARCH = $(ARCH-y)
+endif
+ifeq (i386,$(ARCH-y))
+ARCH = $(ARCH-y)
+endif
+endif
ifneq ($(ARCH),$(ARCH-y))
$(error ARCH mismatch: supplied "$(ARCH)", determined "$(ARCH-y)")
endif
---

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Madwifi-devel mailing list
Madwifi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/madwifi-devel

To: Kel Modderman <kel@...>
Cc: <madwifi-devel@...>
Date: Thursday, January 31, 2008 - 1:56 pm

I'm not sure what it means in practical terms. I understand Debian
wants to override ARCH. Anyway, cross-compiling on a non-x86 platform
for an x86 platform would need ARCH, and it has to be x86 for Linux

Why this complexity? How about this:
ifeq (x86,$(ARCH-y))

I don't feel good about overriding ARCH. That can break things in the
kernel build system. Even if it works now, I'd rather avoid it. Also,
it starts an "override war". If ARCH is specified on the command line,
it would override ARCH set in get_arch.mk. Let's keep the approach
"accept or bail out".

Perhaps it wasn't a good idea to deal with ARCH in MadWifi, but I
understand that we cannot make big changes before 0.9.4 release.

I suggest that MadWifi accepts "x86" rather than tries to override it.
That needs some extra logic on the TARGET side. Here's an alternative
patch.

Index: scripts/get_arch.mk
===================================================================
--- scripts/get_arch.mk (revision 3316)
+++ scripts/get_arch.mk (working copy)
@@ -36,6 +36,13 @@
$(Cannot determine ARCH)
endif

+# Allow ARCH to be x86
+ifneq (,$(CONFIG_X86))
+ifeq (x86,$(ARCH))
+ARCH-y = $(ARCH)
+endif
+endif
+
# Don't allow ARCH to be overridden by a different value.
ifeq (,$(ARCH))
ARCH = $(ARCH-y)
Index: ath_hal/ah_target.inc
===================================================================
--- ath_hal/ah_target.inc (revision 3316)
+++ ath_hal/ah_target.inc (working copy)
@@ -25,6 +25,8 @@

# Determine the target (i.e. which HAL to use).
# The default is $(ARCH)-elf
+TARGET-$(CONFIG_X86) = i386-elf
+TARGET-$(CONFIG_X86_64) = x86_64-elf
TARGET-$(CONFIG_CPU_32v4) = armv4-$(ENDIAN)-elf
TARGET-$(CONFIG_CPU_MIPS32_R1) = mips1-$(ENDIAN)-elf
TARGET-$(CONFIG_CPU_MIPS32_R2) = mips-$(ENDIAN)-elf

--
Regards,
Pavel Roskin

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 200...

To: Pavel Roskin <proski@...>
Cc: <madwifi-devel@...>
Date: Thursday, January 31, 2008 - 6:19 pm

Confirmed working. Thanks, please apply to trunk and 0.9.4.

Thanks, Kel.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Madwifi-devel mailing list
Madwifi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/madwifi-devel

To: Kel Modderman <kel@...>
Cc: <madwifi-devel@...>
Date: Thursday, January 31, 2008 - 10:28 am

That patch looks ok to me. I think it would be good to have that in
v0.9.4, too.

Bye, Mike

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Madwifi-devel mailing list
Madwifi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/madwifi-devel

Previous thread: [Madwifi-devel] Unnecessay export? by Pavel Roskin on Wednesday, January 30, 2008 - 5:13 pm. (1 message)

Next thread: [Madwifi-devel] Words in my Heart by jose on Friday, February 1, 2008 - 3:29 am. (1 message)