compile fail
4kangjc opened this issue · comments
__const__
那个有点麻烦,原意是为了解决gcc对访问errno
的缓存问题(参考https://github.com/apache/incubator-brpc/blob/master/docs/cn/thread_local.md ),但是看起来这个workaround跟新版glibc冲突了。
其实这儿还有一些类似的问题,都是对tls的访问的缓存上(errno那个因为多了个函数调用,把问题变成了const这个attribute)。之前在开了tsan的情况下fiber_entity.h
里面也出过问题,后来把一些inline干掉了绕过去了。
针对这些缓存问题https://www.mail-archive.com/gcc@gcc.gnu.org/msg96208.html 有一些讨论,不过实现起来看起来有些困难。
可以试试把几个BUILD里面的extra_cppflags = ['-D__const__=']
换成extra_cppflags = ['-D__const__=hot']
,可能可以作为一个workaround的workaround。
另一种办法(preferably)是干脆不用errno
了,单独提供一个独立函数int FiberSafeGetLastError();
。然后把现在的errno
都换成调用这个函数。
这个函数的实现({ return errno; }
)放在.cc里,这样编译器在call site就没法做CSE了,保证每次都会实际访问errno
。感觉上这么搞也可以解决这个问题,然后就不用-D__const__=
了。
后面我改成这样试试看。
恩恩 好
另一种办法(preferably)是干脆不用
errno
了,单独提供一个独立函数int FiberSafeGetLastError();
。然后把现在的errno
都换成调用这个函数。这个函数的实现(
{ return errno; }
)放在.cc里,这样编译器在call site就没法做CSE了,保证每次都会实际访问errno
。感觉上这么搞也可以解决这个问题,然后就不用-D__const__=
了。后面我改成这样试试看。
这个问题好像还是存在, gcc12
./flare/base/demangle.h: In function 'std::string flare::GetTypeName(T&&) [with T = const Message&]':
./flare/base/demangle.h:33:52: error: 'nonnull' argument 'o' compared to NULL [-Werror=nonnull-compare]
33 | return Demangle(typeid(std::forward<T>(o)).name());
Ubuntu-latest workflows will use Ubuntu-22.04
actions/runner-images#6399
Ubuntu-22.04 gcc version is gcc-11
flare可能会由于catch2
的问题而导致编译失败
__const__
之前应该是改漏了,#80 试着修了一下。catch2那个似乎是opentracing跑去用clang编译了,回头看看能不能强制指定gcc试试。
嗯,__const__
已经修好了。
catch2
应该是这个问题 catchorg/Catch2#2178
GCC12 有一个 protobuf
的问题,好像是这个
protocolbuffers/protobuf#7140
GCC12 有一个
protobuf
的问题,好像是这个 protocolbuffers/protobuf#7140
改成abs_path = std::string("/");
就能编译通过
__const__
之前应该是改漏了,#80 试着修了一下。catch2那个似乎是opentracing跑去用clang编译了,回头看看能不能强制指定gcc试试。
把opentracing
的test关了吧