Skip to content

Conversation

@komh
Copy link
Contributor

@komh komh commented Dec 19, 2025

This fixes the problem that a DLL is generated but an import library does not on OS/2 when there is no the executable linking against the DLL.

@komh komh requested a review from jpakkane as a code owner December 19, 2025 16:53
Comment on lines 4063 to 4066
# Add an import library if shared library in OS/2 for build all.
if isinstance(t, build.SharedLibrary):
if self.environment.machines[t.for_machine].is_os2():
t.get_outputs()[0] = t.import_filename
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't happen in the backend, targets are supposed to be immutable once created, so this needs to happen at target creation time.

I'm also curious why this happens with OS/2 and not with Windows, because it should have the same problem. It looks like maybe the OS2DynamicLinker needs to implement the import_library_args method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mimiced the behavior of the above AIX codes for this. When is the target creation time?

On OS/2, an import library is generated with a separate tool, exmimp, after a DLL file is linked. Because of this, if only a DLL is listed, an import library is not generated. I know, on Windows, a linker generates DLLs and import libraries at the same time. And I have a question. Maybe an import library is genereated again on Windows when only it is removed?

Ah, a new idea has come to my mind right now. I'll try to add an import library to self.get_build_by_default_targets().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding to self.get_build_by_default_target() seems not to be proper. Instead, I appended an import library to targetlist.

…ld all

This fixes the problem that a DLL is generated but an import library does
not on OS/2 when there is no the executable linking against the DLL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants