Skip to content

Commit

Permalink
Fix builds on systems with RTLD_DEFAULT enabled (#91)
Browse files Browse the repository at this point in the history
Summary:
The following PR addresses various build issues that occur when GHC does load symbols strictly at build times. exi's did an investigation in #90. GHC on NixOS is compiled with _GNU_SOURCE leading to dlsym using RTLD_DEFAULT, causing strict loading. For hsthrift his means various symbols cannot be found at compile time and error out.

With the following stack I am able to build hsthrift and Glean NixOS. However I have **not** tested it on any other platform just yet (Notable the docker image).

I want to highlight commit 83ed60e, since it moves Utils/Executor.cpp to cpp/Executor.cpp and I am not sure if that's okay.

The rest of the PR should be straight forward.

This is branch includes PR #89 and should cleanly rebase if needed.

Pull Request resolved: #91

Reviewed By: pepeiborra

Differential Revision: D37779175

Pulled By: dsp

fbshipit-source-id: ddd593f77b7c99eb037c9e469bf2a5c62c76fe98
  • Loading branch information
dsp authored and facebook-github-bot committed Jul 12, 2022
1 parent c03ef99 commit d8feb92
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
File renamed without changes.
9 changes: 5 additions & 4 deletions common/util/fb-util.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ library
Util.Control.Exception
Util.Control.Monad
Util.Defer
Util.Dll
-- Util.Dll
Util.Encoding
Util.Err
Util.EventBase
Expand All @@ -112,7 +112,7 @@ library
Util.FilePath
Util.Function
Util.Graph
Util.GFlags
-- Util.GFlags
Util.HSE
Util.HUnit
Util.HashMap.Strict
Expand Down Expand Up @@ -157,6 +157,7 @@ library
cpp/HsStruct.cpp
cpp/IOBuf.cpp
cpp/EventBaseDataplane.cpp
cpp/Executor.cpp
Util/AsanAlloc.cpp
-- Util/GFlags.cpp

Expand All @@ -169,7 +170,7 @@ library
cpp/memory.h
cpp/wrap.h
Util/AsanAlloc.h

include-dirs: .
hs-source-dirs: .

Expand Down Expand Up @@ -230,7 +231,7 @@ library
-- by ghc, because we depend on a Haskell package (mangle).
hsc2hs-options: --cc=g++ --lflag=-lstdc++ --cflag=-D__HSC2HS__=1 --cflag=-std=c++17

pkgconfig-depends: libfolly, libglog
pkgconfig-depends: libfolly, libglog, libevent, fmt
extra-libraries: double-conversion, gflags

common test-common
Expand Down
7 changes: 6 additions & 1 deletion cpp-channel/thrift-cpp-channel.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,16 @@ library
hsc2hs-options: --cc=g++ --lflag=-lstdc++ --cflag=-D__HSC2HS__=1 --lflag=-lboost_context --lflag=-latomic --cflag=-std=c++17
include-dirs: .

pkgconfig-depends: libfolly, fmt, openssl, libsodium
pkgconfig-depends: fmt, openssl, libsodium, libzstd, zlib
extra-libraries:
thriftcpp2
thriftmetadata
thriftprotocol
-- Note that the order here matters, as thriftanyrep and thrifttyperep
-- depend on thrifttype.
thrifttyperep
thriftanyrep
thrifttype
transport
rpcmetadata
concurrency
Expand Down

0 comments on commit d8feb92

Please sign in to comment.