Closed seelabs closed 3 months ago
I was able to modify folly to successfully compile with clang-10 and the clang standard c++ library on linux. Here are the changes I had to make:
throw()
to memrchr in both portability/String.{h,cpp} (ref: https://github.com/facebook/folly/blob/master/folly/portability/String.cpp#L20)#error
about clock_gettime
(Ref: https://github.com/facebook/folly/blob/master/folly/portability/Time.cpp#L278)i.operator!=(e)
explicitly (Ref: https://github.com/facebook/folly/blob/master/folly/synchronization/HazptrDomain.h#L490)With the above changes I am able to compile a run a simple program that uses folly's coro::Task
and coro::AsyncGenerator
.
My motivation for this is to experiment with coroutines. While gcc-10 supports coroutines, the compiler often ices. So folly needs to be built with clang and the clang standard library. If anyone else see this message, to make this work the following libraries also need to be compiled with the clang standard library since they are dependencies of folly:
You are compiling using -std=c++2a
. Could you explain me in more detail how you modified https://github.com/facebook/folly/blob/master/folly/synchronization/HazptrDomain.h#L490 so that it compiles again?
@Myz Inside the function relaxed_cleanup
I made the following change:
// swd hack
#if 0
for (hazptr_priv<Atom>& priv :
hazptr_priv_singleton<Atom>::accessAllThreads()) {
priv.collect(h, t);
}
#else
{
auto&& swd_temp = hazptr_priv_singleton<Atom>::accessAllThreads();
for (auto swd_i = swd_temp.begin(), swd_e = swd_temp.end(); swd_i.operator!=(swd_e);++swd_i)
{
hazptr_priv<Atom>& priv = *swd_i;
priv.collect(h, t);
}
}
#endif
Thanks a lot, like this I might be able to add those as patches for my .deb build pipeline.
Am Do., 10. Sept. 2020 um 22:39 Uhr schrieb Scott Determan < notifications@github.com>:
@Myz https://github.com/Myz Inside the function relaxed_cleanup I made the following change:
// swd hack
if 0
for (hazptr_priv<Atom>& priv : hazptr_priv_singleton<Atom>::accessAllThreads()) { priv.collect(h, t); }
else
{ auto&& swd_temp = hazptr_priv_singleton<Atom>::accessAllThreads(); for (auto swd_i = swd_temp.begin(), swd_e = swd_temp.end(); swd_i.operator!=(swd_e);++swd_i) { hazptr_priv<Atom>& priv = *swd_i; priv.collect(h, t); } }
endif
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/folly/issues/1353#issuecomment-690713706, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFQPBTFBEVKHUKPMOUFPHDSFE2ORANCNFSM4MIXV5HQ .
Compiling the following file results in a compile errors on clang 10 on linux (compiled with -stdlib=libc++)
The errors were:
I was able to build a simple coroutine using the prereleased gcc-10 (after some minor edits to folly since coroutines are non-experimental in gcc-10), so this appears to be a clang 10 issue. I did not try with previous versions of clang.