Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building fails in Fedora 32 #40

Closed
Baggypants opened this issue May 20, 2020 · 5 comments · Fixed by #42
Closed

Building fails in Fedora 32 #40

Baggypants opened this issue May 20, 2020 · 5 comments · Fixed by #42

Comments

@Baggypants
Copy link

linker seems to not like something when compiling in f32. Extract of build output below.
This is from the v1.1.1 tag but the same occurs on the building of HEAD.

cc -g -W -Wall -pedantic -ansi -std=c99 -DVERSION=\"1.1.1\"   -c -o src/cursor.o src/cursor.c
cc -g -W -Wall -pedantic -ansi -std=c99 -DVERSION=\"1.1.1\"   -c -o src/keyboard.o src/keyboard.c
cc -g -W -Wall -pedantic -ansi -std=c99 -DVERSION=\"1.1.1\"   -c -o src/gui.o src/gui.c
cc -g -W -Wall -pedantic -ansi -std=c99 -DVERSION=\"1.1.1\"   -c -o src/game.o src/game.c
cc -g -W -Wall -pedantic -ansi -std=c99 -DVERSION=\"1.1.1\" src/ttysolitaire.c -o ttysolitaire src/common.o src/frame.o src/card.o src/stack.o src/deck.o src/cursor.o src/keyboard.o src/gui.o src/game.o  -lncursesw
/usr/bin/ld: src/cursor.o:(.bss+0x0): multiple definition of `deck'; /tmp/ccVwI7VH.o:(.bss+0x0): first defined here
/usr/bin/ld: src/cursor.o:/builddir/build/BUILD/tty-solitaire-1.1.1/src/game.h:38: multiple definition of `cursor'; /tmp/ccVwI7VH.o:/builddir/build/BUILD/tty-solitaire-1.1.1/src/game.h:38: first defined here
/usr/bin/ld: src/keyboard.o:(.bss+0x0): multiple definition of `deck'; /tmp/ccVwI7VH.o:(.bss+0x0): first defined here
/usr/bin/ld: src/keyboard.o:(.bss+0x8): multiple definition of `cursor'; /tmp/ccVwI7VH.o:/builddir/build/BUILD/tty-solitaire-1.1.1/src/game.h:38: first defined here
/usr/bin/ld: src/gui.o:(.bss+0x0): multiple definition of `deck'; /tmp/ccVwI7VH.o:(.bss+0x0): first defined here
/usr/bin/ld: src/gui.o:/builddir/build/BUILD/tty-solitaire-1.1.1/src/game.h:38: multiple definition of `cursor'; /tmp/ccVwI7VH.o:/builddir/build/BUILD/tty-solitaire-1.1.1/src/game.h:38: first defined here
/usr/bin/ld: src/game.o:(.bss+0x0): multiple definition of `deck'; /tmp/ccVwI7VH.o:(.bss+0x0): first defined here
/usr/bin/ld: src/game.o:/builddir/build/BUILD/tty-solitaire-1.1.1/src/game.h:38: multiple definition of `cursor'; /tmp/ccVwI7VH.o:/builddir/build/BUILD/tty-solitaire-1.1.1/src/game.h:38: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:48: ttysolitaire] Error 1
RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.92Pzdw (%build)
    Bad exit status from /var/tmp/rpm-tmp.92Pzdw (%build)
Child return code was: 1
EXCEPTION: [Error()]
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.7/site-packages/mockbuild/util.py", line 776, in do_with_status
    raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode)
mockbuild.exception.Error: Command failed: 
@mpereira
Copy link
Owner

mpereira commented May 22, 2020

Hi @Baggypants,

Thanks for the report. I'd be curious to know the version of gcc in Fedora 32 and the Python scripts building tty-solitaire. It looks like it's trying to somehow link duplicate object files? For example, for the "cursor" object, if we look at this line output:

