rocksdb/build_tools
Nikhil Benesch 11c5d4741a cross-platform compatibility improvements
Summary:
We've had a couple CockroachDB users fail to build RocksDB on exotic platforms, so I figured I'd try my hand at solving these issues upstream. The problems stem from a) `USE_SSE=1` being too aggressive about turning on SSE4.2, even on toolchains that don't support SSE4.2 and b) RocksDB attempting to detect support for thread-local storage based on OS, even though it can vary by compiler on the same OS.

See the individual commit messages for details. Regarding SSE support, this PR should change virtually nothing for non-CMake based builds. `make`, `PORTABLE=1 make`, `USE_SSE=1 make`, and `PORTABLE=1 USE_SSE=1 make` function exactly as before, except that SSE support will be automatically disabled when a simple SSE4.2-using test program fails to compile, as it does on OpenBSD. (OpenBSD's ports GCC supports SSE4.2, but its binutils do not, so `__SSE_4_2__` is defined but an SSE4.2-using program will fail to assemble.) A warning is emitted in this case. The CMake build is modified to support the same set of options, except that `USE_SSE` is spelled `FORCE_SSE42` because `USE_SSE` is rather useless now that we can automatically detect SSE support, and I figure changing options in the CMake build is less disruptive than changing the non-CMake build.

I've tested these changes on all the platforms I can get my hands on (macOS, Windows MSVC, Windows MinGW, and OpenBSD) and it all works splendidly. Let me know if there's anything you object to—I obviously don't mean to break any of your build pipelines in the process of fixing ours downstream.
Closes https://github.com/facebook/rocksdb/pull/2199

Differential Revision: D5054042

Pulled By: yiwu-arbug

fbshipit-source-id: 938e1fc665c049c02ae15698e1409155b8e72171
2017-05-15 16:15:38 -07:00
..
amalgamate.py New amalgamation target 2015-10-01 08:29:31 +13:00
build_detect_platform cross-platform compatibility improvements 2017-05-15 16:15:38 -07:00
cont_integration.sh Fix the directory path for RocksDB repo 2016-12-27 22:24:16 -08:00
dependencies.sh Set VALGRIND_VER 2017-05-01 16:35:15 -07:00
dependencies_4.8.1.sh Introduce Lua Extension: RocksLuaCompactionFilter 2016-11-16 15:39:12 -08:00
dockerbuild.sh
error_filter.py Run release build for CLANG and GCC 4.8.1 in pre-commit tests too 2016-07-20 13:46:32 -07:00
fb_compile_mongo.sh
fbcode_config.sh portable sched_getcpu calls 2017-05-10 12:29:23 -07:00
fbcode_config4.8.1.sh portable sched_getcpu calls 2017-05-10 12:29:23 -07:00
format-diff.sh updated solution if "make format" command fails 2017-03-21 11:09:10 -07:00
gnu_parallel Testing out parallel sandcastle changes 2016-07-27 11:58:57 -07:00
make_new_version.sh Pass in remote as a param to branch creation script 2017-04-13 16:12:04 -07:00
make_package.sh Put lib files into suitable path in RPM package 2017-05-15 14:05:46 -07:00
precommit_checker.py Use gcc-4.9-glibc-2.20-fb python in precommit_checker 2017-02-03 13:39:18 -08:00
regression_build_test.sh Remove disableDataSync option 2017-02-13 11:09:13 -08:00
rocksdb-lego-determinator non_shm CI should run tests on /tmp 2017-03-23 15:24:12 -07:00
run_ci_db_test.ps1 Fix suite exclisions 2017-05-10 11:12:38 -07:00
update_dependencies.sh Change Build Env to gcc-5 2017-04-14 11:12:56 -07:00
version.sh Version librocksdb.so 2017-01-24 11:09:10 -08:00