Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Operating System/Drivers
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by victorzhang - 2011-03-16
Last edited by nls - 2011-03-19

FS#12014 - LD complained about duplicate symbols(missing "extern")

@rockbox/apps/codecs/libmusepack/requant.h,line 50
@rockbox/apps/plugins/fft/const.h, line 1-10
@rockbox/apps/plugins/goban/display.h, line 41, line 44
@rockbox/apps/plugins/rockboy/rockmacros.h, line 100
Since the keyword “extern” is omitted from the header file, global varibles will have multiple definition.This will cause link error(duplicate symbols),especially for some new version of LD. Generally speaking, if a global variable is going to be used in more than 2 files, it’s better to declare it in the header file(use “extern”), and have ONLY ONE definition in .c file.

Closed by  nls
2011-03-19 10:16
Reason for closing:  Accepted
Additional comments about closing:  

Committed, thanks. I'm still curious why only the mips toolchain cares about this.

This patch applys to:
rockbox/apps/codecs/libmusepack/requant.h, revision 25056
rockbox/apps/plugins/fft/const.h, revision 26100
rockbox/apps/plugins/goban/display.h, revision 28712
rockbox/apps/plugins/rockboy/rockmacros.h, revision 28664
rockbox/apps/plugins/rockboy/cpu.c, revision 25844

nls commented on 2011-03-17 16:57

This same source builds fine for coldfire with gcc 4.5.2 and i see no reason for this to be cpu dependant so what options are you using to compile?

I built this source with mips-sde-elf-gcc 4.5.1 and gnu binary utilities 2.20.51. I think this problem was caused by ld, not gcc. I used default compile options, except that I compiled source with a new toolchain. New version of ld may be more strict with duplicate symbols. Strictly speaking, “extern” is indeed missing in those header file.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing