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

fails to build with gcc-10 #973

Closed
p3ck opened this issue Feb 12, 2020 · 19 comments
Closed

fails to build with gcc-10 #973

p3ck opened this issue Feb 12, 2020 · 19 comments

Comments

@p3ck
Copy link

p3ck commented Feb 12, 2020

Hello,

Has anyone tried to build this with gcc 10? GCC 10 added -fno-common so that means you can't have multiple definitions for symbols.

I think you should be able to see the build log here:
https://kojipkgs.fedoraproject.org//work/tasks/3341/41463341/build.log

In case you can't see that here is the important part:

g++ -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mtune=generic-armv7-a -mabi=aapcs-linux -mfloat-abi=hard  -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o shairport-sync shairport.o rtsp.o mdns.o common.o rtp.o player.o alac.o audio.o loudness.o activity_monitor.o  mdns_avahi.o   audio_alsa.o   audio_stdout.o audio_pipe.o audio_dummy.o   audio_pa.o          -lpulse  -lasound  -lavahi-common -lavahi-client -lsoxr  -lssl -lcrypto  -lconfig  -lpopt  -lm -lpthread -lrt 
make[2]: Leaving directory '/builddir/build/BUILD/shairport-sync-3.3.5'
/usr/bin/ld: rtsp.o:/builddir/build/BUILD/shairport-sync-3.3.5/rtsp.h:7: multiple definition of `conns'; shairport.o:/builddir/build/BUILD/shairport-sync-3.3.5/rtsp.h:7: first defined here
/usr/bin/ld: rtsp.o:/builddir/build/BUILD/shairport-sync-3.3.5/rtsp.h:6: multiple definition of `playing_conn'; shairport.o:/builddir/build/BUILD/shairport-sync-3.3.5/rtsp.h:6: first defined here
/usr/bin/ld: rtsp.o:/builddir/build/BUILD/shairport-sync-3.3.5/common.h:412: multiple definition of `r64_mutex'; shairport.o:/builddir/build/BUILD/shairport-sync-3.3.5/common.h:412: first defined here
/usr/bin/ld: rtsp.o:/builddir/build/BUILD/shairport-sync-3.3.5/common.h:377: multiple definition of `the_conn_lock'; shairport.o:/builddir/build/BUILD/shairport-sync-3.3.5/common.h:377: first defined here
/usr/bin/ld: rtsp.o:/builddir/build/BUILD/shairport-sync-3.3.5/common.h:362: multiple definition of `config_file_stuff'; shairport.o:/builddir/build/BUILD/shairport-sync-3.3.5/common.h:362: first defined here
/usr/bin/ld: rtsp.o:/builddir/build/BUILD/shairport-sync-3.3.5/common.h:361: multiple definition of `config'; shairport.o:/builddir/build/BUILD/shairport-sync-3.3.5/common.h:361: first defined here
/usr/bin/ld: rtsp.o:/builddir/build/BUILD/shairport-sync-3.3.5/common.h:359: multiple definition of `main_thread_id'; shairport.o:/builddir/build/BUILD/shairport-sync-3.3.5/common.h:359: first defined here
/usr/bin/ld: rtsp.o:/builddir/build/BUILD/shairport-sync-3.3.5/common.h:352: multiple definition of `fp_time_at_last_debug_message'; shairport.o:/builddir/build/BUILD/shairport-sync-3.3.5/common.h:352: first defined here
@mikebrady
Copy link
Owner

Thanks for the heads-up. It would be nice to take advantage of the new feature, but in the meantime, does adding the flag -fcommon allow the build to complete successfully?

@mikebrady
Copy link
Owner

Are you testing on upcoming builds of Fedora? If so, could you point in the direction of where you’re getting them from, please?

@p3ck
Copy link
Author

p3ck commented Feb 12, 2020

Hi Mike,

I believe you can do scratch builds in fedora as long as you have a fedoraproject.org account.

fedpkg build --target f33 --scratch --srpm /home/bpeck/Sandbox/shairport-sync/shairport-sync-3.3.5-1.fc33.src.rpm

I found this doc about porting to gcc10 as well. https://gcc.gnu.org/gcc-10/porting_to.html

I've patched the current build to use -fcommon until you can properly port.

@mikebrady
Copy link
Owner

I couldn’t get any joy with a Fedora 32 image in a VM, but Ubuntu 20.04 did allow me to install and use gcc-10. It seems that the fcommon flag is set by default but it does allow you to specify fno-common. it looks pretty straightforward to bring Shairport Sync up to date.

@mikebrady
Copy link
Owner

Actually, correct me if I'm wrong, the fno-common flag is available on GCC 8.3. I guess it's set to -fcommon by default.

@p3ck
Copy link
Author

p3ck commented Feb 14, 2020

this is my "fix" for now..

diff -Nur shairport-sync-3.3.5/Makefile.am shairport-sync-3.3.5.fixed/Makefile.am
--- shairport-sync-3.3.5/Makefile.am	2019-11-13 17:17:51.000000000 -0500
+++ shairport-sync-3.3.5.fixed/Makefile.am	2020-02-12 08:55:25.606471346 -0500
@@ -18,8 +18,8 @@
   AM_CXXFLAGS = -I/usr/local/include -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\"
   AM_CFLAGS = -Wno-multichar -Wall -Wextra -pthread -DSYSCONFDIR=\"$(sysconfdir)\"
 else
-  AM_CXXFLAGS = -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\"
-  AM_CFLAGS = -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\"
+  AM_CXXFLAGS = -fcommon -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\"
+  AM_CFLAGS = -fcommon -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\"
 endif
 endif

@mikebrady
Copy link
Owner

Thanks. Actually, I've just pushed an update to the development branch that, I think, does the business. If you got a chance to check it, it would be great.

@p3ck
Copy link
Author

p3ck commented Feb 14, 2020

This looks good.

https://koji.fedoraproject.org/koji/taskinfo?taskID=41504998

@mikebrady
Copy link
Owner

This looks good.

https://koji.fedoraproject.org/koji/taskinfo?taskID=41504998

Thanks Bill. Is that with your fix or is it with the update?

@p3ck
Copy link
Author

p3ck commented Feb 15, 2020

Assuming I did this correctly I pulled from 0902cdf, removed the gcc10 I originally put in place and built a srpm from that. Then I submitted to f33 build target in koji and everything built as expected.
Thanks again.

@mikebrady
Copy link
Owner

Just to be clear – this is for Fedora 33, not Fedora 32, right?

@p3ck
Copy link
Author

p3ck commented Feb 18, 2020

Hi Mike,
It's broken for F32 as well. I can do a git release or I can wait till you have a proper release if it's soon. Right now the Fedora build system is complaining to me that it's not going to be part of f32 release if I don't fix it soon.

@mikebrady
Copy link
Owner

Okay, thanks. How soon is soon?

@p3ck
Copy link
Author

p3ck commented Feb 18, 2020

Feb 25th

@mikebrady
Copy link
Owner

Okay, well it's out on the development branch, and if we can wait a couple of days to see if any oddities are reported then I can push out 3.3.6. How does that sound?

@p3ck
Copy link
Author

p3ck commented Feb 18, 2020

Sounds like a plan. I'll do a build this weekend coming up with either the development branch or with 3.3.6 if you release it by then.

Thanks again!

@mikebrady
Copy link
Owner

Hi Bill. I just updated the master branch release to 3.3.6.

@p3ck
Copy link
Author

p3ck commented Feb 21, 2020 via email

@github-actions
Copy link

This issue has been inactive for 60 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.

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

No branches or pull requests

2 participants