nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.47k stars 1.47k forks source link

Nim doesn't pass linker arguments correctly VCC #5953

Open ratiotile opened 7 years ago

ratiotile commented 7 years ago

Used this in a .cfg file: passL:"/LTCG"

I think that passL is supposed to pass options to the linker directly, but instead it passes options to cl.exe. Nim's vccexe.exe doesn't call link.exe directly.

--listCmd option shows this command: cl.exe /LTCG [file args]

Tried to work around with: passL:"/link /LTCG". However, /link must appear after all file arguments, and nim generates this call: cl.exe /link /LTCG [file args]

It should be this: cl.exe [file args] /link /LTCG

Nim Compiler Version 0.17.0 (2017-05-18) [Windows: amd64]

Araq commented 7 years ago

I think that passL is supposed to pass options to the linker directly, but instead it passes options to cl.exe. Nim's vccexe.exe doesn't call link.exe directly.

No, it means "pass this to the linking step".

ratiotile commented 7 years ago

What about either moving the link options after the files, or creating a new passPostL option that does it?

Araq commented 7 years ago

I thought about supporting $1 and using % internally so that appending/prepending doesn't require yet another switch. If the passL command contains no dollar sign, it's done as it is now for backwards compatibility.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions.

bung87 commented 1 year ago

for reference https://forum.nim-lang.org/t/341