From: Wez Furlong Date: Thu, 15 Dec 2016 04:03:32 +0000 (-0800) Subject: add folly::init to libfolly for OSS build X-Git-Tag: v2016.12.19.00~16 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8d0d6318e0333dc6145b9f5e7c921ab5628109b7;p=folly.git add folly::init to libfolly for OSS build Summary: We use this in eden and this avoids needing to patch the homebrew recipe. I've also made the use of the folly symbolizer specific to the facebook internal build of folly, because it fails to compile in the Linux OSS build too. Reviewed By: yfeldblum Differential Revision: D4292166 fbshipit-source-id: b69153be8ab9cc461bc7f456248e73972ba7f461 --- diff --git a/folly/Makefile.am b/folly/Makefile.am index 92bf03a0..bb87d512 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -433,6 +433,7 @@ libfolly_la_SOURCES = \ IPAddressV4.cpp \ IPAddressV6.cpp \ LifoSem.cpp \ + init/Init.cpp \ io/Compression.cpp \ io/Cursor.cpp \ io/IOBuf.cpp \ diff --git a/folly/init/Init.cpp b/folly/init/Init.cpp index 77bee684..434593aa 100644 --- a/folly/init/Init.cpp +++ b/folly/init/Init.cpp @@ -19,11 +19,8 @@ #include #include -#if !defined(__APPLE__) && !defined(_WIN32) -#define USE_FOLLY_SYMBOLIZER 1 -#endif -#ifdef USE_FOLLY_SYMBOLIZER +#ifdef FOLLY_USE_SYMBOLIZER #include #endif #include @@ -31,7 +28,7 @@ namespace folly { void init(int* argc, char*** argv, bool removeFlags) { -#ifdef USE_FOLLY_SYMBOLIZER +#ifdef FOLLY_USE_SYMBOLIZER // Install the handler now, to trap errors received during startup. // The callbacks, if any, can be installed later folly::symbolizer::installFatalSignalHandler(); @@ -44,7 +41,7 @@ void init(int* argc, char*** argv, bool removeFlags) { auto programName = argc && argv && *argc > 0 ? (*argv)[0] : "unknown"; google::InitGoogleLogging(programName); -#ifdef USE_FOLLY_SYMBOLIZER +#ifdef FOLLY_USE_SYMBOLIZER // Don't use glog's DumpStackTraceAndExit; rely on our signal handler. google::InstallFailureFunction(abort); #endif @@ -53,7 +50,7 @@ void init(int* argc, char*** argv, bool removeFlags) { // things now" phase. folly::SingletonVault::singleton()->registrationComplete(); -#ifdef USE_FOLLY_SYMBOLIZER +#ifdef FOLLY_USE_SYMBOLIZER // Actually install the callbacks into the handler. folly::symbolizer::installFatalSignalCallbacks(); #endif