From da8a492be72ebda5a611dced8237a34b67ca3d9f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Adam=20Jeli=C5=84ski?= Date: Tue, 21 Sep 2021 10:33:26 +0200 Subject: [PATCH] _toolchain: Properly set compiler/linker executables on Gentoo MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The `test_toolchain_cxx.py` tests on Gentoo definitely use compiler and linker set with `_so_cxx`-suffixed executables. Tests use a proper executable instead of `c++` after this change. Signed-off-by: Adam Jeliński --- nmigen/_toolchain/cxx.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nmigen/_toolchain/cxx.py b/nmigen/_toolchain/cxx.py index 107cdab..9b7fce2 100644 --- a/nmigen/_toolchain/cxx.py +++ b/nmigen/_toolchain/cxx.py @@ -36,6 +36,16 @@ def build_cxx(*, cxx_sources, output_name, include_dirs, macros): linker_so=ld_cxxflags, ) + # Sometimes CCompiler is modified to have additional executable entries for compiling and + # linking CXX shared objects (e.g. on Gentoo). These executables have to be set then. + try: + cc_driver.set_executables( + compiler_so_cxx=f"{cxx} {cflags}", + linker_so_cxx=ld_cxxflags, + ) + except: + pass + for include_dir in include_dirs: cc_driver.add_include_dir(include_dir) for macro in macros: -- 2.30.2