# help! emerge madwifi-ng-0.9.2 error [SOLVED]

## Clark Kent

Hi,

I am quite new with linux and I am having a problem trying to get madwifi to emerge for my wireless card.  I don't know what kind of information is needed to help me find the solution, but if you ask me for what you need I will try to find and supply the information.  To start, here is the error output when I try to emerge madwifi:  

```

cc1: warnings being treated as errors

In file included from include/asm/mpspec.h:5,

                 from include/asm/smp.h:18,

                 from include/linux/smp.h:19,

                 from include/linux/sched.h:26,

                 from include/linux/module.h:10,

                 from /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/../hal/linux/ah_osdep.c:46,

                 from /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ah_osdep.c:2:

include/asm/mpspec_def.h:78: warning: 'packed' attribute ignored for field of type 'unsigned char[5u]'

make[2]: *** [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ah_osdep.o] Error 1

make[2]: *** Waiting for unfinished jobs....

cc1: warnings being treated as errors

In file included from include/asm/mpspec.h:5,

                 from include/asm/smp.h:18,

                 from include/linux/smp.h:19,

                 from include/linux/sched.h:26,

                 from include/linux/module.h:10,

                 from /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/if_ath.c:49:

include/asm/mpspec_def.h:78: warning: 'packed' attribute ignored for field of type 'unsigned char[5u]'

make[2]: *** [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/if_ath.o] Error 1

make[1]: *** [_module_/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath] Error 2

make: *** [all] Error 2

!!! ERROR: net-wireless/madwifi-ng-0.9.2 failed.

Call stack:

  ebuild.sh, line 1546:   Called dyn_compile

  ebuild.sh, line 937:   Called src_compile

  madwifi-ng-0.9.2.ebuild, line 86:   Called linux-mod_src_compile

  linux-mod.eclass, line 469:   Called die

!!! Unable to make  KERNELPATH=/usr/src/linux ATH_RATE=ath_rate/sample all.

!!! If you need support, post the topmost build error, and the call stack if relevant.

```

Thanks for your help!Last edited by Clark Kent on Fri Sep 22, 2006 7:17 pm; edited 1 time in total

----------

## Bobnoxous

Warnings are being treated as errors, and you have a warning about the "packed" attribute being useless. This is a code problem. The "packed" attribute is useless on chars, and newer compilers, like 4.1, catch more of these issues than previous versions, so things that used to work now don't.

Unfortunately, you have the latest version, so getting the "unstable" version won't help. I think you need to modify the ebuild to not treat warnings as errors (I'm not real familiar with ebuidls, so maybe I'm off base here). I also think you should file a bug report.

----------

## ova

You should modify your CFLAGS and remove options like -Wall or -Werror from there.

----------

## Clark Kent

Thanks for the replies guys.  

Like I said, I'm new.  The only place I know to change CFLAGS is in /etc/make.conf (is there anywhere else?) and mine does not have wall or werror there.  In fact mine is quite short since I haven't had time to tweak it yet.  This is what is listed there:

CFLAGS="-O2 -pipe -march=pentium4"

I also took a look in the madwifi ebuild, but I couldn't make heads or tails of it - I have no clue what I could do to modify it to make it work...suggestions are welcome.

----------

## ova

Another idea is that you have not showed us all output.  :Smile:  Please, show what's above. Also try

```

# env MAKEOPTS="-j1" emerge -1 madwifi-ng

```

----------

## Clark Kent

haha, good point.  here's the whole output:

```

Calculating dependencies... done!

>>> Emerging (1 of 1) net-wireless/madwifi-ng-0.9.2 to /

 * madwifi-0.9.2.tar.bz2 MD5 ;-) ...                                                                                                                                        [ ok ]

 * madwifi-0.9.2.tar.bz2 RMD160 ;-) ...                                                                                                                                    [ ok ]

 * madwifi-0.9.2.tar.bz2 SHA1 ;-) ...                                                                                                                                         

ok ]

 * madwifi-0.9.2.tar.bz2 SHA256 ;-) ...                                                                                                                                                                       

[ ok ]

 * madwifi-0.9.2.tar.bz2 size ;-) ...                                                                                                                                                                         

[ ok ]

 * checking ebuild checksums ;-) ...                                                                                                                                                                          

[ ok ]

 * checking auxfile checksums ;-) ...                                                                                                                                                                         

[ ok ]

 * checking miscfile checksums ;-) ...                                                                                                                                                                        

[ ok ]

 * checking madwifi-0.9.2.tar.bz2 ;-) ...                                                                                                                                                                     

[ ok ]

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     2.6.12-gentoo-r6

 * Checking for suitable kernel configuration options...                                                                                                                                                      

[ ok ]

>>> Unpacking source...

>>> Unpacking madwifi-0.9.2.tar.bz2 to /var/tmp/portage/madwifi-ng-0.9.2/work

 * Converting madwifi-0.9.2/ath/Makefile to use M= instead of SUBDIRS= ...                                                                                                                                    

[ ok ]

 * Converting madwifi-0.9.2/net80211/Makefile to use M= instead of SUBDIRS= ...                                                                                                                               

[ ok ]

 * Converting madwifi-0.9.2/ath_rate/amrr/Makefile to use M= instead of SUBDIRS= ...                                                                                                                          

[ ok ]

 * Converting madwifi-0.9.2/ath_rate/onoe/Makefile to use M= instead of SUBDIRS= ...                                                                                                                          

[ ok ]

 * Converting madwifi-0.9.2/ath_rate/sample/Makefile to use M= instead of SUBDIRS= ...                                                                                                                        

[ ok ]

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2 ...

 * Applying madwifi-ng-uudecode-gcda-fix.patch ...                                                                                                                                                            

[ ok ]

The following settings will be used for compilation:

TARGET       : i386-elf

OS           : linux

ARCH         : x86

BUS          : PCI

KERNELRELEASE: 2.6.12-gentoo-r6

KERNELPATH   : /usr/src/linux

KERNELCONF   : /usr/src/linux/.config

KMODPATH     : /lib/modules/2.6.12-gentoo-r6/net

KMODSUF      : ko

 * Preparing ath_hal module

make -C /usr/src/linux M=/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath modules

make[1]: Entering directory `/usr/src/linux-2.6.12-gentoo-r6'

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ah_osdep.o

  HOSTCC  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/uudecode.o

cc1: warnings being treated as errors

In file included from include/asm/mpspec.h:5,

                 from include/asm/smp.h:18,

                 from include/linux/smp.h:19,

                 from include/linux/sched.h:26,

                 from include/linux/module.h:10,

                 from /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/../hal/linux/ah_osdep.c:46,

                 from /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ah_osdep.c:2:

include/asm/mpspec_def.h:78: warning: 'packed' attribute ignored for field of type 'unsigned char[5u]'

  CC [M]  /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/if_ath.o

make[2]: *** [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/ah_osdep.o] Error 1

make[2]: *** Waiting for unfinished jobs....

cc1: warnings being treated as errors

In file included from include/asm/mpspec.h:5,

                 from include/asm/smp.h:18,

                 from include/linux/smp.h:19,

                 from include/linux/sched.h:26,

                 from include/linux/module.h:10,

                 from /var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/if_ath.c:49:

include/asm/mpspec_def.h:78: warning: 'packed' attribute ignored for field of type 'unsigned char[5u]'

make[2]: *** [/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath/if_ath.o] Error 1

make[1]: *** [_module_/var/tmp/portage/madwifi-ng-0.9.2/work/madwifi-0.9.2/ath] Error 2

make[1]: Leaving directory `/usr/src/linux-2.6.12-gentoo-r6'

make: *** [all] Error 2

!!! ERROR: net-wireless/madwifi-ng-0.9.2 failed.

Call stack:

  ebuild.sh, line 1546:   Called dyn_compile

  ebuild.sh, line 937:   Called src_compile

  madwifi-ng-0.9.2.ebuild, line 86:   Called linux-mod_src_compile

  linux-mod.eclass, line 469:   Called die

```

I have makeopts as j3 since i have a pentium 4 with hyperthreading enabled, but i tried it with one and two and get the same errors.  I might as well make this a learning experience, so what was the troubleshooting reason behind changing makeopts?

----------

## wynn

