[Ndiswrapper-general] [PATCH] ndiswrapper: pe_linker.c compilations problems
Status: Beta
Brought to you by:
pgiri
From: NeiRRedF <nei...@ne...> - 2005-05-20 14:55:47
|
Hello, I used to compile ndiswrapper form the CVS sources and I have found a=20 compilation problem in the source. As it is explained here : Ex=E9cution_de(%build): /bin/sh -e /var/tmp/rpm-tmp.66435 + umask 022 + cd /home/compil/rpm/BUILD + cd ndiswrapper-1.2rc1 + LANG=3DC + export LANG + unset DISPLAY + make all KVERS=3D2.6.11-1.1319_FC4 KSRC=3D/lib/modules/2.6.11-1.1319_FC= 4/build make -C driver make[1]: Entering directory=20 `/home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver' make -C /lib/modules/2.6.11-1.1319_FC4/build=20 SUBDIRS=3D/home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver \ NDISWRAPPER_VERSION=3D1.2rc1 \ EXTRA_VERSION=3D modules make[2]: Entering directory `/usr/src/kernels/2.6.11-1.1319_FC4-i686' CC [M] /home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver/hal.o CC [M] /home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver/iw_ndis.o CC [M] /home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver/loader.o /home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver/loader.c: In function=20 'ndiswrapper_add_pci_device': /home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver/loader.c:202: warning:=20 ignoring return value of 'pci_set_power_state', declared with attribute=20 warn_unused_result CC [M] /home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver/misc_funcs.o CC [M] /home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver/ndis.o CC [M] /home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver/ntoskernel.o CC [M] /home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver/pe_linker.o /home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver/pe_linker.c:34: error:=20 array type has incomplete element type make[3]: ***=20 [/home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver/pe_linker.o] Error 1 make[2]: *** [_module_/home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver]=20 Error 2 make[2]: Leaving directory `/usr/src/kernels/2.6.11-1.1319_FC4-i686' make[1]: *** [default] Error 2 make[1]: Leaving directory=20 `/home/compil/rpm/BUILD/ndiswrapper-1.2rc1/driver' make: *** [all] Error 2 erreur: Mauvais status de sortie pour /var/tmp/rpm-tmp.66435 (%build) The source used is from the latest CVS files. So, when I read the source code of pe_linker.c, I noted a diff between=20 1.21 and 1.22 In 1.21 : static struct pe_exports pe_exports[40]; static int num_pe_exports; is after : struct pe_exports { char *dll; char *name; WRAP_EXPORT_FUNC addr; }; But in 1.22, it is reversed. When I compile with 1.21 version, there is no problem, but when I=20 compile with 1.22 version, the error shown above appears and it don't=20 compile. I am not an ndiswrapper expert nor an expert of compilation and perhaps=20 this patch would break things, but now I can comple CVS sources and use=20 driver with my card. The config used : - Fedora Core 3 with developpements updates on an Athlon XP - kernel 2.6.11-1.1319_FC4 with gcc-4.0 - a D-Link DWL-G520 card with HP driver (v 3.1.1.50) The diff is generated against the lastest pe_linker.c available (1.24)=20 and the one who compiles (1.21). Do not blame me if it break things, as I said I am not an expert, but=20 for me it works. Here is the patch : diff -ur ndiswrapper/ndiswrapper/driver/pe_linker.c=20 ndiswrapper/ndiswrapper/driver/pe_linker.c.new --- ndiswrapper/ndiswrapper/driver/pe_linker.c 2005-05-08=20 07:58:16.000000000 +0200 +++ ndiswrapper/ndiswrapper/driver/pe_linker.c.new 2005-05-20=20 16:24:02.000000000 +0200 @@ -31,16 +31,16 @@ =20 #endif =20 -static struct pe_exports pe_exports[40]; -static int num_pe_exports; -extern struct kuser_shared_data kuser_shared_data; - struct pe_exports { char *dll; char *name; WRAP_EXPORT_FUNC addr; }; =20 +static struct pe_exports pe_exports[40]; +static int num_pe_exports; +extern struct kuser_shared_data kuser_shared_data; + #define RVA2VA(image, rva, type) (type)(ULONG_PTR)((void *)image + rva) #define CHECK_SZ(a,b) { if (sizeof(a) !=3D b) { \ ERROR("%s is bad, got %zd, expected %d", \ |