src/cursor.o:/builddir/build/BUILD/tty-solitaire-1.1.1/src/game.h:38: multiple definition of `cursor'; /tmp/ccVwI7VH.o:/builddir/build/BUILD/tty-solitaire-1.1.1/src/game.h:38: first defined here

There are both
src/cursor.o:/builddir/build/BUILD/tty-solitaire-1.1.1/src/game.h:38
and
/tmp/ccVwI7VH.o:/builddir/build/BUILD/tty-solitaire-1.1.1/src/game.h:38

And game.h:38 is:

struct cursor *cursor;

Do you have a Fedora setup and would be able to debug it?

@Baggypants
Copy link
Author

[baggypants@buildserver ~]$ rpm -qa gcc
gcc-10.0.1-0.13.fc32.x86_64

The python stuff is just the automated build system and doesn't impact on the build. Heres the HEAD build on a classic make-in-a-directory machine

[baggypants@buildserver tty-solitaire]$ make
cc -g -W -Wall -pedantic -ansi -std=c99 -DVERSION=\"1.1.1\" src/ttysolitaire.c -o ttysolitaire src/common.o src/frame.o src/card.o src/stack.o src/deck.o src/cursor.o src/keyboard.o src/gui.o src/game.o  -lncursesw
/usr/bin/ld: src/cursor.o:(.bss+0x0): multiple definition of `deck'; /tmp/cce1xEvH.o:(.bss+0x0): first defined here
/usr/bin/ld: src/cursor.o:/home/baggypants/Develop/tty-solitaire/src/game.h:38: multiple definition of `cursor'; /tmp/cce1xEvH.o:/home/baggypants/Develop/tty-solitaire/src/game.h:38: first defined here
/usr/bin/ld: src/keyboard.o:(.bss+0x0): multiple definition of `deck'; /tmp/cce1xEvH.o:(.bss+0x0): first defined here
/usr/bin/ld: src/keyboard.o:(.bss+0x8): multiple definition of `cursor'; /tmp/cce1xEvH.o:/home/baggypants/Develop/tty-solitaire/src/game.h:38: first defined here
/usr/bin/ld: src/gui.o:(.bss+0x0): multiple definition of `deck'; /tmp/cce1xEvH.o:(.bss+0x0): first defined here
/usr/bin/ld: src/gui.o:/home/baggypants/Develop/tty-solitaire/src/game.h:38: multiple definition of `cursor'; /tmp/cce1xEvH.o:/home/baggypants/Develop/tty-solitaire/src/game.h:38: first defined here
/usr/bin/ld: src/game.o:(.bss+0x0): multiple definition of `deck'; /tmp/cce1xEvH.o:(.bss+0x0): first defined here
/usr/bin/ld: src/game.o:/home/baggypants/Develop/tty-solitaire/src/game.h:38: multiple definition of `cursor'; /tmp/cce1xEvH.o:/home/baggypants/Develop/tty-solitaire/src/game.h:38: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:48: ttysolitaire] Error 1
[baggypants@buildserver tty-solitaire]$

@dther
Copy link
Contributor

dther commented May 31, 2020

Similar error on Arch. Downgrading gcc and gcc-libs to 9.3.0-1 produces no errors. Current version is 10.1.0-2.

$ make
cc -g -W -Wall -pedantic -ansi -std=c99 -DVERSION=\"1.1.1\" src/ttysolitaire.c -o ttysolitaire src/common.o src/frame.o src/card.o src/stack.o src/deck.o src/cursor.o src/keyboard.o src/gui.o src/game.o  -lncursesw
/usr/bin/ld: src/cursor.o:(.bss+0x0): multiple definition of `deck'; /tmp/cchdIJta.o:(.bss+0x0): first defined here
/usr/bin/ld: src/cursor.o:/home/dther/repos/tty-solitaire/src/game.h:38: multiple definition of `cursor'; /tmp/cchdIJta.o:/home/dther/repos/tty-solitaire/src/game.h:38: first defined here
/usr/bin/ld: src/keyboard.o:(.bss+0x0): multiple definition of `deck'; /tmp/cchdIJta.o:(.bss+0x0): first defined here
/usr/bin/ld: src/keyboard.o:(.bss+0x8): multiple definition of `cursor'; /tmp/cchdIJta.o:/home/dther/repos/tty-solitaire/src/game.h:38: first defined here
/usr/bin/ld: src/gui.o:(.bss+0x0): multiple definition of `deck'; /tmp/cchdIJta.o:(.bss+0x0): first defined here
/usr/bin/ld: src/gui.o:/home/dther/repos/tty-solitaire/src/game.h:38: multiple definition of `cursor'; /tmp/cchdIJta.o:/home/dther/repos/tty-solitaire/src/game.h:38: first defined here
/usr/bin/ld: src/game.o:(.bss+0x0): multiple definition of `deck'; /tmp/cchdIJta.o:(.bss+0x0): first defined here
/usr/bin/ld: src/game.o:/home/dther/repos/tty-solitaire/src/game.h:38: multiple definition of `cursor'; /tmp/cchdIJta.o:/home/dther/repos/tty-solitaire/src/game.h:38: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:48: ttysolitaire] Error 1

@mpereira
Copy link
Owner

@dther thanks for the report. Are you able to investigate? Unfortunately I don't currently have access to a Fedora or Arch environment.

dther added a commit to dther/tty-solitaire that referenced this issue Jun 1, 2020
A gcc-10 changes the default behaviour from -fcommon to -fno-common,
which causes linking errors in some build processes.

Fixes mpereira#40.
@mpereira
Copy link
Owner

mpereira commented Jun 1, 2020

@Baggypants v1.3.0 was released with a fix for this. Thanks again for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants