elf32 dependencies get packed

I’m using CMake 3.20.

I have a 64-bit Linux application built by running CMake scripts. After I ran CPack to create a binary package, I found 32-bit system libraries were pulled into the package, while it should pull 64-bit libraries. For example, /lib/libstdc++.so.6.0.19 was copied into the package, while it should have copied /lib64/libstdc++.so.6.0.19. Here is my code for creating the package:
#install rules:
install(TARGETS flashtechSim RUNTIME DESTINATION bin)
install(CODE [[
file(GET_RUNTIME_DEPENDENCIES
RESOLVED_DEPENDENCIES_VAR dpdsList
UNRESOLVED_DEPENDENCIES_VAR unrslved
EXECUTABLES $<TARGET_FILE:flashtechSim>)
file(INSTALL ${dpdsList} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib FOLLOW_SYMLINK_CHAIN)
]]
)

#Creating distribution package:
include(CPack)

There was mention elsewhere (I thought it was an issue, but it’s probably elsewhere on Discourse) that we probably need to check arch flags on libraries we find and skip those that don’t make sense. We should definitely make an issue to track it though.

Cc: @kyle.edwards

That previous convo was here: file(GET_RUNTIME_DEPENDENCIES) issues

1 Like