Commit Graph

26 Commits

Author SHA1 Message Date
Teddy Reed
58ea43f536
libraries: Add libmagic to source_migration (#6023) 2019-11-09 13:49:33 -05:00
Zachary Wasserman
3ece9e9ef7 Migrate glog and gflags to source build on macOS and Windows (#5902)
Note that glog and gflags must be migrated at the same time, otherwise
linker errors are generated on macOS.
2019-11-08 23:06:09 -05:00
Stefano Bonicatti
b857409cad Fix build with Ninja on Windows (#6007) 2019-11-06 19:07:04 -05:00
Alessandro Gario
7fee358178 CMake: Update the OpenSSL formula (#5976) 2019-11-01 21:25:14 -04:00
Zachary Wasserman
7e18771f16 Migrate glibc from "facebook" dependencies (#5900) 2019-10-31 19:08:09 -04:00
Stefano Bonicatti
d2e976168d
Restore correct commit of the RapidJSON submodule (#5961) 2019-10-29 02:15:42 +01:00
Nick Anderson
b9bdcf40ce
tests: enabling certificates table sanity checks (#5914) 2019-10-27 20:45:14 -07:00
Alessandro Gario
41fb4efba1
CMake: Migrate macOS and Windows to the OpenSSL formula (#5928) 2019-10-26 14:03:31 +02:00
Teddy Reed
43357d43a3
libraries: Update RapidJSON to master 1a825d24 (#5913) 2019-10-21 22:41:49 -04:00
Zachary Wasserman
0bf2245396 Migrate rapidjson to source build on macOS and Windows (#5899) 2019-10-18 20:05:22 -04:00
kumarak
9346926030 Restore extension SDK support to osquery 4.x (#5851)
CMake utility functions(generateOsqueryExtensionGroup,addOsqueryExtensioni{Ex},
addOsqueryModule) to add extensions.

Updates the boost library submodules needed for extensions build.

Use cache variable(OSQUERY_EXTENSION_GROUP_NAME) for the grouping of extensions
and fix the linkage with osquery interface library.
2019-10-18 18:45:20 -04:00
Stefano Bonicatti
3ad7f65a0d Support source and build directory to be on different filesystems (#5907)
Instead of moving a patched submodule from source to build directory,
we copy it and then hard reset the submodule to its original HEAD.

Minor message change when a library fails to be imported.
2019-10-18 18:25:05 -04:00
Zachary Wasserman
30a7507c95
Fix shallow clone support for libraries in recent git versions (#5897)
Enables the v2 protocol which allows the repositories to be shallow
cloned without error.
2019-10-17 21:19:24 -07:00
Zachary Wasserman
c0876408fc Migrate AWS SDK CPP dependency to source build on macOS and Windows (#5889) 2019-10-16 16:20:22 -04:00
Stefano Bonicatti
7d1d486c1e Fix git command not found after first configure (#5880)
During the first configuration, the git command is searched
when submodules are initialized and it's then saved into a cache variable.
If though we delete the build folder and run configure again,
the submodules won't be initialized again, so the git command
won't be cached and visible to CMake.
Therefore we need to search for it each time.

Cleanup dead/deprecated code.
2019-10-11 23:31:31 +02:00
Alessandro Gario
225bbaf992
Integrate cppcheck and clang-tidy within the CMake project (#5730) 2019-10-08 18:17:11 +02:00
Chris Broome
99bfa342ef Fix thirdparty_*_settings target_link_libraries (#5870)
- Reorder `add_library(osquery_thirdparty_extra_c_settings INTERFACE)`
  for consistency
- Use correct target link library in osquery_thirdparty_extra_*_settings
2019-10-07 21:18:17 +02:00
adhamehab
657932cd2c Upgrade Python tools to Python3 (#5846) 2019-10-05 10:30:10 -04:00
Stefano Bonicatti
457150c94c CMake: Improve submodule patching system (#5850)
Keep patched source in the build directory instead of the source.

A new variable with the format OSQUERY_<submodule name>_ROOT_DIR
is set to the directory of where the submodule is, in case it's patched.

A new option PATCH has been added to importSourceModule
to let the patching system know that the submodule has to be patched
and which is the main submodule folder.
2019-10-01 17:47:10 -04:00
Zachary Wasserman
5cec1f4331
Upgrade SQLite to 3.29.0 on macOS and Windows (#5810)
Mitigates recent CVEs in SQLite. It was already this version on Linux.

Establish a pattern for migrating source dependency builds to macOS and Windows.
2019-09-18 15:49:27 -07:00
Alessandro Gario
b3a9342783
CMake: The AWS library was not correctly enabling OpenSSL support (#5799) 2019-09-12 20:01:46 +02:00
Stefano Bonicatti
66601db099 Fix OpenSSL build when no system ar is installed (#5782)
OpenSSL should use the ar binary provided by the custom toolchain.
Also updated the docker image to avoid installing binutils and hiding the
issue.
2019-09-09 19:19:20 -04:00
Teddy Reed
be28d9c8de
libraries: Add patch to thrift to ignore EINTR (#5776) 2019-09-08 17:41:26 -04:00
Stefano Bonicatti
0b2cd791d3 Linux custom toolchain integration (#5759)
- Always link to libc++abi.a, dl and rt.
- Add OSQUERY_TOOLCHAIN_SYSROOT option which should contain
  the path to the sysroot where the portable compiler and its libraries are in.
- Fix OpenSSL build with custom toolchain.
- Always include the custom toolchain cmake.
  Unfortunately system name detection is done when project() is called
  which is also when compiler detection is done, and we need the compiler
  to be set before that, so we always include the cmake file.
- Do not use getrandom syscall in Boost, for glibc < 2.25 support.
- Remove usage of secure_getenv and getauxval in librpm.
- Update CI to use the toolchain.
- Reflect changes in the docs.
2019-09-06 19:51:25 -04:00
Stefano Bonicatti
f6ed617394
Uniform and update CMake version to 3.14.6 (#5756)
The new version contains a fix for the FindBison module.
The docs have been updated too.
2019-09-06 22:12:13 +02:00
Alessandro Gario
6481b34e23
Refactor third-party libraries to build from source on Linux (#5706)
Add a way to compile third-party libraries from source instead of downloading prebuilt ones.
Each library source code is downloaded with git into a submodule at configure time,
in response to the find_package(library_name) CMake call,
except for OpenSSL where the official source archive is used.
Each submodule is attached to a release tag on its own upstream repository.
All the libraries are built using CMake directly, except for OpenSSL which uses a formula system,
which permits to build libraries with a separate build system
when there's no easy way to integrate it directly with CMake.

This new dependency system determines which library is fetched from where using the concept of "layers".
Currently we have three of them: source, formula, facebook,
where the last layer represents the pre-built libraries.
The provided order will be used when looking for libraries.

A system to patch submodule source code has been added and it's currently used with googletest, libudev and util-linux.
Patches should be put under libraries/cmake/source/<library name>/patches/<submodule>,
where <submodule> is often one and is "src", but in other cases, like AWS,
there are multiple with a more specific name.
If for whatever reason the submodule cloning or the patching fails,
the submodule has to be unregistered and its folder should be cleared.
This should be achievable with "git submodule deinit -f <submodule path>"

Following some other changes on existing functionality:

- Changed the CMake variable BUILD_TESTING to OSQUERY_BUILD_TESTS
  to avoid enabling tests on third party libraries.
  Due to an issue with glog the BUILD_TESTING variable
  will be always forced to OFF.
- Moved compiler and linker flags to their own file cmake/flags.cmake
- Moved all the third-party CMakeLists.txt used for pre-built libraries under libraries/cmake/facebook
- Added the --exclude-folders option to tools/format-check.py and tools/git-clang-format.py,
  so that it's possible to ignore any third party library source code.
- The format and format_check target use the new --exclude-folders option
  to exclude libraries/cmake/source from formatting.
- The test and osquery binaries are properly compiled with PIE (osquery/osquery#5611)

Co-authored-by: Stefano Bonicatti <stefano.bonicatti@gmail.com>
Co-authored-by: Teddy Reed <teddy@casualhacking.io>
2019-08-30 16:25:19 +02:00