Skip to content

builder,cgen: fix msvc build filename, remove temp files#23890

Merged
spytheman merged 1 commit into
vlang:masterfrom
kbkpbot:fix-windows-output-filename-def-remove-tmp-files
Mar 9, 2025
Merged

builder,cgen: fix msvc build filename, remove temp files#23890
spytheman merged 1 commit into
vlang:masterfrom
kbkpbot:fix-windows-output-filename-def-remove-tmp-files

Conversation

@kbkpbot

@kbkpbot kbkpbot commented Mar 9, 2025

Copy link
Copy Markdown
Contributor
  1. Partially fix issue Create .dll under Windows will result in strange filename. #23888 . If user specify a output name other than .exe or .dll, the output name will be appended with .exe or .dll;
  2. Remove msvc generate temp files.

@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-22293

@kbkpbot

kbkpbot commented Mar 9, 2025

Copy link
Copy Markdown
Contributor Author

wait a moment, try fix issue #6983

@kbkpbot

kbkpbot commented Mar 9, 2025

Copy link
Copy Markdown
Contributor Author

wait a moment, try fix issue #6983

As tcc doesn't has a method that change an export function's name, so my suggestion is not use the @[callconv: stdcall].

msvc can use a .def file change the export function's name, so it can use @[callconv: stdcall].

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Excellent work.

@spytheman spytheman merged commit b1d6b78 into vlang:master Mar 9, 2025
@Ekopalypse

Ekopalypse commented Mar 9, 2025

Copy link
Copy Markdown
Contributor

wait a moment, try fix issue #6983

As tcc doesn't has a method that change an export function's name, so my suggestion is not use the @[callconv: stdcall].

msvc can use a .def file change the export function's name, so it can use @[callconv: stdcall].

@kbkpbot
I don't understand what the calling convention has to do with the exported function names?
Regarding vlang of course.

@JalonSolov

Copy link
Copy Markdown
Collaborator

In V, names are usually exported as <module name>__<function name> for normal functions, <module name>__<struct name>_<receiver method name>, etc. This is very similar to the name mangling that C++ does for symbols.

So if you want a specific name for external things to call, you need to export said specific name, instead of others having to figure out the naming scheme.

@Ekopalypse

Copy link
Copy Markdown
Contributor

So does this mean that there is no longer an export attribute?
Afaik, a calling convention does NOT only define what names should be, but above all how they are called and how parameters are passed or handled.

@kbkpbot kbkpbot deleted the fix-windows-output-filename-def-remove-tmp-files branch March 9, 2025 23:16
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.

4 participants