• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ TFS 1.x compilation - long Linking time

Gesior.pl

Mega Noob&LOL 2012
Senator
Joined
Sep 18, 2007
Messages
2,964
Solutions
99
Reaction score
3,375
Location
Poland
GitHub
gesior
Anyone got idea why 'linking' may take 45 seconds on dedicated servers (Debian 7 and Debian 8.9)?

I tested it on 2 dedics (i4790K, 32-64GB ram, SSD NVME) and both compile files fast, but linking takes around 45 second.
After single line change in 1 file, it compiles file in 3 seconds and then I must wait 45 seconds for linker.
Tested it with g++ 4.9, 5, 6. Tested with "cotire" on/off.

At my home PC with Ubuntu 16.04 linking takes around 1 second.

After compilation on dedic, binary file size is 19MB, on home PC it's 9MB.

Any ideas what I can change in CMake project to make it link faster?
 
Solution
@slawkens
Solved! :D

Someone added flags to TFS project on dedic:
PHP:
-march=native -ggdb3 -Ofast -fstack-protector -fstack-protector-all -fno-var-tracking-assignments
-flto - link-time optimizer
@slawkens
Solved! :D

Someone added flags to TFS project on dedic:
PHP:
-march=native -ggdb3 -Ofast -fstack-protector -fstack-protector-all -fno-var-tracking-assignments
-flto - link-time optimizer
 
Solution
Back
Top