View Issue Details

IDProjectCategoryView StatusLast Update
0033319CommunityOCCT:Codingpublic2023-02-03 19:15
Reporterreciprocal Assigned Tokgv  
PrioritynormalSeverityminor 
Status newResolutionopen 
PlatformLinuxOSDebian 8.0 
Product Version7.7.0 
Target Version7.7.1 
Summary0033319: Coding - Static linking fails with unresolved symbols due to linking order and missing transitive dependencies
DescriptionLinking of executables DRAWEXE and ExpToCasExe fail due to incomplete static dependencies and incorrect order of linking.
Steps To ReproducePerform a static cmake build of opencascade on linux:
cmake -DBUILD_LIBRARY_TYPE Static ${OCCT_SOURCE_DIR} && make -j
TagsNo tags attached.
Test case number

Activities

git

2023-01-19 18:29

administrator   ~0112888

Branch CR33319 has been created by reciprocal.

SHA-1: 988ca7b1c18ca3237953352755e53ed0af9c4910


Detailed log of new commits:

Author: Manuel Massing
Date: Thu Jan 19 15:17:22 2023 +0100

    0033319: Build System - fix static cmake build on linux

dpasukhi

2023-01-19 22:47

developer   ~0112890

Last edited: 2023-01-19 22:55

Dear @reciprocal
Can you update "src/ExpToCasExe/EXTERNLIB" with newline in the end of the file?
And can you share more information about compiler(version)?
And if it is possible, update commiter's name with you profile name - reciprocal?

As for a commit message, please use the next template

<summary>
[ // recommended to add
<empty line>
<description>
]
So, the result is:
0033319: Coding - Static linking fails with unresolved symbols due to linking order

Updated external libs of ExpToCas with threads dependensies
Reorder ExpToCas external libs to fix problem with searching symbols

reciprocal

2023-01-20 12:27

developer   ~0112893

Hi dpasukhi,
thanks for your input.

Is OCCT:Coding in fact the right category? I couldn't find any category related to the build
system.

The real issue for the static linking problems under cmake was that link dependencies
for static libraries were not being added at all in the cmake build. To correctly export OpenCascadeTargets.cmake
and allow for downstream projects to correctly link the static version of OpenCascade, it is crucial to model
these dependencies. Many of the libraries listed in MODULES become redundant if the dependencies are
modeled correctly, as they are actually transitive dependencies. Do you know how WOK / genproj handles
transitive dependencies? Should I leave my modifications in for the genproj case? It is unclear if genproj can model transitive dependencies,
but it it can, that raises the question of why they were added to MODULES in the first place.

reciprocal

2023-01-20 12:47

developer   ~0112894

btw, compiler was gcc (Debian 10.2.1-6) 10.2.1 20210110, but static linking behaviour has not changed since ... i don't know ... decades, so I am pretty sure it is not limited to a
specific version or even compiler (I'm guessing the clang linker shows the same behaviour).

git

2023-01-20 12:49

administrator   ~0112895

Branch CR33319 has been updated forcibly by reciprocal.

SHA-1: 6d6f364d19ea90bf90cf4fe46b67113c9088f4ea

git

2023-01-20 12:50

administrator   ~0112896

Branch CR33319 has been updated forcibly by reciprocal.

SHA-1: efe38d0ee77c37707c98ac3c65cb969a0691e32a

reciprocal

2023-01-20 13:05

developer   ~0112898

@ski, I saw that you removed the static library dependencies originally, so you may want to comment/review this.

dpasukhi

2023-01-20 13:15

developer   ~0112899

Dear @reciprocal. Thank you for your investigation.
The transitive dependencies are not linking.
Thank you for compiler info. It is necessary to reproducing.
The problem look very strange. The removing linking is a bug. We need to analyze it.

As for a commit, please update first line of the commit message with the equal name with summary of the ticket. And it would be nice to update the name of the commiter to the same with your nickname (reciprocal).

Updating occt_toolkit.cmake is very responsible thing. We need to check from our side all conditions of the changing.

dpasukhi

2023-01-20 13:20

developer   ~0112900

As for a ExpToCasExe it will be removed from the XDE package and moved to the own module the same with tool module.
And it will be not build by default.

dpasukhi

2023-02-03 19:15

developer   ~0113068

Dear @reciprocal.
What plan with current ticket?
You plan to do it by yourself? Or awaiting for review from our side?
Or you assign current ticket to us?

Issue History

Date Modified Username Field Change
2023-01-19 18:26 reciprocal New Issue
2023-01-19 18:26 reciprocal Assigned To => kgv
2023-01-19 18:29 git Note Added: 0112888
2023-01-19 22:47 dpasukhi Note Added: 0112890
2023-01-19 22:48 dpasukhi Note Edited: 0112890
2023-01-19 22:52 dpasukhi Summary Static linking fails with unresolved symbols due to linking order => Coding - Static linking fails with unresolved symbols due to linking order
2023-01-19 22:52 dpasukhi Steps to Reproduce Updated
2023-01-19 22:55 dpasukhi Note Edited: 0112890
2023-01-20 12:27 reciprocal Note Added: 0112893
2023-01-20 12:47 reciprocal Note Added: 0112894
2023-01-20 12:49 git Note Added: 0112895
2023-01-20 12:50 git Note Added: 0112896
2023-01-20 13:05 reciprocal Note Added: 0112898
2023-01-20 13:15 dpasukhi Note Added: 0112899
2023-01-20 13:20 dpasukhi Note Added: 0112900
2023-01-20 16:38 reciprocal Summary Coding - Static linking fails with unresolved symbols due to linking order => Coding - Static linking fails with unresolved symbols due to linking order and missing transitive dependencies
2023-02-03 19:15 dpasukhi Note Added: 0113068