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

Build Fails on GCC 10 #25

Closed
gardotd426 opened this issue May 21, 2020 · 4 comments · Fixed by #26
Closed

Build Fails on GCC 10 #25

gardotd426 opened this issue May 21, 2020 · 4 comments · Fixed by #26

Comments

@gardotd426
Copy link

Trying to build this on an up-to-date Arch or Manjaro (or other Arch derivative) will fail, with the following errors:

cc -Isrc/include `pkg-config --cflags gtk+-3.0` src/*.c src/ss/*.c -o zenmonitor `pkg-config --libs gtk+-3.0` -lm -no-pie -Wall
/usr/bin/ld: /tmp/ccWa2q8z.o:(.bss+0x0): multiple definition of `display_coreid'; /tmp/ccTxz7QB.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccP4n6ZC.o:(.bss+0x0): multiple definition of `display_coreid'; /tmp/ccTxz7QB.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccidjqdB.o:(.bss+0x0): multiple definition of `display_coreid'; /tmp/ccTxz7QB.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccN5s0Yz.o:(.bss+0x0): multiple definition of `display_coreid'; /tmp/ccTxz7QB.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccA63nlA.o:(.bss+0x0): multiple definition of `display_coreid'; /tmp/ccTxz7QB.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile:6: build] Error 1

This is with both the zenmonitor and zenmonitor-git AUR packages, as well as trying to build directly from this repo. The issue is GCC 10, after downgrading to 9.3, the build succeeds and the program works perfectly.

@birdie-github
Copy link

Add -fcommon to your CFLAGS. That should fix it.

@gardotd426
Copy link
Author

CFLAGS=-fcommon make
cc -Isrc/include `pkg-config --cflags gtk+-3.0` src/*.c src/ss/*.c -o zenmonitor `pkg-config --libs gtk+-3.0` -lm -no-pie -Wall
/usr/bin/ld: /tmp/cc1I06we.o:(.bss+0x0): multiple definition of `display_coreid'; /tmp/ccdYIWOe.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccWhTeye.o:(.bss+0x0): multiple definition of `display_coreid'; /tmp/ccdYIWOe.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccGAfYne.o:(.bss+0x0): multiple definition of `display_coreid'; /tmp/ccdYIWOe.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccfvkBLf.o:(.bss+0x0): multiple definition of `display_coreid'; /tmp/ccdYIWOe.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/cc3YksPd.o:(.bss+0x0): multiple definition of `display_coreid'; /tmp/ccdYIWOe.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile:6: build] Error 1

@hehtkz
Copy link

hehtkz commented May 23, 2020

@gardotd426 put -fcommon on the makefile at the end of the cc command in build section

@Maxr1998
Copy link
Contributor

Maxr1998 commented Jun 2, 2020

Maintainer of the AUR package zenmonitor-git here, I added a patch so it builds again now.
I will however also open a PR in a minute that fixes the issue upstream.

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.

4 participants