On 2010.09.11 13:46, Kai Tietz wrote: > 2010/9/11 Ozkan Sezer<[email protected]>: >> On Sat, Sep 11, 2010 at 3:37 PM, Xiaofan Chen<[email protected]> wrote: >>> On Sat, Sep 11, 2010 at 8:31 PM, Ozkan Sezer<[email protected]> wrote: >>>> You need the @8 _and_ the leading underscore for x86 >>>> So you need adjusting your Makefile and libusb0_drv.def >>>> for two different builds. >>> >>> Thanks. I fixed the Makefile and now I have the following. >>> >>> windres -I./src --target=pe-i386 ./src/driver/libusb_driver_rc.rc -o >>> libusb_dr >>> iver_rc.o >>> gcc -static -o libusb0.sys abort_endpoint.o claim_interface.o >>> clear_feature.o di >>> spatch.o get_configuration.o get_descriptor.o get_interface.o get_status.o >>> ioctl >>> .o libusb_driver.o pnp.o release_interface.o reset_device.o >>> reset_endpoint.o set >>> _configuration.o set_descriptor.o set_feature.o set_interface.o transfer.o >>> vendo >>> r_request.o power.o driver_registry.o error.o libusb_driver_rc.o >>> libusb0_drv.de >>> f -s -m32 -shared -Wl,--entry,_driveren...@8 -nostartfiles -nostdlib -L. >>> -lusbd >>> -lntoskrnl -lhal >>> libusb_driver.o:libusb_driver.c:(.text+0x696): undefined reference to >>> `_Interloc >>> kedIncrement' >>> libusb_driver.o:libusb_driver.c:(.text+0x6b4): undefined reference to >>> `_Interloc >>> kedDecrement' >>> libusb_driver.o:libusb_driver.c:(.text+0x701): undefined reference to >>> `_Interloc >>> kedDecrement' >>> set_configuration.o:set_configuration.c:(.text+0x1c8): undefined reference >>> to `U >>> sbd_createconfigurationreques...@8' >> >> For this particular one, I think you can use your old usbd.def file but, ... >> >>> transfer.o:transfer.c:(.text+0x14a): undefined reference to >>> `_InterlockedIncreme >>> nt' >>> transfer.o:transfer.c:(.text+0x17f): undefined reference to >>> `_InterlockedDecreme >>> nt' >>> transfer.o:transfer.c:(.text+0x1b1): undefined reference to >>> `_InterlockedDecreme >>> nt' >>> transfer.o:transfer.c:(.text+0x2fb): undefined reference to >>> `_InterlockedDecreme >>> nt' >>> transfer.o:transfer.c:(.text+0x413): undefined reference to >>> `_InterlockedExchang >>> e' >>> transfer.o:transfer.c:(.text+0x4d9): undefined reference to >>> `_InterlockedExchang >>> e' >>> transfer.o:transfer.c:(.text+0x62a): undefined reference to >>> `_InterlockedIncreme >>> nt' >>> transfer.o:transfer.c:(.text+0xd16): undefined reference to >>> `_InterlockedExchang >>> e' >>> transfer.o:transfer.c:(.text+0xde7): undefined reference to >>> `_InterlockedIncreme >>> nt' >>> collect2: ld returned 1 exit status >>> make: *** [libusb0.sys] Error 1 >>> >>>> With these, I am baffled: These were supposed to be imported from >>>> ntoskrnl.exe >>>> Our lib32/ntoskrnl.def has the proper entries, so why are they not? >>>> Kai, any insights? >>>> >>>> (Of course we can provide inlines for these but that's not the point, >>>> and the msvc >>>> builds are importing them from ntoskrnl.exe, too.) >>>> >> >> .... for the _Interlocked* ones, I still don't know what is wrong. >> >>> >>> >>> -- >>> Xiaofan >>> >> >> -- >> Ozkan >> > > The _Interlocked... API in VC is a strict builtin feature of VC. Which > means that for gcc it has to be provided (for x86 case) as inlines, > too. The difference here is that Interlocked... has stdcall > convention, but _Interlocked... has __cdecl one. You can fix this by > linking to our 32-bit mingwex library, which is providing them, or you > can add here similar inline functions (for x86 only) for > _Interlocked... to wdm.h, too.
Isn't that the same issue as what I reported below? https://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTimWf83zE2KGGZrVNbOykOVmqAWsNF9MmiQRPdpA%40mail.gmail.com&forum_name=mingw-w64-public Regards, /Pete ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
