liberasurecode
liberasurecode copied to clipboard
Fails to build liberasurecode when CC=gcc
On MacOS, if gcc is installed, CC=gcc cargo build
or simply cargo build
fails with the error log like below:
https://gist.github.com/koba-e964/c9ff5ab39b0ef510d0a893af54f4c0a4
Probably this is because of adding an option -Wno-error=address-of-packed-member
here, which is valid in clang but not in gcc.
https://github.com/frugalos/liberasurecode/blob/c853227905aab1822b3275c2405ecbc632bc1b05/install_deps.sh#L44-L46
Fixing this should be easy. Should I do this?
Thank you for your detailed report! Instead of you, I'm working on this problem.
I can reproduce this problem on my Mac 10.13.6 as follows:
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.13.6
BuildVersion: 17G5019
$ /usr/local/bin/gcc-8 --version # I installed gcc by `brew install gcc`
gcc-8 (Homebrew GCC 8.3.0) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ CC=/usr/local/bin/gcc-8 cargo build
Compiling libc v0.2.51
Compiling liberasurecode v1.0.2 (/Users/uezato/frugalos/liberasurecode)
error: failed to run custom build command for `liberasurecode v1.0.2 (/Users/uezato/frugalos/liberasurecode)`
process didn't exit successfully: `/Users/uezato/frugalos/liberasurecode/target/debug/build/liberasurecode-03e82565d13e637a/build-script-build` (exit code: 101)
...
$ grep "address-of-packed-member" ./target/debug/build/liberasurecode-8278567ad8c5b89e/out/build/liberasurecode/config.log
cc1: error: -Werror=address-of-packed-member: no option -Waddress-of-packed-member