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

Does not compile on gcc 8.3 with no-rtti (pmr) #109

Open
greenrobot opened this issue Jan 19, 2024 · 4 comments
Open

Does not compile on gcc 8.3 with no-rtti (pmr) #109

greenrobot opened this issue Jan 19, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@greenrobot
Copy link

For crosscompiling, we rely on older compiler versions.

Because of pmr (we do not do anything with pmr), compilation fails.

Does it require pmr internally, or only if the user uses it? Maybe it could "just" be disabled completely? I think pmr is not a great dependency to have: while compilers support C++17 for a long time, pmr only came with gcc 9. And relying on "experimental" API (pre gcc 9) does not make one very comfortable, either.

In file included from ../../../../../../../objectbox/src/main/cpp/external/unordered-dense/unordered_dense.h:107,
                 from ...
/opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/8.3.0/experimental/memory_resource: In instantiation of 'bool std::experimental::fundamentals_v2::pmr::__resource_adaptor_imp<_Alloc>::do_is_equal(const std::experimental::fundamentals_v2::pmr::memory_resource&) const [with _Alloc = std::allocator<char>]':
/opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/8.3.0/experimental/memory_resource:320:7:   required from here
/opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/8.3.0/experimental/memory_resource:322:13: error: 'dynamic_cast' not permitted with -fno-rtti
  auto __p = dynamic_cast<const __resource_adaptor_imp*>(&__other);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gmake[3]: *** [src/CMakeFiles/something.dir/hnsw/HnswTypes.cpp.o] Error 1
gmake[3]: *** Waiting for unfinisgmake[3]: *** [src/CMakeFiles/something.dir/hnsw/HnswTypes.cpp.o] Error 1
hed jobs....
In file included from ../../../../../../../external/unordered-dense/unordered_dense.h:107,
                 from ...

/opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/8.3.0/experimental/memory_resource: In instantiation of 'bool std::experimental::fundamentals_v2::pmr::__resource_adaptor_imp<_Alloc>::do_is_equal(const std::experimental::fundamentals_v2::pmr::memory_resource&) const [with _Alloc = std::allocator<char>]':
/opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/8.3.0/experimental/memory_resource:320:7:   required from here
/opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/8.3.0/experimental/memory_resource:322:13: error: 'dynamic_cast' not permitted with -fno-rtti
  auto __p = dynamic_cast<const __resource_adaptor_imp*>(&__other);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@greenrobot greenrobot added the bug Something isn't working label Jan 19, 2024
@greenrobot greenrobot changed the title Does not compile on gcc 8.3 with no-rtti ( Does not compile on gcc 8.3 with no-rtti (pmr) Jan 19, 2024
@martinus
Copy link
Owner

martinus commented Oct 6, 2024

Can't reproduce, I can successfully compile with gcc 8.4. Does that work for you?

@martinus martinus closed this as completed Oct 6, 2024
@greenrobot
Copy link
Author

Can't reproduce, I can successfully compile with gcc 8.4. Does that work for you?

Well, it does not work with 8.3 as noted in the issue.

For crosscompiling, we rely on older compiler versions.

Our workaround is to use using typdefs and not use unordered_dense at all for gcc8.3 targets.

As you already closed this issue, I'll assume that do not have plans to support anything newer than 8.4. Would you consider a compiler check or noting this in the documentation?

@martinus
Copy link
Owner

martinus commented Oct 7, 2024

I can add a macro to disable inclusion of PMR stuff if that's enough? Then you'll need to define that before including unordered_dense.h. I'm just wondering why you can't upgrade to at least 8.4, as it seems to work there.

@greenrobot
Copy link
Author

I can add a macro to disable inclusion of PMR stuff if that's enough?

Sounds good.

I'm just wondering why you can't upgrade to at least 8.4

It's not in our hands. Sometimes there are corporate policies and eternal processes that dictate what to use... 🤷

@martinus martinus reopened this Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants