From 56e1539493ec73223672523dd870a32989d1f9da Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 9 Aug 2023 10:49:20 -0400 Subject: [PATCH 1/3] Fix #2421, adjust dependencies on table lib Instead of having the intermediate table library build as part of the "all" target, attach it as a dependency under the custom rule. This way it will only be built in the context of the cfetables top level target, not both. --- cmake/arch_build.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index 04c44d97a..e94f86fe4 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -324,7 +324,7 @@ function(add_cfe_tables TABLE_FQNAME TBL_DEFAULT_SRC_FILES) # Add a custom target to generate the config file add_custom_target(generate_table_${TGT}_${APP_NAME}_${TABLE_BASENAME} - DEPENDS "${TABLE_RULEFILE}" + DEPENDS "${TABLE_RULEFILE}" ${TABLE_LIBNAME} ) add_dependencies(cfetables generate_table_${TGT}_${APP_NAME}_${TABLE_BASENAME}) @@ -335,7 +335,7 @@ function(add_cfe_tables TABLE_FQNAME TBL_DEFAULT_SRC_FILES) # On older versions one may not reference the TARGET_OBJECTS property from the custom command. # As a workaround this is built into a static library, and then the desired object is extracted # before passing to elf2cfetbl. It is roundabout but it works. - add_library(${TABLE_LIBNAME} STATIC ${TABLE_SELECTED_SRCS}) + add_library(${TABLE_LIBNAME} STATIC EXCLUDE_FROM_ALL ${TABLE_SELECTED_SRCS}) target_compile_definitions(${TABLE_LIBNAME} PRIVATE CFE_CPU_NAME=${TGT} ) From 0cdb4e42ed903806fd8566d899327e7f19a7b045 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 10 Aug 2023 15:45:09 -0400 Subject: [PATCH 2/3] Fix #2423, avoid use of abspath make function The abspath function does not work in GNU make v3.80, which is still used as it is packaged with the Wind River tools as part of VxWorks 6.x. The $(abspath ...) function was used in two places related to generating tables - first for extraction of the ELF file from an intermediate lib, second for conversion of that ELF file to a table file. In the first case, the path should already be absolute, as it comes from CMake. In the second case, the path should always be relative, because it is intended to match another pattern rule starting with "elf/%". For the second rule, prefixing with $(CURDIR) should achieve the same effect. --- cmake/tables/elf2cfetbl_rules.mk | 9 +++++++-- cmake/tables/tabletool_rule.mk | 11 ++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/cmake/tables/elf2cfetbl_rules.mk b/cmake/tables/elf2cfetbl_rules.mk index 21e63e84d..c17443579 100644 --- a/cmake/tables/elf2cfetbl_rules.mk +++ b/cmake/tables/elf2cfetbl_rules.mk @@ -1,5 +1,10 @@ # Rule for traditional CFE table generation via elf2cfetbl +# The dependency of this target should always be an absolute pathname to +# the intermediate library file as it is generated by a CMake script via +# the TARGET_FILE property. Therefore, the same path should still work +# after the "cd" command. The "cd" is so the ar tool writes the object file +# into a separate dir, in case of similarly-named files on different cpus. elf/%: - @mkdir -pv $(dir $(@)) - cd $(dir $(@)) && $(AR) x $(abspath $(<)) $(notdir $(@)) + @mkdir -pv "$(dir $(@))" + cd "$(dir $(@))" && $(AR) x "$(<)" "$(notdir $(@))" diff --git a/cmake/tables/tabletool_rule.mk b/cmake/tables/tabletool_rule.mk index 0e2e178f2..6b34c7561 100644 --- a/cmake/tables/tabletool_rule.mk +++ b/cmake/tables/tabletool_rule.mk @@ -4,7 +4,12 @@ cfetables: @echo "Table build completed" -#%.tbl: $(TBLTOOL) +# The dependency of this rule should always be a relative path starting with elf/, +# at least with the current rule generator script, so it matches the elf/% pattern rule. +# But because elf2cfetbl only writes its output to the current working dir, it has to be run +# after changing dirs into the staging area. Thus the path to the elf file needs to be adjusted. +# Ideally this chould be done with the $(abspath f...) function but this doesn't exist in older versions. +# As a workaround, $CURDIR is used. staging/%.tbl: - @mkdir -pv $(dir $(@)) - cd $(dir $(@)) && $(TBLTOOL) $(TBLTOOL_FLAGS) $(abspath $(^)) + @mkdir -pv "$(dir $(@))" + cd "$(dir $(@))" && $(TBLTOOL) $(TBLTOOL_FLAGS) "$(CURDIR)/$(<)" From d2d77fea6310b6925a5ce51417604c47f39a138e Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 15 Aug 2023 11:21:44 +0000 Subject: [PATCH 3/3] Updating documentation and version numbers for v7.0.0-rc4+dev362 --- CHANGELOG.md | 12 ++++++++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8ce6b7be..f08dc99b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Development Build: v7.0.0-rc4+dev362 +- 'Fix #2421, adjust dependencies on table lib' +- 'Fix #2423, avoid use of abspath make function' +- See: + + ## Development Build: v7.0.0-rc4+dev356 - 'Fix #2415, use correct object extension in table build' - See: @@ -109,6 +115,12 @@ ## Development Build: v7.0.0-rc4+dev197 - Remove # Changelog +## Development Build: v7.0.0-rc4+dev362 +- 'Fix #2421, adjust dependencies on table lib' +- 'Fix #2423, avoid use of abspath make function' +- See: + + ## Development Build: v7.0.0-rc4+dev356 - 'Fix #2415, use correct object extension in table build' - See: diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 78597cc63..d9c6df8cf 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 356 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 362 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */