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 with LLVM 10 #44

Open
doko42 opened this issue Mar 11, 2020 · 2 comments
Open

build failure with LLVM 10 #44

doko42 opened this issue Mar 11, 2020 · 2 comments

Comments

@doko42
Copy link

doko42 commented Mar 11, 2020

fails with LLVM 10, works with LLVM 9:

$ cat x.cpp
#include <elf/elf++.hh>
int main(int argc, char *argv[]) { return 0; }

$ clang++ -std=c++11 -I/usr/include/libelfin -c x.cpp
In file included from x.cpp:1:
In file included from /usr/include/libelfin/elf/elf++.hh:9:
/usr/include/libelfin/elf/data.hh:558:22: error: cannot assign to non-static data member within const member function 'set_binding'
info = (info & 0xF) | ((unsigned char)v << 4);
~~~~ ^
/usr/include/libelfin/elf/data.hh:556:14: note: member function 'elf::Sym<elf::Elf64, Order>::set_binding' is declared const here
void set_binding(stb v) const
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

@nevun
Copy link

nevun commented Jun 10, 2020

diff --git a/elf/data.hh b/elf/data.hh
index 8085577..d7e9fb4 100644
--- a/elf/data.hh
+++ b/elf/data.hh
@@ -560,7 +560,7 @@ struct Sym<Elf64, Order>
                 return (stb)(info >> 4);
         }
 
-        void set_binding(stb v) const
+        void set_binding(stb v)
         {
                 info = (info & 0xF) | ((unsigned char)v << 4);
         }

@petterreinholdtsen
Copy link
Contributor

Hi. Any hope to have a new release with this fix in place before Christmas?

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.

3 participants