google / packetdrill

The official Google release of packetdrill
GNU General Public License v2.0
887 stars 220 forks source link

packetdrill: fix compilation with GCC 10 #45

Closed ac000 closed 3 years ago

ac000 commented 3 years ago

When compiling with GCC 10.2 under Fedora 32 compilation failed with a bunch of messages like

/usr/bin/ld: tcp_packet.o:/tmp/packetdrill/gtests/net/packetdrill/tcp_options.h:108: multiple definition of `tcp_option'; packet_to_string.o:/tmp/packetdrill/gtests/net/packetdrill/tcp_options.h:108: first defined here ... collect2: error: ld returned 1 exit status make: *** [Makefile.common:37: packetdrill] Error 1

This is due to GCC 10 defaulting0 to -fno-common and because tcp_option is both defined and declared in tcp_option.h.

Simply removing the declaration part fixes the compilation.

Signed-off-by: Andrew Clayton andrew@digital-domain.net

nealcardwell commented 3 years ago

Thanks for the fix!

nealcardwell commented 3 years ago

Merged. Thanks for the fix!

neal

On Wed, Oct 7, 2020 at 4:01 PM Andrew Clayton notifications@github.com wrote:

When compiling with GCC 10.2 under Fedora 32 compilation failed with a bunch of messages like

/usr/bin/ld: tcp_packet.o:/tmp/packetdrill/gtests/net/packetdrill/tcp_options.h:108: multiple definition of `tcp_option'; packet_to_string.o:/tmp/packetdrill/gtests/net/packetdrill/tcp_options.h:108: first defined here ... collect2: error: ld returned 1 exit status make: *** [Makefile.common:37: packetdrill] Error 1

This is due to GCC 10 defaulting0 https://gcc.gnu.org/gcc-10/porting_to.html to -fno-common and because tcp_option is both defined and declared in tcp_option.h.

Simply removing the declaration part fixes the compilation.

Signed-off-by: Andrew Clayton andrew@digital-domain.net

You can view, comment on, or merge this pull request online at:

https://github.com/google/packetdrill/pull/45 Commit Summary

  • packetdrill: fix compilation with GCC 10

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/packetdrill/pull/45, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZHSHNM7TSTIINB5OEIGYLSJTCJBANCNFSM4SH26DFQ .