Help: Make stops with multiple definition of `__vector_1'

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guyzz

I'm trying to compile USBASP
http://www.fischl.de/usbasp/
This version
http://www.fischl.de/usbasp/usba...

The devivered makefile within the TGZ works , but with a WinAVR Makefile it stops with this message :

usbdrv/usbdrvasm.o(.text+0x0):usbdrv/usbdrvasm.S:50: multiple definition of `__vector_1'
usbdrv/usbdrvasm.o(.text+0x0):usbdrv/usbdrvasm.S:50: first defined here
usbdrv/usbdrvasm.o(.text+0x30a):usbdrv/usbdrvasm.S:620: multiple definition of `usbCrc16'
usbdrv/usbdrvasm.o(.text+0x30a):usbdrv/usbdrvasm.S:620: first defined here

The full PN Output Window is here :

-------- begin --------
avr-gcc (GCC) 3.4.3
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Compiling: usbdrv/usbdrv.c
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=usbdrv/usbdrv.lst -Iusbdrv -std=gnu99 -Wp,-M,-MP,-MT,usbdrv.o,-MF,.dep/usbdrv.o.d usbdrv/usbdrv.c -o usbdrv/usbdrv.o 
usbdrv/usbdrv.c: In function `usbPoll':
usbdrv/usbdrv.c:386: warning: comparison is always false due to limited range of data type

Assembling: usbdrv/usbdrvasm.S
avr-gcc -c -mmcu=atmega8 -I. -x assembler-with-cpp -Wa,-adhlns=usbdrv/usbdrvasm.lst,-gstabs  usbdrv/usbdrvasm.S -o usbdrv/usbdrvasm.o

Compiling: usbdrv/oddebug.c
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=usbdrv/oddebug.lst -Iusbdrv -std=gnu99 -Wp,-M,-MP,-MT,oddebug.o,-MF,.dep/oddebug.o.d usbdrv/oddebug.c -o usbdrv/oddebug.o 

Compiling: main.c
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.lst -Iusbdrv -std=gnu99 -Wp,-M,-MP,-MT,main.o,-MF,.dep/main.o.d main.c -o main.o 

Compiling: isp.c
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=isp.lst -Iusbdrv -std=gnu99 -Wp,-M,-MP,-MT,isp.o,-MF,.dep/isp.o.d isp.c -o isp.o 

Compiling: clock.c
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=clock.lst -Iusbdrv -std=gnu99 -Wp,-M,-MP,-MT,clock.o,-MF,.dep/clock.o.d clock.c -o clock.o 

Linking: main.elf
avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=usbdrv/usbdrv.o -Iusbdrv -std=gnu99 -Wp,-M,-MP,-MT,main.o,-MF,.dep/main.elf.d usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o  main.o isp.o clock.o  usbdrv/usbdrvasm.o  --output main.elf -Wl,-Map=main.map,--cref  -lm
usbdrv/usbdrvasm.o(.text+0x0):usbdrv/usbdrvasm.S:50: multiple definition of `__vector_1'
usbdrv/usbdrvasm.o(.text+0x0):usbdrv/usbdrvasm.S:50: first defined here
usbdrv/usbdrvasm.o(.text+0x30a):usbdrv/usbdrvasm.S:620: multiple definition of `usbCrc16'
usbdrv/usbdrvasm.o(.text+0x30a):usbdrv/usbdrvasm.S:620: first defined here
make.exe: *** [main.elf] Error 1

I have included the working original makefile , and the failing winavr makefile , if anyone would care to have a look.

TIA
/Bingo

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have an idea that it might have something to do with the -c parameter in the original makefile , used both on the .c and .S files

Here is PN output of the successfull compile

> "make.exe" all
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega8  -c usbdrv/usbdrv.c -o usbdrv/usbdrv.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega8  -x assembler-with-cpp -c usbdrv/usbdrvasm.S -o usbdrv/usbdrvasm.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega8  -c usbdrv/oddebug.c -o usbdrv/oddebug.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega8  -c isp.c -o isp.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega8  -c clock.c -o clock.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega8  -c main.c -o main.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega8  -o main.bin usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o isp.o clock.o main.o -Wl,-Map,main.map
rm -f main.hex main.eep.hex
avr-objcopy -j .text -j .data -O ihex main.bin main.hex

> Process Exit Code: 0

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dooh :oops:

I included the assembler module as a .c module also

When removing the usbdrv/usbdrvasm.c from the SRC= line it works

damm :-(

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, shit happens. I just withdraw my posting...

Btw.:

#define _VECTOR(N) __vector_ ## N /* io.h does not define this for asm */

You can safely delete that line. I've got no idea why/how the author
got that opinion.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanx Jörg :lol:

/Bingo