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

Merged
merged 2 commits into from May 15, 2018
Merged

build: add flag to LLD to fix gcc 8 build #1013

merged 2 commits into from May 15, 2018

Conversation

andrewrk
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member Author

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

@andrewrk andrewrk merged commit 3625df2 into master May 15, 2018
@andrewrk andrewrk deleted the gcc8 branch May 15, 2018 20:21
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 this pull request may close these issues.

None yet

1 participant