Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions core/base/src/TSystem.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3418,16 +3418,18 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
if (!f(I->c_str()))
break;
};
auto LoadLibrary = [useCxxModules, produceRootmap, ForeachSharedLibDep](const TString &lib) {
// We have no rootmap files or modules to construct `-l` flags enabling
// explicit linking. We have to resolve the dependencies by ourselves
// taking the job of the dyld.
auto LoadLibrary = [linkDepLibraries, useCxxModules, produceRootmap, ForeachSharedLibDep](const TString &lib) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only semantic problem I see here is that 'linkDepLibraries' is about how we will construct the upcoming library and not whether the library we are linking against are all fully explicitly linked :( ..

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be maybe called preLoadDepLibraries instead?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to address with minimal changes your comment I think

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might not have been clear. The flag linkDepLibraries only change how the ACLiC libraries are generated, however it does not tell anything about any other libraries. Thus for a given library in the list we still don't know if the deep search is needed or not as that library might or might be explicitly linked to its dependencies.

// If the library was explicitly linked against its dependencies, they
// are recorded in the library itself and the dynamic linker loads them.
// Otherwise, we have no rootmap files or modules to construct `-l` flags
// enabling explicit linking. We have to resolve the dependencies by
// ourselves taking the job of the dyld.
// FIXME: This is a rare case where we have rootcling running with
// modules disabled. Remove this code once we fully switch to modules,
// or implement a special flag in rootcling which selective enables
// modules for dependent libraries and does not produce a module for
// the ACLiC library.
if (useCxxModules && !produceRootmap) {
if (!linkDepLibraries && useCxxModules && !produceRootmap) {
std::function<bool(const char *)> LoadLibF = [](const char *dep) {
return gInterpreter->Load(dep, /*skipReload*/ true) >= 0;
};
Expand Down
Loading