You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
On most CMake platforms the generated object file names are simply the file name (including the .c) concatenated with CMAKE_C_OUTPUT_EXTENSION. So, for example, on table build for sample_app, the file sample_app_tbl.c gets compiled into sample_app_tbl.c.o which can then be used to call elf2cfetbl.
Apparently this relationship is not guaranteed, there is at least one example of a platform where this gets compiled to sample_app_tbl.o instead of sample_app_tbl.c.o.
To Reproduce
Attempt to build on a platform that does not follow the expected pattern. Tables will fail to build with a failure to open the object file due to the name mismatch.
Expected behavior
Table should build successfully.
Code snips
I traced this back to a workaround that was put in for older CMake, which assumes the name of the object file:
The preferred/correct way to do this is to use the $<TARGET_OBJECTS:...> generator expression, but this only works in newer CMake versions. The workaround was to assume a file name based on the expected pattern, which works most of the time, but there are exceptions.
System observed on:
Originally reported by @klystron78 when building for VxWorks 7.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
Use a shell glob instead of assuming a specific file name, this
should pick up the object file no matter how it was named, as
long as it ends in ${CMAKE_C_OUTPUT_EXTENSION}.
It does rely on/assume there is only one such file, so this might
break if one changes the name of a table without a clean rebuild.
A proper fix would still be to use TARGET_OBJECTS generator expression,
but that can't happen until Ubuntu 18.04 (w/ ver 3.10) is EOL.
This uses a sub-script to call elf2cfetbl which avoid relying
on a shell glob. More complicated but should be more robust if/when
someone renames a table.
This uses a sub-script to call elf2cfetbl which avoid relying
on a shell glob. More complicated but should be more robust if/when
someone renames a table.
Note: A proper/simpler fix would still be to use TARGET_OBJECTS generator
expression, but that can't happen until Ubuntu 18.04 (w/ ver 3.10) or older
versions are no longer supported.
Describe the bug
On most CMake platforms the generated object file names are simply the file name (including the .c) concatenated with CMAKE_C_OUTPUT_EXTENSION. So, for example, on table build for sample_app, the file
sample_app_tbl.c
gets compiled intosample_app_tbl.c.o
which can then be used to callelf2cfetbl
.Apparently this relationship is not guaranteed, there is at least one example of a platform where this gets compiled to
sample_app_tbl.o
instead ofsample_app_tbl.c.o
.To Reproduce
Attempt to build on a platform that does not follow the expected pattern. Tables will fail to build with a failure to open the object file due to the name mismatch.
Expected behavior
Table should build successfully.
Code snips
I traced this back to a workaround that was put in for older CMake, which assumes the name of the object file:
cFE/cmake/arch_build.cmake
Lines 200 to 201 in 73c338d
The preferred/correct way to do this is to use the
$<TARGET_OBJECTS:...>
generator expression, but this only works in newer CMake versions. The workaround was to assume a file name based on the expected pattern, which works most of the time, but there are exceptions.System observed on:
Originally reported by @klystron78 when building for VxWorks 7.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: