From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12268 invoked by alias); 23 Jun 2011 15:02:43 -0000 Received: (qmail 12233 invoked by uid 22791); 23 Jun 2011 15:02:41 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Jun 2011 15:02:18 +0000 From: "rbusser at lgcpi dot com" To: gdb-prs@sourceware.org Subject: [Bug build/12925] New: link creating libsim.a has multiple definition problems X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: build X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rbusser at lgcpi dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 23 Jun 2011 15:02:00 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2011-q2/txt/msg00466.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12925 Summary: link creating libsim.a has multiple definition problems Product: gdb Version: 7.2 Status: NEW Severity: normal Priority: P2 Component: build AssignedTo: unassigned@sourceware.org ReportedBy: rbusser@lgcpi.com building a gdb with simulation capability for the powerpc results in a linker problem. inline.c has these preprocessor commands #if (SEMANTICS_INLINE & INCLUDE_MODULE) #include "semantics.c" #endif #if (IDECODE_INLINE & INCLUDE_MODULE) #include "idecode.c" #endif if SEMANTICS_INLINE is defined, sementics.c gets inlined into idecode.c. The problem here is that semantics.c includes a global declaration around line #37 int option_mpc860c0 = 0; So, when the linker attempts to create libsim.a with this command ar rc libsim.a debug.o filter_filename.o bits.o sim-endian.o os_emul.o emul_generic.o emul_bugapi.o emul_chirp.o emul_netbsd.o emul_unix.o registers.o vm.o corefile.o model.o spreg.o cpu.o interrupts.o events.o cap.o device.o tree.o device_table.o itable.o mon.o icache.o semantics.o idecode.o support.o sim-fpu.o psim.o version.o pk_disklabel.o hw_cpu.o hw_memory.o hw_nvram.o hw_iobus.o hw_htab.o hw_disk.o hw_trace.o hw_register.o hw_vm.o hw_init.o hw_core.o hw_pal.o hw_com.o hw_eeprom.o hw_opic.o hw_glue.o hw_phb.o hw_ide.o options.o gdb-sim.o sim_calls.o callback.o targ-map.o which attempts to link both semantics.o and idecode.o the result is a multiple definitions error involving option_mpc860c0. Then, if you remove the definition of SEMANTICS_INLINE by commenting out these lines in ppc-config.h /* #ifndef SEMANTICS_INLINE #define SEMANTICS_INLINE (DEFAULT_INLINE & ~INLINE_MODULE) #endif */ line #157 in options.c printf_filtered ("SEMANTICS_INLINE = %s\n", options_inline (SEMANTICS_INLINE)); complains. It is in a print function called "print_options" which apparently assumes that SEMANTICS_INLINE is always defined. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.