Hey Daniel, I realized that I wasn't applying the patch. Adding the virtual 
destructor in replaceable_entry.hh fixed all the compilation issues.


Thanks for your help!

________________________________
From: Daniel Carvalho <[email protected]>
Sent: Saturday, August 3, 2019 2:43:21 PM
To: Kamran Hasan <[email protected]>
Cc: Gem5 Developer List <[email protected]>
Subject: Re: [gem5-dev] Cannot build on mac anymore

Kamran,

Thank you for the feedback. Yet, I am confused; There should be no need to 
declare the virtual keyword on a derived class's destructor, since the 
destructor being virtual is a inherited trait (as long as the base's destructor 
is virtual, which is true with the new patch).

Since I am not able to reproduce the error, would you mind making sure the 
patch has been properly applied to your code, and, if the error persists, add 
the virtual keyword to both SectorBlk and SuperBlk's destructors and check if 
the issue continues?

Regards,
Daniel
Em sábado, 3 de agosto de 2019 20:09:36 GMT+2, Kamran Hasan 
<[email protected]> escreveu:



That fixed one of the errors. There are two more errors related to the 
non-virtual destructors, one with SectorBlk and one with SuperBlk



 [     CXX] X86/python/_m5/param_CopyEngine.cc -> .o

In file included from build/X86/python/_m5/param_CompressedTags.cc:1:

In file included from ext/pybind11/include/pybind11/pybind11.h:43:

In file included from ext/pybind11/include/pybind11/detail/../attr.h:13:

In file included from ext/pybind11/include/pybind11/cast.h:13:

In file included from ext/pybind11/include/pybind11/detail/../pytypes.h:12:

In file included from ext/pybind11/include/pybind11/detail/common.h:139:

In file included from 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/forward_list:176:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1880:58:
 error: destructor called on non-final 'SectorBlk' that has virtual functions

      but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor]

    _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}

                                                         ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1742:18:
 note: in instantiation of member function

      'std::__1::allocator<SectorBlk>::destroy' requested here

            {__a.destroy(__p);}

                 ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1595:14:
 note: in instantiation of function template specialization

      'std::__1::allocator_traits<std::__1::allocator<SectorBlk> 
>::__destroy<SectorBlk>' requested here

            {__destroy(__has_destroy<allocator_type, _Tp*>(), __a, __p);}

             ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:421:25:
 note: in instantiation of function template specialization

      'std::__1::allocator_traits<std::__1::allocator<SectorBlk> 
>::destroy<SectorBlk>' requested here

        __alloc_traits::destroy(__alloc(), 
_VSTD::__to_raw_pointer(--__soon_to_be_end));

                        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:364:29:
 note: in instantiation of member function 'std::__1::__vector_base<SectorBlk,

      std::__1::allocator<SectorBlk> >::__destruct_at_end' requested here

    void clear() _NOEXCEPT {__destruct_at_end(__begin_);}

                            ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:458:9:
 note: in instantiation of member function 'std::__1::__vector_base<SectorBlk,

      std::__1::allocator<SectorBlk> >::clear' requested here

        clear();

        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iterator:1427:74:
 note: in instantiation of member function

      'std::__1::__vector_base<SectorBlk, std::__1::allocator<SectorBlk> 
>::~__vector_base' requested here

    template <class _Tp, class _Alloc> friend class _LIBCPP_TEMPLATE_VIS vector;

                                                                         ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1880:64:
 note: qualify call to silence this warning

    _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}

                                                               ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1880:58:
 error: destructor called on non-final 'SuperBlk' that has virtual functions

      but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor]

    _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}

                                                         ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1742:18:
 note: in instantiation of member function

      'std::__1::allocator<SuperBlk>::destroy' requested here

            {__a.destroy(__p);}

                 ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1595:14:
 note: in instantiation of function template specialization

      'std::__1::allocator_traits<std::__1::allocator<SuperBlk> 
>::__destroy<SuperBlk>' requested here

            {__destroy(__has_destroy<allocator_type, _Tp*>(), __a, __p);}

             ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:421:25:
 note: in instantiation of function template specialization

      'std::__1::allocator_traits<std::__1::allocator<SuperBlk> 
