Bug 28433 - gdb will not build. ld says multiple definitions.
Summary: gdb will not build. ld says multiple definitions.
Status: RESOLVED DUPLICATE of bug 27242
Alias: None
Product: gdb
Classification: Unclassified
Component: build (show other bugs)
Version: 11.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-07 16:36 UTC by Adrian
Modified: 2022-03-18 12:41 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Output from configure and make (41.43 KB, text/plain)
2021-10-07 16:36 UTC, Adrian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian 2021-10-07 16:36:37 UTC
Created attachment 13714 [details]
Output from configure and make

So I tried to build gdb from scratch on my windows box using msys.  The final lines that was reported before exiting to the command prompt were:

  CXXLD  gdb.exe
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../lib/libncursesw.a(lib_termcap.o):(.bss+0x8): multiple definition of `UP'; ../readline/readline/libreadline.a(terminal.o):C:/msys64/mingw64/include/termcap.h:35: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../lib/libncursesw.a(lib_termcap.o):(.bss+0x0): multiple definition of `BC'; ../readline/readline/libreadline.a(terminal.o):C:/msys64/mingw64/include/termcap.h:36: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../lib/libncursesw.a(lib_tputs.o):(.bss+0x6): multiple definition of `PC'; ../readline/readline/libreadline.a(terminal.o):C:/msys64/mingw64/include/termcap.h:29: first defined here
collect2.exe: error: ld returned 1 exit status
make[2]: *** [Makefile:1882: gdb.exe] Error 1
make[2]: Leaving directory '/tmp/build/gdb'
make[1]: *** [Makefile:10462: all-gdb] Error 2
make[1]: Leaving directory '/tmp/build'
make: *** [Makefile:915: all] Error 2

I've attached a file showing the configure and build output.  What's going on?  I also tried to build 10.2 with the same problem.
Comment 1 Tom Tromey 2022-03-06 17:13:37 UTC
Moving to build.
Offhand I don't know what's going wrong here, sorry.
I guess I'd investigate why these symbols are being defined
in readline.  Or maybe disable readline or try the system readline,
if you have one available.
Comment 2 Hannes Domani 2022-03-18 12:41:48 UTC
Dup.

*** This bug has been marked as a duplicate of bug 27242 ***