[med-svn] [Git][med-team/ctk][upstream] New upstream version (2026.09.02)
Fernando Hueso (@ferdymercury)
gitlab at salsa.debian.org
Thu Sep 3 08:24:42 BST 2026
Fernando Hueso pushed to branch upstream at Debian Med / ctk
Commits:
65818934 by Fernando Hueso at 2026-09-03T07:07:40+00:00
New upstream version (2026.09.02)
- - - - -
11 changed files:
- − Libs/Core/CMake/TestBFD/CMakeLists.txt
- − Libs/Core/CMake/TestBFD/TestBFD.cpp
- − Libs/Core/CMake/ctkMacroBFDCheck.cmake
- Libs/Core/CMakeLists.txt
- Libs/Core/Testing/Cpp/CMakeLists.txt
- − Libs/Core/Testing/Cpp/ctkBinaryFileDescriptorTest1.cpp
- − Libs/Core/Testing/Cpp/ctkBinaryFileDescriptorTestHelper.cpp
- − Libs/Core/ctkBinaryFileDescriptor.cpp
- − Libs/Core/ctkBinaryFileDescriptor.h
- − Libs/Core/ctk_library_options.cmake
- Libs/Core/target_libraries.cmake
Changes:
=====================================
Libs/Core/CMake/TestBFD/CMakeLists.txt deleted
=====================================
@@ -1,14 +0,0 @@
-cmake_minimum_required(VERSION 3.20.6)
-
-project(TestBFD)
-
-# Sanity checks
-if("${BFD_LIBRARY_NAME}" STREQUAL "")
- message(FATAL_ERROR "error: ${v} variable is an empty string !")
-endif()
-
-unset(BFD_LIBRARY CACHE)
-find_library(BFD_LIBRARY ${BFD_LIBRARY_NAME})
-
-ctk_add_executable_utf8(TestBFD TestBFD.cpp)
-target_link_libraries(TestBFD ${BFD_LIBRARY})
=====================================
Libs/Core/CMake/TestBFD/TestBFD.cpp deleted
=====================================
@@ -1,19 +0,0 @@
-
-#include <bfd.h>
-
-// STD includes
-#include <cstdlib>
-
-int main(int /*argc*/, char * /*argv*/[])
-{
- bfd *abfd = 0;
- asymbol *symbol = 0;
- asection *p = 0;
- bfd_init();
- abfd = bfd_openr("/path/to/library", 0);
- if (!abfd)
- {
- return false;
- }
- return EXIT_SUCCESS;
-}
=====================================
Libs/Core/CMake/ctkMacroBFDCheck.cmake deleted
=====================================
@@ -1,83 +0,0 @@
-#
-# ctkMacroBFDCheck.cmake - After this file is included into your main CMake script,
-# HAVE_BFD will be defined if libbfd is available.
-#
-
-if(CTK_LIB_Core_WITH_BFD_STATIC AND CTK_LIB_Core_WITH_BFD_SHARED)
- message(FATAL_ERROR "error: Options WITH_BFD_STATIC and WITH_BFD_SHARED are mutually exclusive ! "
- "hint: Enable either WITH_BFD_STATIC or WITH_BFD_SHARED.")
-endif()
-
-if(NOT CTK_BUILD_SHARED_LIBS AND CTK_LIB_Core_WITH_BFD_SHARED)
- message(FATAL_ERROR "error: Options CTK_BUILD_SHARED_LIBS and WITH_BFD_STATIC are mutually exclusive ! "
- "hint: Disable WITH_BFD_SHARED and enable WITH_BFD_STATIC if needed.")
-endif()
-
-set(BFD_LIBRARIES)
-unset(HAVE_BFD CACHE)
-
-set(TestBFD_BUILD_LOG "${CMAKE_CURRENT_BINARY_DIR}/CMake/TestBFD-build-log.txt")
-
-if(CTK_LIB_Core_WITH_BFD_STATIC OR CTK_LIB_Core_WITH_BFD_SHARED)
- if(WIN32)
- message(FATAL_ERROR "error: Options WITH_BFD_STATIC or WITH_BFD_SHARED are not support on Windows !")
- endif()
-
- if(NOT WIN32)
- include(CheckIncludeFile)
- CHECK_INCLUDE_file(bfd.h HAVE_BFD_HEADER)
- if(NOT HAVE_BFD_HEADER)
- file(WRITE ${TestBFD_BUILD_LOG} "Could *NOT* find the required header file: bfd.h")
- endif()
-
- set(BFD_LIBRARY_NAME libbfd.a)
- set(TestBFD_LIBRARY_MODE STATIC)
- if(CTK_LIB_Core_WITH_BFD_SHARED)
- set(BFD_LIBRARY_NAME libbfd${CMAKE_SHARED_LIBRARY_SUFFIX})
- set(TestBFD_LIBRARY_MODE SHARED)
- endif()
- unset(BFD_LIBRARY CACHE)
- find_library(BFD_LIBRARY ${BFD_LIBRARY_NAME})
- if(NOT BFD_LIBRARY)
- file(WRITE ${TestBFD_BUILD_LOG} "Could *NOT* find the required bfd library: ${BFD_LIBRARY_NAME}")
- endif()
-
- if(HAVE_BFD_HEADER AND BFD_LIBRARY)
- # make sure we can build with libbfd
- #message(STATUS "Checking libbfd")
- try_compile(HAVE_BFD
- ${CMAKE_CURRENT_BINARY_DIR}/CMake/TestBFD
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestBFD
- TestBFD
- CMAKE_FLAGS
- -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
- -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
- -DBFD_LIBRARY_NAME:STRING=${BFD_LIBRARY_NAME}
- OUTPUT_VARIABLE OUTPUT)
- file(WRITE ${TestBFD_BUILD_LOG} ${OUTPUT})
- #message(${OUTPUT})
-
- if(HAVE_BFD)
- set(BFD_LIBRARIES ${BFD_LIBRARY})
- endif()
- endif()
- endif()
-
-endif()
-
-if(CTK_LIB_Core_WITH_BFD_SHARED AND NOT HAVE_BFD)
- message(WARNING "warning: CTKCore: Failed to enable BFD support. Disabling CTKCore WITH_BFD_SHARED library option. "
- "See ${TestBFD_BUILD_LOG} for more details.")
- set(CTK_LIB_Core_WITH_BFD_SHARED OFF CACHE BOOL "Enable CTKCore Library WITH_BFD_SHARED option" FORCE)
-endif()
-if(CTK_LIB_Core_WITH_BFD_STATIC AND NOT HAVE_BFD)
- message(WARNING "warning: CTKCore: Failed to enable BFD support. Disabling CTKCore WITH_BFD_STATIC library option. "
- "See ${TestBFD_BUILD_LOG} for more details.")
- set(CTK_LIB_Core_WITH_BFD_STATIC OFF CACHE BOOL "Enable CTKCore Library WITH_BFD_STATIC option" FORCE)
-endif()
-
-if(HAVE_BFD)
- message(STATUS "CTKCore: BFD support enabled [${BFD_LIBRARIES}]")
-else()
- message(STATUS "CTKCore: BFD support disabled")
-endif()
=====================================
Libs/Core/CMakeLists.txt
=====================================
@@ -7,9 +7,6 @@ project(CTKCore)
# CMake modules
set(CMAKE_MODULE_PATH ${CTKCore_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH})
-# CMake Macros
-include(CMake/ctkMacroBFDCheck.cmake) # HAVE_BFD will be set to True if it applies
-
#
# See CTK/CMake/ctkMacroBuildLib.cmake for details
#
@@ -97,13 +94,6 @@ set(KIT_SRCS
ctkSetName.h
)
-if(HAVE_BFD)
- list(APPEND KIT_SRCS
- ctkBinaryFileDescriptor.cpp
- ctkBinaryFileDescriptor.h
- )
-endif()
-
# Abstract class should not be wrapped !
set_source_files_properties(
ctkAbstractJob.h
=====================================
Libs/Core/Testing/Cpp/CMakeLists.txt
=====================================
@@ -53,11 +53,6 @@ set(KITTests_SRCS
ctkWorkflowTest2.cpp
ctkWorkflowTest3.cpp
)
-if(HAVE_BFD)
- list(APPEND KITTests_SRCS
- ctkBinaryFileDescriptorTest1.cpp
- )
-endif()
include_directories(
${CMAKE_SOURCE_DIR}/Libs/Testing
@@ -87,10 +82,6 @@ set(Tests_Helpers_SRCS
ctkSingletonTestHelper.h
)
-if(HAVE_BFD)
- ctk_add_executable_utf8(ctkBinaryFileDescriptorTestHelper ctkBinaryFileDescriptorTestHelper.cpp)
-endif()
-
if(MSVC)
add_definitions( /D _CRT_SECURE_NO_WARNINGS)
endif()
@@ -131,9 +122,6 @@ SIMPLE_TEST( ctkAbstractQObjectFactoryTest1 )
if(CMAKE_BUILD_TYPE MATCHES "Debug")
SIMPLE_TEST( ctkBackTraceTest )
endif()
-if(HAVE_BFD)
- SIMPLE_TEST( ctkBinaryFileDescriptorTest1 $<TARGET_FILE:ctkBinaryFileDescriptorTestHelper> )
-endif()
SIMPLE_TEST( ctkBooleanMapperTest )
SIMPLE_TEST( ctkCallbackTest1 )
SIMPLE_TEST( ctkCommandLineParserTest1 )
=====================================
Libs/Core/Testing/Cpp/ctkBinaryFileDescriptorTest1.cpp deleted
=====================================
@@ -1,119 +0,0 @@
-/*=========================================================================
-
- Library: CTK
-
- Copyright (c) Kitware Inc.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0.txt
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-=========================================================================*/
-
-// Qt includes
-#include <QFile>
-
-// CTK includes
-#include "ctkBinaryFileDescriptor.h"
-
-// STD includes
-#include <cstdlib>
-#include <iostream>
-
-//-----------------------------------------------------------------------------
-int ctkBinaryFileDescriptorTest1(int argc, char * argv[])
-{
- if (argc <= 1)
- {
- std::cerr << "Missing argument" << std::endl;
- return EXIT_FAILURE;
- }
- QString filePath(argv[1]);
-
- if (!QFile::exists(filePath))
- {
- std::cerr << "Line " << __LINE__ << " - "
- << "filePath [" << qPrintable(filePath)
- << "] do *NOT* exist" << std::endl;
- return EXIT_FAILURE;
- }
-
- ctkBinaryFileDescriptor bfd;
- if (bfd.load())
- {
- // Should fail to load without any valid filename
- std::cerr << "Line " << __LINE__ << " - "
- << "Problem with load() method" << std::endl;
- return EXIT_FAILURE;
- }
- if (!bfd.unload())
- {
- // Unload inconditionnally return True
- std::cerr << "Line " << __LINE__ << " - "
- << "Problem with unload() method" << std::endl;
- return EXIT_FAILURE;
- }
- if (bfd.isLoaded())
- {
- std::cerr << "Line " << __LINE__ << " - "
- << "Problem with isLoaded() method" << std::endl;
- return EXIT_FAILURE;
- }
- if (!bfd.fileName().isEmpty())
- {
- std::cerr << "Line " << __LINE__ << " - "
- << "Problem with fileName() method" << std::endl;
- return EXIT_FAILURE;
- }
-
- bfd.setFileName(filePath);
-
- if (bfd.fileName() != filePath)
- {
- std::cerr << "Line " << __LINE__ << " - "
- << "Problem with fileName() method" << std::endl;
- return EXIT_FAILURE;
- }
-
- if (!bfd.load())
- {
- // Should succeed since a valid filename is provided
- std::cerr << "Line " << __LINE__ << " - "
- << "Problem with load() method" << std::endl;
- return EXIT_FAILURE;
- }
-
- void * main_pointer = bfd.resolve("main");
- if (!main_pointer)
- {
- std::cerr << "Line " << __LINE__ << " - "
- << "Problem with resolve() method - "
- << "Failed to revolve 'main' symbol !" << std::endl;
- return EXIT_FAILURE;
- }
-
- void * mtBlancElevationInMeters_pointer = bfd.resolve("MtBlancElevationInMeters");
- int * mtBlancElevationInMeters = reinterpret_cast<int*>(mtBlancElevationInMeters_pointer);
- if (!mtBlancElevationInMeters)
- {
- std::cerr << "Line " << __LINE__ << " - "
- << "Failed to case 'mtBlancElevationInMeters' pointer !" << std::endl;
- return EXIT_FAILURE;
- }
- if (*mtBlancElevationInMeters != 4810)
- {
- std::cerr << "Line " << __LINE__ << " - "
- << "Failed to invoke function associated with symbol 'MtBlancElevationInMeters' !" << std::endl;
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-}
=====================================
Libs/Core/Testing/Cpp/ctkBinaryFileDescriptorTestHelper.cpp deleted
=====================================
@@ -1,41 +0,0 @@
-/*=========================================================================
-
- Library: CTK
-
- Copyright (c) Kitware Inc.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0.txt
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-=========================================================================*/
-
-// STD includes
-#include <iostream>
-#include <cstdlib>
-
-#ifdef WIN32
-# define BFD_TEST_HELPER_EXPORT __declspec(dllexport)
-#else
-# define BFD_TEST_HELPER_EXPORT
-#endif
-
-extern "C" {
-
- BFD_TEST_HELPER_EXPORT int MtBlancElevationInMeters = 4810;
-}
-
-int main(int /*argc*/, char* /*argv*/[])
-{
- std::cout << "Mt Blanc elevation is " << MtBlancElevationInMeters
- << " meters" << std::endl;
- return EXIT_SUCCESS;
-}
=====================================
Libs/Core/ctkBinaryFileDescriptor.cpp deleted
=====================================
@@ -1,214 +0,0 @@
-/*=========================================================================
-
- Library: CTK
-
- Copyright (c) Kitware Inc.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0.txt
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-=========================================================================*/
-/*=========================================================================
-
- Portions (c) Copyright Brigham and Women's Hospital (BWH)
- All Rights Reserved.
-
- See http://www.slicer.org/copyright/copyright.txt for details.
-
- Program: Module Description Parser
-
-=========================================================================*/
-
-// CTK includes
-#include "ctkBinaryFileDescriptor.h"
-#include "ctkPimpl.h"
-
-// BinUtils includes
-#include <bfd.h>
-
-// STD includes
-#include <cstdlib>
-#include <utility>
-#include <vector>
-
-//-----------------------------------------------------------------------------
-class ctkBinaryFileDescriptorPrivate
-{
-public:
- // Convenient typedefs
- typedef std::pair<asection*, void* > MemorySectionType;
- typedef std::vector<MemorySectionType> MemorySectionContainer;
-
- ctkBinaryFileDescriptorPrivate();
-
- /// Resolves a symbol
- void* resolve(const char * symbol);
-
- MemorySectionContainer Sections;
- bfd * BFD;
-
- QString FileName;
-};
-
-// --------------------------------------------------------------------------
-// ctkBinaryFileDescriptorPrivate methods
-
-// --------------------------------------------------------------------------
-ctkBinaryFileDescriptorPrivate::ctkBinaryFileDescriptorPrivate()
-{
- this->BFD = 0;
-}
-
-// --------------------------------------------------------------------------
-void* ctkBinaryFileDescriptorPrivate::resolve(const char * symbol)
-{
- if (!this->BFD)
- {
- return 0;
- }
-
- void *addr = 0;
-
- // Get the symbol table
- long storageNeeded = bfd_get_symtab_upper_bound(this->BFD);
- asymbol ** symbolTable = reinterpret_cast<asymbol **>(malloc(storageNeeded));
-
- long numberOfSymbols = bfd_canonicalize_symtab(this->BFD, symbolTable);
-
- // Run through the symbol table, looking for the requested symbol
- for (int i = 0; i < numberOfSymbols; i++)
- {
- if (strcmp(symbol, symbolTable[i]->name) == 0)
- {
- // Found the symbol, get the section pointer
- asection *p = bfd_get_section(symbolTable[i]);
-
- // Do we have this section already?
- MemorySectionContainer::iterator sit;
- for (sit = this->Sections.begin(); sit != this->Sections.end(); ++sit)
- {
- if ((*sit).first == p)
- {
- break;
- }
- }
-
- PTR mem;
- if (sit == this->Sections.end())
- {
- // Get the contents of the section
- bfd_size_type sz = bfd_get_section_size (p);
- mem = malloc (sz);
- if (bfd_get_section_contents(this->BFD, p, mem, static_cast<file_ptr>(0), sz))
- {
- this->Sections.push_back( MemorySectionType(p, mem) );
- }
- else
- {
- // Error reading section
- free(mem);
- break;
- }
- }
- else
- {
- // pull the start of the section block from the cache
- mem = const_cast<void*>((*sit).second);
- }
-
- // determine the address of this section
- addr = reinterpret_cast<char *>(mem)
- + (bfd_asymbol_value(symbolTable[i]) - bfd_asymbol_base(symbolTable[i]));
- break;
- }
- }
-
- // cleanup. just delete the outer vector for the symbol table
- free(symbolTable);
-
- return addr;
-}
-
-// --------------------------------------------------------------------------
-// ctkBinaryFileDescriptor methods
-
-// --------------------------------------------------------------------------
-ctkBinaryFileDescriptor::ctkBinaryFileDescriptor(): d_ptr(new ctkBinaryFileDescriptorPrivate)
-{
-}
-
-// --------------------------------------------------------------------------
-ctkBinaryFileDescriptor::ctkBinaryFileDescriptor(const QString& _fileName):
- d_ptr(new ctkBinaryFileDescriptorPrivate)
-{
- Q_D(ctkBinaryFileDescriptor);
- d->FileName = _fileName;
-}
-
-// --------------------------------------------------------------------------
-ctkBinaryFileDescriptor::~ctkBinaryFileDescriptor()
-{
-}
-
-// --------------------------------------------------------------------------
-CTK_GET_CPP(ctkBinaryFileDescriptor, QString, fileName, FileName);
-CTK_SET_CPP(ctkBinaryFileDescriptor, const QString&, setFileName, FileName);
-
-// --------------------------------------------------------------------------
-bool ctkBinaryFileDescriptor::isLoaded() const
-{
- Q_D(const ctkBinaryFileDescriptor);
- return (d->BFD != 0);
-}
-
-// --------------------------------------------------------------------------
-bool ctkBinaryFileDescriptor::load()
-{
- Q_D(ctkBinaryFileDescriptor);
-
- bfd_init();
- bfd * abfd = bfd_openr(d->FileName.toUtf8(), NULL);
- if (!abfd)
- {
- return false;
- }
-
- /* make sure it's an object file */
- if (!bfd_check_format (abfd, bfd_object))
- {
- bfd_close(abfd);
- return false;
- }
-
- d->BFD = abfd;
- return true;
-}
-
-// --------------------------------------------------------------------------
-bool ctkBinaryFileDescriptor::unload()
-{
- Q_D(ctkBinaryFileDescriptor);
-
- if (d->BFD)
- {
- bfd_close(d->BFD);
- d->BFD = 0;
- }
- return true;
-}
-
-// --------------------------------------------------------------------------
-void* ctkBinaryFileDescriptor::resolve(const char * symbol)
-{
- Q_D(ctkBinaryFileDescriptor);
- return d->resolve(symbol);
-}
=====================================
Libs/Core/ctkBinaryFileDescriptor.h deleted
=====================================
@@ -1,76 +0,0 @@
-/*=========================================================================
-
- Library: CTK
-
- Copyright (c) Kitware Inc.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0.txt
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-=========================================================================*/
-/*=========================================================================
-
- Portions (c) Copyright Brigham and Women's Hospital (BWH)
- All Rights Reserved.
-
- See http://www.slicer.org/copyright/copyright.txt for details.
-
- Program: Module Description Parser
-
-=========================================================================*/
-
-#ifndef __ctkBinaryFileDescriptor_h
-#define __ctkBinaryFileDescriptor_h
-
-// Qt includes
-#include <QString>
-#include <QScopedPointer>
-
-#include "ctkCoreExport.h"
-
-
-class ctkBinaryFileDescriptorPrivate;
-
-/// \ingroup Core
-/// Allows to resolve global symbols contained into an executable.
-/// Implementation valid only for unix-like systems (Linux, Mac, ...)
-class CTK_CORE_EXPORT ctkBinaryFileDescriptor
-{
-public:
- ctkBinaryFileDescriptor();
- ctkBinaryFileDescriptor(const QString& _fileName);
- virtual ~ctkBinaryFileDescriptor();
-
- QString fileName()const;
- void setFileName(const QString& _fileName);
-
- /// Load the object file containing the symbols
- bool load();
-
- /// Unload / close the object file
- bool unload();
-
- bool isLoaded() const;
-
- /// Get the address of a symbol in memory
- void* resolve(const char * symbol);
-
-protected:
- QScopedPointer<ctkBinaryFileDescriptorPrivate> d_ptr;
-
-private:
- Q_DECLARE_PRIVATE(ctkBinaryFileDescriptor);
- Q_DISABLE_COPY(ctkBinaryFileDescriptor);
-
-};
-
-#endif
=====================================
Libs/Core/ctk_library_options.cmake deleted
=====================================
@@ -1,14 +0,0 @@
-#
-# See CMake/ctkMacroAddCtkLibraryOptions.cmake
-#
-# This file should list of options available for considered CTK library
-# For example: MYOPT1:OFF MYOPT2:ON
-#
-
-# Note: Options WITH_BFD_SHARED and WITH_BFD_STATIC are mutually exclusive.
-# Enabling both options will trigger a configuration error.
-
-set(ctk_library_options
- WITH_BFD_SHARED:OFF
- WITH_BFD_STATIC:OFF
- )
=====================================
Libs/Core/target_libraries.cmake
=====================================
@@ -5,5 +5,4 @@
#
set(target_libraries
- BFD_LIBRARIES
)
View it on GitLab: https://salsa.debian.org/med-team/ctk/-/commit/65818934e914df8aa843c84e064867a4c2a2b95d
--
View it on GitLab: https://salsa.debian.org/med-team/ctk/-/commit/65818934e914df8aa843c84e064867a4c2a2b95d
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260903/89de6020/attachment-0001.htm>
More information about the debian-med-commit
mailing list