bugAVR Downloader/UploaDEr - Bugs: bug #41854, avrdude 6.1 does not compile on...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #41854: avrdude 6.1 does not compile on systems without libUSB

Submitted by:  Georg von Zengen <oni>
Submitted on:  Thu 13 Mar 2014 02:05:00 PM UTC  
 
Category: NoneSeverity: 4 - Important
Priority: 5 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: Joerg Wunsch <joerg_wunsch>Originator Name: oni
Open/Closed: Closed

Mon 19 May 2014 12:33:02 PM UTC, comment #5:

Fixed in r1314, thanks for reporting, and for suggesting a fix!

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.
Fri 21 Mar 2014 12:15:38 PM UTC, comment #4:

Luckily, this can be fixed by stubbing only 3 files, dfu.c, and flip1.c and flip2.c which both depend on dfu.c.

dfu.c already had stubs for #ifndef HAVE_LIBUSB, replacing the libusb function, but those didn't match the exports. Fixed this.

Stubbed the external functions in flip1.c and flip2.c completely for the ifndef case, as they touch USB internals and ultimately rely on structs defined in the libusb headers. Maybe it would be better to duplicate flip1/2_initpgm into the ifndef case and only provide a stub for pgm->open, but in case this is bad form, I left stubs for all the functions.

(file #30986, file #30987, file #30988)

Didrik Madheden <didrikm>
Thu 13 Mar 2014 03:07:03 PM UTC, comment #3:

> But this does not fix the problem for systems without libUSB.


Sure, the bug report remains valid, and stays open. Builds
without libusb should certainly be supported, albeit I guess
they are getting fairly rare these days (maybe with some more
exotic exceptions like installations using direct GPIO on a
Raspberry Pi or such).

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.
Thu 13 Mar 2014 03:00:15 PM UTC, comment #2:

Thanks for the quick answer. It fixes my problem.
But this does not fix the problem for systems without libUSB.
I think a lot more ifdefs has to be added to fix the problem or libUSB has to become mandatory to compile avrdude.

Georg von Zengen <oni>
Thu 13 Mar 2014 02:34:36 PM UTC, comment #1:

Too bad. :-(

Where does your libusb come from? If it's from macports, try

Just tested it that way, and at the very least, it compiles then.

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.
Thu 13 Mar 2014 02:05:00 PM UTC, original submission:

I just tried to compile arvdude 6.1 on mac OSX and it failed.
On the system libUSB is installed but not found by the configure script.
I also try to quick fix this issue by equalizing the definitions of dfu_open and init in the .c and .h. That leaded me into even bigger problems because the dfu_dev struct is empty if libUSB is not installed/found.

relevant part of make output:
mv -f .deps/libavrdude_a-crc16.Tpo .deps/libavrdude_a-crc16.Po
gcc -DHAVE_CONFIG_H -I. -DCONFIG_DIR="/usr/local/etc" -Wall -g -O2 -MT libavrdude_a-dfu.o -MD -MP -MF .deps/libavrdude_a-dfu.Tpo -c -o libavrdude_a-dfu.o `test -f 'dfu.c' || echo './'`dfu.c
dfu.c:39:5: error: conflicting types for 'dfu_open'
int dfu_open(struct dfu_dev dfu, char port_name) {
^
./dfu.h:117:25: note: previous declaration is here
extern struct dfu_dev * dfu_open(char *port_spec);
^
dfu.c:45:5: error: conflicting types for 'dfu_init'
int dfu_init(struct dfu_dev *dfu, unsigned short usb_pid) {
^
./dfu.h:118:12: note: previous declaration is here
extern int dfu_init(struct dfu_dev *dfu,
^
2 errors generated.
make[2]: *** [libavrdude_a-dfu.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Georg von Zengen <oni>

 

Attached Files
file #30986:  dfu.c added by didrikm (14kB - application/octet-stream - Added and fixed stubs to allow avrdude to be compiled without libusb0, without error.)
file #30987:  flip1.c added by didrikm (28kB - application/octet-stream - Added and fixed stubs to allow avrdude to be compiled without libusb0, without error.)
file #30988:  flip2.c added by didrikm (29kB - application/octet-stream - Added and fixed stubs to allow avrdude to be compiled without libusb0, without error.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by didrikm (Updated the item)
  • -unavailable- added by joerg_wunsch (Posted a comment)
  • -unavailable- added by oni (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 19 May 2014 12:33:02 PM UTCjoerg_wunschStatusNone=>Fixed
      Assigned toNone=>joerg_wunsch
      Open/ClosedOpen=>Closed
    Fri 21 Mar 2014 12:15:38 PM UTCdidrikmAttached File-=>Added dfu.c, #30986
      Attached File-=>Added flip1.c, #30987
      Attached File-=>Added flip2.c, #30988
    Thu 13 Mar 2014 03:07:03 PM UTCjoerg_wunschSeverity3 - Normal=>4 - Important

    Back to the top


    Powered by Savane 3.1-cleanup