Closed meme closed 3 years ago
An easier way to fix it would be to change the using kv_pair decl near the line throwing the error with a dummy struct with the same alignment and casting the pointer since we don't really use the structure declaration just the offset of it in a pair.
This specific file is extremely performance critical so changing it to make double the heap allocations wouldn't be very nice.
I'll check on this later tomorrow, since I can't take an in depth look right now.
As for the cmake, I believe the CI had some issues without it since it's using outdated libs by default.
Could you try doing apt-get -yq install libc++-10-dev libc++abi-10-dev
and compiling again with the -stdlib=libc++
switch? Perhaps it's caused by the stdlib you're using since the CI passes with Clang 10.
An easier way to fix it would be to change the using kv_pair decl near the line throwing the error with a dummy struct with the same alignment and casting the pointer since we don't really use the structure declaration just the offset of it in a pair.
I see, I'll look into this and wait on you for further analysis.
As for the cmake, I believe the CI had some issues without it since it's using outdated libs by default.
Ah, might make sense if I swap that out with a version check then?
Could you try doing
apt-get -yq install libc++-10-dev libc++abi-10-dev
and compiling again with the-stdlib=libc++
switch? Perhaps it's caused by the stdblib you're using since the CI passes with Clang 10.
I am not using Debian, but I am using the latest available libraries here. I just checked the CI and it is very strange that they pass and my Clang does not. Regardless, I'll wait on you and we can discuss if this is something that we can easily fix anyway, or if I've got to find a new compiler :laughing:.
Couldn't stop myself and grabbed the laptop real quick, I've tried swapping the forward declared types, can you check if it works now?
I am not using Debian, but I am using the latest available libraries here. I just checked the CI and it is very strange that they pass and my Clang does not.
I believe your issue has to do with you using libstdc++ and not libc++ rather than a version issue but might as well fix it since it shouldn't be too big of a problem.
Unfortunately it didn't seem to help, I've provided a build trace below (note that this is the same error I experienced earlier, too):
make
I believe your issue has to do with you using libstdc++ and not libc++ rather than a version issue but might as well fix it since it shouldn't be too big of a problem.
This is likely it, yeah. I could install libc++, but I think if this is a (somewhat) straightforward fix, we might as well.
(Note that the following also occurs on GCC 10.)
I am not clear on why
-stdlib=libc++
is explicitly specified here: https://github.com/vtil-project/VTIL-Core/blob/master/VTIL-Common/CMakeLists.txt#L37-L39. Regardless, it breaks the build and causes missing includes:So it is necessary to remove that broken configuration from the
CMakeLists.txt
before you are able to reproduce the following.The forward declaration of
cache_value
here: https://github.com/vtil-project/VTIL-Core/blob/master/VTIL-SymEx/simplifier/simplifier.cpp#L94 causes errors during template expansion forstd::pair
, etc. because of the declaration order here, I definedcache_map
as follows:(And subsequently updated all accesses of cache_value to use the arrow operator.)
Then updated the map to insert values of
cache_value*
Obviously using
new
here is not the solution, but I am unfamiliar with the lifetimes of this value so I am wondering how you think this problem can best be solved.I'd be happy to make a PR to fix both Clang and GCC, just wasn't able to figure out the best way to do it.
As well, if you'd be open to adding the latest version of GCC and Clang to the CI I'd be happy to add that as well.Looks like it's already using Clang 10.