From f1668cec5f6ae3ad2b6fea07ba11654d6a8db370 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 17 Jul 2021 13:01:19 +0200 Subject: [PATCH] Disable BFD support by default. * Change: In /CMakeLists.txt, add an USE_LIBBFD option to enable the link against the BFD library. Latest versions seems to have changed their API. * Change: In bootstrap/ccp.by & builder/Builder.py, add an option "--bfd" (and self._bfd) to enable BFD support. --- bootstrap/builder/Builder.py | 3 +++ bootstrap/ccb.py | 2 ++ crlcore/CMakeLists.txt | 7 +++++-- hurricane/CMakeLists.txt | 7 +++++-- oroshi/CMakeLists.txt | 5 ++++- unicorn/CMakeLists.txt | 6 +++++- unittests/CMakeLists.txt | 5 ++++- 7 files changed, 28 insertions(+), 7 deletions(-) diff --git a/bootstrap/builder/Builder.py b/bootstrap/builder/Builder.py index b3240ee0..d5323f9f 100644 --- a/bootstrap/builder/Builder.py +++ b/bootstrap/builder/Builder.py @@ -39,6 +39,7 @@ class Builder: self._macports = False self._devtoolset = 0 self._llvmtoolset = 0 + self._bfd = "OFF" self._qt5 = False self._openmp = False self._enableShared = "ON" @@ -72,6 +73,7 @@ class Builder: if value: self._noSystemBoost = True elif attribute == "llvmtoolset": self._llvmtoolset = value + elif attribute == "bfd": self._bfd = value elif attribute == "qt5": self._qt5 = value elif attribute == "openmp": self._openmp = value elif attribute == "enableDoc": self._enableDoc = value @@ -190,6 +192,7 @@ class Builder: #, "-D", "BOOST_INCLUDEDIR:STRING=/usr/include/boost169" #, "-D", "BOOST_LIBRARYDIR:STRING=/usr/lib64/boost169" ] + if self._bfd: command += [ "-D", "USE_LIBBFD:STRING=%s" % self._bfd ] if self._qt5: command += [ "-D", "WITH_QT5:STRING=TRUE" ] if self._openmp: command += [ "-D", "WITH_OPENMP:STRING=TRUE" ] diff --git a/bootstrap/ccb.py b/bootstrap/ccb.py index 030360ad..fc130c09 100755 --- a/bootstrap/ccb.py +++ b/bootstrap/ccb.py @@ -211,6 +211,7 @@ parser.add_option ( "--macports" , action="store_true" , parser.add_option ( "--devtoolset" , action="store" , type="int" , dest="devtoolset" , help="Build against TUV Dev Toolset N." ) parser.add_option ( "--llvm-toolset" , action="store" , type="int" , dest="llvmtoolset" , help="Build against TUV Dev LLVM Toolset N." ) parser.add_option ( "--qt5" , action="store_true" , dest="qt5" , help="Build against Qt 5 (default: Qt 4)." ) +parser.add_option ( "--bfd" , action="store_true" , dest="bfd" , help="Build against Qt 5 (default: Qt 4)." ) parser.add_option ( "--openmp" , action="store_true" , dest="openmp" , help="Enable the use of OpenMP in Gcc." ) parser.add_option ( "--ninja" , action="store_true" , dest="ninja" , help="Use Ninja instead of UNIX Makefile." ) parser.add_option ( "--clang" , action="store_true" , dest="clang" , help="Force use of Clang C/C++ compiler instead of system default." ) @@ -289,6 +290,7 @@ else: if options.macports: builder.macports = True if options.devtoolset: builder.devtoolset = options.devtoolset if options.llvmtoolset: builder.llvmtoolset = options.llvmtoolset + if options.bfd: builder.bfd = "ON" if options.qt5: builder.qt5 = True if options.openmp: builder.openmp = True if options.makeArguments: builder.makeArguments = options.makeArguments diff --git a/crlcore/CMakeLists.txt b/crlcore/CMakeLists.txt index 74c3905f..b13f4331 100644 --- a/crlcore/CMakeLists.txt +++ b/crlcore/CMakeLists.txt @@ -7,7 +7,8 @@ cmake_minimum_required(VERSION 2.8.9) - OPTION(BUILD_DOC "Build the documentation (latex+doxygen)" OFF) + OPTION(BUILD_DOC "Build the documentation (latex+doxygen)" OFF) + option(USE_LIBBFD "Link with BFD libraries to print stack traces" OFF) list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) @@ -21,6 +22,9 @@ setup_boost(program_options python regex wave) setup_qt() + if (USE_LIBBFD) + find_package(Libbfd) + endif() find_package(LibXml2 REQUIRED) find_package(PythonLibs 2 REQUIRED) find_package(PythonSitePackages REQUIRED) @@ -31,7 +35,6 @@ find_package(VLSISAPD REQUIRED) find_package(HURRICANE REQUIRED) find_package(Libexecinfo REQUIRED) - find_package(Libbfd) #include(UseLATEX) find_package(Doxygen) diff --git a/hurricane/CMakeLists.txt b/hurricane/CMakeLists.txt index e875ab64..a210b386 100644 --- a/hurricane/CMakeLists.txt +++ b/hurricane/CMakeLists.txt @@ -5,7 +5,8 @@ set(ignoreVariables "${CMAKE_INSTALL_DIR}") - option(BUILD_DOC "Build the documentation (doxygen)" OFF) + option(BUILD_DOC "Build the documentation (doxygen)" OFF) + option(USE_LIBBFD "Link with BFD libraries to print stack traces" OFF) cmake_minimum_required(VERSION 2.8.9) @@ -26,7 +27,9 @@ find_package(PythonSitePackages REQUIRED) find_package(VLSISAPD REQUIRED) find_package(Libexecinfo REQUIRED) - find_package(Libbfd) + if (USE_LIBBFD) + find_package(Libbfd) + endif() find_package(Doxygen) add_subdirectory(src) diff --git a/oroshi/CMakeLists.txt b/oroshi/CMakeLists.txt index 2cfa5f79..dd8b8635 100644 --- a/oroshi/CMakeLists.txt +++ b/oroshi/CMakeLists.txt @@ -3,6 +3,7 @@ project(OROSHI) cmake_minimum_required(VERSION 2.4.0) + option(USE_LIBBFD "Link with BFD libraries to print stack traces" OFF) set(ignoreVariables "${CMAKE_INSTALL_DIR}") @@ -14,7 +15,9 @@ setup_sysconfdir("${CMAKE_INSTALL_PREFIX}") setup_boost(program_options filesystem python) - find_package(Libbfd) + if (USE_LIBBFD) + find_package(Libbfd) + endif() find_package(PythonLibs 2 REQUIRED) find_package(PythonSitePackages REQUIRED) find_package(HURRICANE REQUIRED) diff --git a/unicorn/CMakeLists.txt b/unicorn/CMakeLists.txt index a2eba8d3..590fa7b2 100644 --- a/unicorn/CMakeLists.txt +++ b/unicorn/CMakeLists.txt @@ -2,6 +2,8 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0) project(UNICORN) + + option(USE_LIBBFD "Link with BFD libraries to print stack traces" OFF) cmake_minimum_required(VERSION 2.8.9) @@ -16,7 +18,9 @@ setup_boost(program_options python regex) setup_qt() - find_package(Libbfd) + if (USE_LIBBFD) + find_package(Libbfd) + endif() find_package(LibXml2 REQUIRED) find_package(PythonLibs 2 REQUIRED) find_package(PythonSitePackages REQUIRED) diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index ca89f830..a8dab5bf 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -2,6 +2,7 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0) project(UNITTEST) + option(USE_LIBBFD "Link with BFD libraries to print stack traces" OFF) cmake_minimum_required(VERSION 2.8.9) @@ -19,7 +20,9 @@ setup_boost(program_options python regex wave) setup_qt() - find_package(Libbfd) + if (USE_LIBBFD) + find_package(Libbfd) + endif() find_package(Libexecinfo REQUIRED) find_package(PythonLibs 2 REQUIRED) find_package(PythonSitePackages REQUIRED)