>::destroy<SuperBlk>' requested here

        __alloc_traits::destroy(__alloc(), 
_VSTD::__to_raw_pointer(--__soon_to_be_end));

                        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:364:29:
 note: in instantiation of member function 'std::__1::__vector_base<SuperBlk,

      std::__1::allocator<SuperBlk> >::__destruct_at_end' requested here

    void clear() _NOEXCEPT {__destruct_at_end(__begin_);}

                            ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:458:9:
 note: in instantiation of member function 'std::__1::__vector_base<SuperBlk,

      std::__1::allocator<SuperBlk> >::clear' requested here

        clear();

        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iterator:1427:74:
 note: in instantiation of member function

      'std::__1::__vector_base<SuperBlk, std::__1::allocator<SuperBlk> 
>::~__vector_base' requested here

    template <class _Tp, class _Alloc> friend class _LIBCPP_TEMPLATE_VIS vector;

                                                                         ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1880:64:
 note: qualify call to silence this warning

    _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}

                                                               ^

7 warnings and 2 errors generated.

scons: *** [build/X86/python/_m5/param_CompressedTags.o] Error 1

________________________________
From: Daniel Carvalho <[email protected]>
Sent: Saturday, August 3, 2019 6:11:16 AM
To: Kamran Hasan <[email protected]>
Cc: Gem5 Developer List <[email protected]>
Subject: Re: [gem5-dev] Cannot build on mac anymore

Can you cherry-pick this patch and see if it solves your issue, Kamran?

https://gem5-review.googlesource.com/c/public/gem5/+/19808

(The answer to your question may be found here: 
https://stackoverflow.com/questions/8764353/what-does-has-virtual-method-but-non-virtual-destructor-warning-mean-durin)


Em sábado, 3 de agosto de 2019 00:21:07 GMT+2, Kamran Hasan 
<[email protected]> escreveu:


Hi,


I did a git pull and tried to build again but found that I couldn't. I also 
tried doing a clean git clone and building again but got the same error message 
that I'm pasting below. I'm running OS X Mojave (10.14.5) with Xcode 10.3. 
Before I did a git pull, I was able to build and run fine with this exact same 
setup. Any ideas on how I can fix this?


Thanks!




[ TRACING]  -> X86/debug/Cache.hh

[ TRACING]  -> X86/debug/CachePort.hh

[ENUMDECL] Clusivity -> X86/enums/Clusivity.hh

[SO PARAM] WriteAllocator -> X86/params/WriteAllocator.hh

[    CXX] X86/mem/cache/tags/base_set_assoc.cc -> .o

[ TRACING]  -> X86/debug/CacheComp.hh

[SO PARAM] CompressedTags -> X86/params/CompressedTags.hh

[SO PARAM] SectorTags -> X86/params/SectorTags.hh

[    CXX] X86/mem/cache/tags/compressed_tags.cc -> .o

[SO PARAM] FALRU -> X86/params/FALRU.hh

[    CXX] X86/mem/cache/tags/fa_lru.cc -> .o

[    CXX] X86/mem/cache/tags/sector_blk.cc -> .o

[    CXX] X86/mem/cache/tags/sector_tags.cc -> .o

[    CXX] X86/mem/cache/tags/super_blk.cc -> .o

In file included from build/X86/mem/cache/tags/compressed_tags.cc:36:

In file included from build/X86/mem/cache/tags/compressed_tags.hh:39:

In file included from 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:270:

In file included from 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__bit_reference:15:

In file included from 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:644:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1880:58:
 error: destructor called on non-final 'SectorBlk' that has virtual functions 
but non-virtual

      destructor [-Werror,-Wdelete-non-virtual-dtor]

    _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}

                                                        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1742:18:
 note: in instantiation of member function 
'std::__1::allocator<SectorBlk>::destroy' requested here

            {__a.destroy(__p);}

                ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1595:14:
 note: in instantiation of function template specialization

      'std::__1::allocator_traits<std::__1::allocator<SectorBlk> 
>::__destroy<SectorBlk>' requested here

            {__destroy(__has_destroy<allocator_type, _Tp*>(), __a, __p);}

            ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:421:25:
 note: in instantiation of function template specialization

      'std::__1::allocator_traits<std::__1::allocator<SectorBlk> 
>::destroy<SectorBlk>' requested here

        __alloc_traits::destroy(__alloc(), 
_VSTD::__to_raw_pointer(--__soon_to_be_end));

                        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:364:29:
 note: in instantiation of member function 'std::__1::__vector_base<SectorBlk,

      std::__1::allocator<SectorBlk> >::__destruct_at_end' requested here

    void clear() _NOEXCEPT {__destruct_at_end(__begin_);}

                            ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:458:9:
 note: in instantiation of member function 'std::__1::__vector_base<SectorBlk,

      std::__1::allocator<SectorBlk> >::clear' requested here

        clear();

        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iterator:1427:74:
 note: in instantiation of member function 'std::__1::__vector_base<SectorBlk,

      std::__1::allocator<SectorBlk> >::~__vector_base' requested here

    template <class _Tp, class _Alloc> friend class _LIBCPP_TEMPLATE_VIS vector;

                                                                        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1880:64:
 note: qualify call to silence this warning

    _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}

                                                              ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1880:58:
 error: destructor called on non-final 'SuperBlk' that has virtual functions 
