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: add flag to LLD to fix gcc 8 build #1013

Merged
merged 2 commits into from May 15, 2018

Conversation

Projects
None yet
1 participant
@andrewrk
Member

andrewrk commented May 15, 2018

AX31 on IRC posted this:

/home/axel/Projects/zig/zig/deps/lld/ELF/SymbolTable.cpp: In member function ‘void lld::elf::SymbolTable::applySymbolWrap()’:
/home/axel/Projects/zig/zig/deps/lld/ELF/SymbolTable.cpp:190:47: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class lld::elf::Symbol’ with no trivial copy-assignment; use copy-initialization instead [-Werror=class-memaccess]
       memcpy(Real, W.Real, sizeof(SymbolUnion));
                                               ^
In file included from /home/axel/Projects/zig/zig/deps/lld/ELF/SymbolTable.cpp:20:
/home/axel/Projects/zig/zig/deps/lld/ELF/Symbols.h:38:7: note: ‘class lld::elf::Symbol’ declared here
 class Symbol {
       ^~~~~~

This patch fixed it for them.

If this passes the tests on all platforms I'll merge.

@andrewrk

This comment has been minimized.

Member

andrewrk commented May 15, 2018

How can we reconcile this in a simple way?

older gcc with -Wno-class-memaccess gives
error: unknown warning option '-Wno-class-memaccess'; did you mean '-Wno-class-varargs'? [-Werror,-Wunknown-warning-option]

newer gcc without that gives error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class lld::elf::Symbol’ with no trivial copy-assignment; use copy-initialization instead [-Werror=class-memaccess]

@andrewrk

This comment has been minimized.

Member

andrewrk commented May 15, 2018

I'll try -Wno-unknown-warning-option.

@andrewrk andrewrk merged commit 3625df2 into master May 15, 2018

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@andrewrk andrewrk deleted the gcc8 branch May 15, 2018

BraedonWooding added a commit to BraedonWooding/zig that referenced this pull request May 17, 2018

build: add flag to LLD to fix gcc 8 build (ziglang#1013)
* build: add flag to LLD to fix gcc 8 build
* build: add -Wno-unknown-warning-option to work around older gcc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment