flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > [solved]How to use vs2005 option "linker -> function order"?

Author
Thread Post new topic Reply to topic
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 28 Mar 2018, 06:30
I keep getting this error

fatal error LNK1117: syntax error in option 'ORDER:c:\_src\winapi-small\mini-vs2005\functionorder'

I'm setting this to $(ProjectDir)functionorder and to just functionorder, nothing changes.


Last edited by vivik on 29 Mar 2018, 05:33; edited 1 time in total
Post 28 Mar 2018, 06:30
View user's profile Send private message Reply with quote
donn



Joined: 05 Mar 2010
Posts: 321
donn 29 Mar 2018, 03:36
Hey, I think the order value is preceded with an @ sign, like so:

Code:
/SUBSYSTEM:WINDOWS /ORDER:@"C:\Users\D\Desktop\fOrdering.txt"    


Visual Studio put this in automatically. Without it, I got the same linker error. With it, you may see something like this, depending if the function is re-orderable (not in this case):

Code:
C:\Users\D\Desktop\fOrdering.txt : warning LNK4065: 'start' cannot be ordered; ignored    


I think the preceding underscore can be omitted
Quote:
unless the name starts with a question mark (?) or at sign (@).
.

Reordering seems tricky to get a proper performance boost from, but also seems very useful, good luck with it...!

Quote:
The /ORDER compiler option allows you to optimize your program's paging behavior by grouping a function together with the functions it calls. You can also group frequently called functions together. These techniques, known as swap tuning or paging optimization, increase the probability that a called function is in memory when it is needed and does not have to be paged from disk.
Post 29 Mar 2018, 03:36
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 29 Mar 2018, 05:33
Hell yeah, it worked! Thank you!

I've set "linker -> function order" to @$(ProjectDir)functionorder , and I've set the content of functionorder to this:

main
WndProc@16

Lineend is unix-style, I guess it can read both windows-style (didn't check) and linux-style.

I don't really do this for optimization, it just doesn't make sense to me to NOT have main as the very first function.

Intel compiler also allows reordering data, and doing all reordering based on profiling information ( https://software.intel.com/en-us/node/696053 ). I don't think any c compiler allows aligning functions by 1024 bytes. Also, I kinda really need to align some global variables by 4096 bytes... This can wait though, doesn't matter. Fasm can do it.

Programming without tech support (or more experienced people) is impossible, I had no chance back in the day.
Post 29 Mar 2018, 05:33
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 31 Mar 2018, 08:34
Oh, I just got this "cannot be ordered; ignored" too. This is because I tried to compile .cpp code instead of .c code. This compiler is quirky like that.

This thread is all about this issue: https://board.flatassembler.net/topic.php?t=20399
Post 31 Mar 2018, 08:34
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.