Commit 18b0b2d
boost manifest: build from source on Linux with -fPIC
Summary:
Drop the [debs] satisfier (libboost-all-dev) and add cxxflags/cflags=-fPIC
under [b2.args.os=linux] so that boost's static archives are PIC and can
be linked into downstream shared libraries (specifically rebalancer's
librebalancer.so).
The Ubuntu libboost-all-dev package ships static archives built without
-fPIC, which fails at link time with R_X86_64_PC32 / 'recompile with
-fPIC' errors when the consumer is a shared library. Building boost
ourselves with cflags=-fPIC fixes this. Boost's b2 build does not pick
PIC up from CMAKE_POSITION_INDEPENDENT_CODE because it is not CMake-driven.
Note: this changes behavior for every consumer of fbcode_builder that
runs with --allow-system-packages on Debian/Ubuntu — they will now build
boost from source instead of installing libboost-all-dev. Build time for
boost is ~5-10 min on a 16-core runner. If this is unacceptable for any
consumer, the right follow-up is a per-consumer way to keep the system
satisfier (e.g. opt-in [debs] block keyed off a context flag).
Reviewed By: bigfootjon
Differential Revision: D103767938
fbshipit-source-id: 06275b77b8635f1a5742e1289e0ecc6e762e70c71 parent 7808582 commit 18b0b2d
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
| |||
0 commit comments