This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug build/12925] New: link creating libsim.a has multipledefinition problems


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]