Kernel 2.6.12-gentoo-r6 is very old, in the source for 2.6.17-r8 (stable for x86), include/asm/mpspec_def.h has

```
struct mpc_config_bus

{

   unsigned char mpc_type;

   unsigned char mpc_busid;

   unsigned char mpc_bustype[6];

};
```

line 78 is the definition of mpc_bustype, and there is no packed there.

Perhaps upgrading your kernel would solve the problem?

----------

## ova

 *Clark Kent wrote:*   

> So what was the troubleshooting reason behind changing makeopts?

 

The reason for troubleshooting was that you "don't know what kind of information is needed to help" you to find the solution and you did not supplied enough information for me. Why I asked about changing MAKEOPTS? That will be your hometask  :Wink: 

Now back to your problem. You have rather old kernel which contains 'packed' attribute for type unsigned char:

```

include/asm/mpspec_def.h:78: warning: 'packed' attribute ignored for field of type 'unsigned char[5u]'

```

madwifi-ng has COPTS+= -Werror in Makefile.inc thus as it was already told you compiler does not like warnings with that option. Thus I'd suggest you to update your kernel to avoid this bug. If you do not want update your kernel then you should submit bugreport at bugzilla with full compilation output (of course you may skip checksum checking). And next time everytime you report an error, please, post emerge --info.

----------

## Clark Kent

Thanks guys, updating the kernel has let it emerge properly.

----------

## depontius

 *Clark Kent wrote:*   

> Thanks guys, updating the kernel has let it emerge properly.

 

Just to tack a note on here about this problem...

The new madwifi-ng drivers make use of the 'generic 802.11' stack that was added to the kernel, I believe in 2.6.17, so upgrading the kernel was absolutely necessary in this case. (specifically, CONFIG_IEEE80211)

In my case, I'm using the old madwifi stuff, and just found out about madwifi-ng. On their web site they make it look non-trivial to upgrade, so I was searching the Gentoo Forums to see if there was any advice, and found this thread. Things are too busy for the upgrade now, but sometime in the next week or two, I'd like to move to madwifi-ng

Anyone have advice about moving from madwifi to madwifi-ng?

----------

## ova

 *depontius wrote:*   

> Anyone have advice about moving from madwifi to madwifi-ng?

 

I know nothing about something special. Just unmerge madwifi* and emerge madwifi-ng*.

But I'd like to add a small note. I have some problems with madwifi-ng-0.9.2 and 0.9.1 and they are not working when I connecting my thinkpad T41 with usb wifi card (TrendNet TEW-424UB). But previous version 0.0.1531.20060427 works fine here. May be this helps you in case or problems.   :Wink: 

----------

## depontius

Fortunately my Atheros is built in to my (company-supplied) Thinkpad.

For legacy reasons, I've masked >=glibc-2.4 and >=gcc-4. I know the glibc-2.4 mask is necessary, based on the testing I've done with 2006.1 on a spare parition. I think I'm going to wipe that and copy my main 2005.1 partition over to it, so I can try migrating just gcc-4.1.1. I think once I create that partition, I'll use it to experiment with madwifi-ng, too.

Thanks

----------

## Clark Kent

Like it was mentioned above, all I had to do was update the kernel.  The net.ath0 init script seems to broken though.  I tried unmasking the baselayout to get the newest version, but that didn't work either.  I ended up taking it out of the default runlevel and just setting up the network manually with a script in the fluxbox startup.

----------

## Kuhndog86

I get the same error with kernel 2.6.15.  Unfortunately I have to use this or earlier because of an ACPI bug with my laptop.  How do I turn off the "treat warnings as an error" thing?  I'm not afraid to compile the driver by hand.

----------

## Kuhndog86

Nevermind.  I got it thanks to:

 *Volkov_Peter wrote:*   

> 
> 
> madwifi-ng has COPTS+= -Werror in Makefile.inc thus as it was already told you compiler does not like warnings with that option. Thus I'd suggest you to update your kernel to avoid this bug. If you do not want update your kernel then you should submit bugreport at bugzilla with full compilation output (of course you may skip checksum checking). And next time everytime you report an error, please, post emerge --info.
> 
> 

 

I modified the makefile and built it manually and all is good.

Thanks

----------