but non-virtual

      destructor [-Werror,-Wdelete-non-virtual-dtor]

    _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}

                                                        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1742:18:
 note: in instantiation of member function 
'std::__1::allocator<SuperBlk>::destroy' requested here

            {__a.destroy(__p);}

                ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1595:14:
 note: in instantiation of function template specialization

      'std::__1::allocator_traits<std::__1::allocator<SuperBlk> 
>::__destroy<SuperBlk>' requested here

            {__destroy(__has_destroy<allocator_type, _Tp*>(), __a, __p);}

            ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:421:25:
 note: in instantiation of function template specialization

      'std::__1::allocator_traits<std::__1::allocator<SuperBlk> 
>::destroy<SuperBlk>' requested here

        __alloc_traits::destroy(__alloc(), 
_VSTD::__to_raw_pointer(--__soon_to_be_end));

                        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:364:29:
 note: in instantiation of member function 'std::__1::__vector_base<SuperBlk,

      std::__1::allocator<SuperBlk> >::__destruct_at_end' requested here

    void clear() _NOEXCEPT {__destruct_at_end(__begin_);}

                            ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:458:9:
 note: in instantiation of member function 'std::__1::__vector_base<SuperBlk,

      std::__1::allocator<SuperBlk> >::clear' requested here

        clear();

        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iterator:1427:74:
 note: in instantiation of member function 'std::__1::__vector_base<SuperBlk,

      std::__1::allocator<SuperBlk> >::~__vector_base' requested here

    template <class _Tp, class _Alloc> friend class _LIBCPP_TEMPLATE_VIS vector;

                                                                        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1880:64:
 note: qualify call to silence this warning

    _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}

                                                              ^

2 errors generated.

scons: *** [build/X86/mem/cache/tags/compressed_tags.o] Error 1

In file included from build/X86/mem/cache/tags/sector_tags.cc:36:

In file included from build/X86/mem/cache/tags/sector_tags.hh:40:

In file included from 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:500:

In file included from 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view:176:

In file included from 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string:56:

In file included from 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:644:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1880:58:
 error: destructor called on non-final 'SectorBlk' that has virtual functions 
but non-virtual

      destructor [-Werror,-Wdelete-non-virtual-dtor]

    _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}

                                                        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1742:18:
 note: in instantiation of member function 
'std::__1::allocator<SectorBlk>::destroy' requested here

            {__a.destroy(__p);}

                ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1595:14:
 note: in instantiation of function template specialization

      'std::__1::allocator_traits<std::__1::allocator<SectorBlk> 
>::__destroy<SectorBlk>' requested here

            {__destroy(__has_destroy<allocator_type, _Tp*>(), __a, __p);}

            ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:421:25:
 note: in instantiation of function template specialization

      'std::__1::allocator_traits<std::__1::allocator<SectorBlk> 
>::destroy<SectorBlk>' requested here

        __alloc_traits::destroy(__alloc(), 
_VSTD::__to_raw_pointer(--__soon_to_be_end));

                        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:364:29:
 note: in instantiation of member function 'std::__1::__vector_base<SectorBlk,

      std::__1::allocator<SectorBlk> >::__destruct_at_end' requested here

    void clear() _NOEXCEPT {__destruct_at_end(__begin_);}

                            ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:458:9:
 note: in instantiation of member function 'std::__1::__vector_base<SectorBlk,

      std::__1::allocator<SectorBlk> >::clear' requested here

        clear();

        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iterator:1427:74:
 note: in instantiation of member function 'std::__1::__vector_base<SectorBlk,

      std::__1::allocator<SectorBlk> >::~__vector_base' requested here

    template <class _Tp, class _Alloc> friend class _LIBCPP_TEMPLATE_VIS vector;

                                                                        ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1880:64:
 note: qualify call to silence this warning

    _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}

                                                              ^

1 error generated.

_______________________________________________
gem5-dev mailing list
[email protected]<mailto:[email protected]>
http://m5sim.org/mailman/listinfo/gem5-dev
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to