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 failure caused by address-of-packed-member with GCC9 #10

Open
shinnya opened this issue Jul 7, 2019 · 1 comment
Open

Build failure caused by address-of-packed-member with GCC9 #10

shinnya opened this issue Jul 7, 2019 · 1 comment

Comments

@shinnya
Copy link
Contributor

shinnya commented Jul 7, 2019

Description

cargo build generates the following error:

+ patch -p1
+ make install
erasurecode_helpers.c: In function 'get_chksum':
erasurecode_helpers.c:499:25: error: taking address of packed member of 'struct fragment_metadata' may result in an unaligned pointer value [-Werror=address-of-packed-member]
  499 |     return (uint32_t *) header->meta.chksum;
      |                         ^~~~~~
erasurecode_helpers.c: In function 'get_metadata_chksum':
erasurecode_helpers.c:530:12: error: taking address of packed member of 'struct fragment_header_s' may result in an unaligned pointer value [-Werror=address-of-packed-member]
  530 |     return (uint32_t *) &header->metadata_chksum;
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:713: liberasurecode_la-erasurecode_helpers.lo] Error 1

Since GCC9, GCC reports warnings about taking the address of a packed member. See https://reviews.freebsd.org/D9069?id=23667.

Environment

GCC9 on Arch Linux

Solution

Add -Wno-error=address-of-packed-member to $CFLAGS when built with gcc9 at install_deps.sh.

@shinnya
Copy link
Contributor Author

shinnya commented Jul 7, 2019

It seems that this issue has been resolve already on upstream. See openstack/liberasurecode@3564b71.

shinnya added a commit to shinnya/liberasurecode that referenced this issue Jul 7, 2019
shinnya added a commit to shinnya/liberasurecode that referenced this issue Jul 27, 2019
shinnya added a commit to shinnya/liberasurecode that referenced this issue Jul 27, 2019
shinnya added a commit to shinnya/liberasurecode that referenced this issue Jul 27, 2019
shinnya added a commit to shinnya/liberasurecode that referenced this issue Jul 27, 2019
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.

1 participant