olvaffe / percetto

Apache License 2.0
19 stars 10 forks source link

Doesn't compile with clang-11 #19

Closed Wallbraker closed 2 years ago

Wallbraker commented 3 years ago

Doesn't compile with clang-11 on Ubuntu 20.10:

Warnings:

../src/percetto.cc:568:1: warning: unused variable 'static_state_' [-Wunused-variable]
PERFETTO_DEFINE_DATA_SOURCE_STATIC_MEMBERS(PercettoDataSource);
^
perfetto-sdk/perfetto.h:9192:42: note: expanded from macro 'PERFETTO_DEFINE_DATA_SOURCE_STATIC_MEMBERS'
      perfetto::DataSource<__VA_ARGS__>::static_state_{};             \
                                         ^
../src/percetto.cc:568:1: warning: unused variable 'tls_state_' [-Wunused-variable]
perfetto-sdk/perfetto.h:9196:46: note: expanded from macro 'PERFETTO_DEFINE_DATA_SOURCE_STATIC_MEMBERS'
          perfetto::DataSource<__VA_ARGS__>::tls_state_ = nullptr
                                             ^
../src/percetto.cc:568:1: warning: unused variable 'static_state_' [-Wunused-variable]
perfetto-sdk/perfetto.h:9192:42: note: expanded from macro 'PERFETTO_DEFINE_DATA_SOURCE_STATIC_MEMBERS'
      perfetto::DataSource<__VA_ARGS__>::static_state_{};             \
                                         ^
../src/percetto.cc:568:1: warning: unused variable 'tls_state_' [-Wunused-variable]
perfetto-sdk/perfetto.h:9196:46: note: expanded from macro 'PERFETTO_DEFINE_DATA_SOURCE_STATIC_MEMBERS'
          perfetto::DataSource<__VA_ARGS__>::tls_state_ = nullptr
                                             ^

And linker errors:

/usr/bin/ld: src/libpercetto.a(meson-generated_.._perfetto.cc.o):(.data.rel.ro._ZTIZN8perfetto4base10UnixSocket8ShutdownEbE5$_126+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
/usr/bin/ld: src/libpercetto.a(meson-generated_.._perfetto.cc.o):(.data.rel.ro._ZTIZN8perfetto4base10UnixSocket8ShutdownEbE5$_127+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
/usr/bin/ld: src/libpercetto.a(meson-generated_.._perfetto.cc.o):(.data.rel.ro._ZTIZN8perfetto4base10UnixSocket21NotifyConnectionStateEbE5$_128+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
rpavlik commented 2 years ago

Not sure what changed, perhaps it's in upstream Perfetto? But it built here with Bullseye and Clang 11.0.1 and Perfetto v23.x release branch.

Wallbraker commented 2 years ago

Good enough for me.