Bug 10860 - gold is missing '--warn-common' option
Summary: gold is missing '--warn-common' option
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.20
: P2 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-28 14:46 UTC by Priit Laes
Modified: 2009-11-04 01:30 UTC (History)
1 user (show)

See Also:
Host: x86_64-pc-linux-gnu
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Priit Laes 2009-10-28 14:46:53 UTC
When trying to build sdlmame, build fails during linking because gold linker is
missing `--warn-common` option.

[snip]
Archiving obj/sdl/sdlmame/libosd.a...
Archiving obj/sdl/sdlmame/libsound.a...
Linking testkeys...
Linking romcmp...
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/../../../../x86_64-pc-linux-gnu/bin/ld:
--warn-common: unknown option
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/../../../../x86_64-pc-linux-gnu/bin/ld:
use the --help option for usage information
collect2: ld returned 1 exit status
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/../../../../x86_64-pc-linux-gnu/bin/ld:
--warn-common: unknown option
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/../../../../x86_64-pc-linux-gnu/bin/ld:
use the --help option for usage information
collect2: ld returned 1 exit status
Linking jedutil...
make: *** [testkeys] Error 1
make: *** Waiting for unfinished jobs....
make: *** [romcmp] Error 1
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/../../../../x86_64-pc-linux-gnu/bin/ld:
--warn-common: unknown option
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/../../../../x86_64-pc-linux-gnu/bin/ld:
use the --help option for usage information
collect2: ld returned 1 exit status
make: *** [jedutil] Error 1
[/snip]
Comment 1 Sourceware Commits 2009-11-04 01:24:54 UTC
Subject: Bug 10860

CVSROOT:	/cvs/src
Module name:	src
Changes by:	ian@sourceware.org	2009-11-04 01:24:41

Modified files:
	gold           : ChangeLog options.h resolve.cc symtab.h 

Log message:
	PR 10860
	* options.h (class General_options): Add --warn-common.
	* resolve.cc (Symbol_table::resolve): Handle --warn-common when
	merging two common symbols.
	(Symbol_table::should_override): Handle --warn-common when merging
	a common symbol with a defined symbol.  Use report_resolve_problem
	for multiple definitions.
	(Symbol_table::report_resolve_problem): New function.
	* symtab.h (class Symbol_table): Declare report_resolve_problem.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/ChangeLog.diff?cvsroot=src&r1=1.342&r2=1.343
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/options.h.diff?cvsroot=src&r1=1.116&r2=1.117
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/resolve.cc.diff?cvsroot=src&r1=1.43&r2=1.44
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/symtab.h.diff?cvsroot=src&r1=1.95&r2=1.96

Comment 2 Sourceware Commits 2009-11-04 01:28:41 UTC
Subject: Bug 10860

CVSROOT:	/cvs/src
Module name:	src
Branch: 	binutils-2_20-branch
Changes by:	ian@sourceware.org	2009-11-04 01:28:30

Modified files:
	gold           : ChangeLog options.h resolve.cc symtab.h 

Log message:
	PR 10860
	* options.h (class General_options): Add --warn-common.
	* resolve.cc (Symbol_table::resolve): Handle --warn-common when
	merging two common symbols.
	(Symbol_table::should_override): Handle --warn-common when merging
	a common symbol with a defined symbol.  Use report_resolve_problem
	for multiple definitions.
	(Symbol_table::report_resolve_problem): New function.
	* symtab.h (class Symbol_table): Declare report_resolve_problem.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.281.2.6&r2=1.281.2.7
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/options.h.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.106.2.1&r2=1.106.2.2
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/resolve.cc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.42.2.1&r2=1.42.2.2
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/symtab.h.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.90.2.1&r2=1.90.2.2

Comment 3 Ian Lance Taylor 2009-11-04 01:30:10 UTC
Thanks for the bug report.  Fixed.