Skip to content

Commit

Permalink
Fixes LTO/PGO options not being used when ccache is enabled.
Browse files Browse the repository at this point in the history
When ccache is enabled, env["CC"] becomes - 'CC': '$CCACHE gcc'
  • Loading branch information
Pentarctagon authored and jyrkive committed Feb 9, 2018
1 parent 8ddef4b commit c820009
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SConstruct
Expand Up @@ -525,7 +525,7 @@ for env in [test_env, client_env, env]:
rel_comp_flags = rel_comp_flags + env["arch"]

# PGO and LTO setup
if env["CC"] == "gcc":
if "gcc" in env["TOOLS"]:
if env["pgo_data"] == "generate":
rel_comp_flags = rel_comp_flags + " -fprofile-generate=pgo_data/"
rel_link_flags = "-fprofile-generate=pgo_data/"
Expand Down

4 comments on commit c820009

@GregoryLundberg
Copy link
Contributor

Choose a reason for hiding this comment

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

Causes

clang-5.0: error: unsupported argument '1' to option 'flto='

I'm told the reason is I have both compilers installed. Note: I do not presently use ccache or have it installed.

[lundberg@lundberg-arch ~]$ pacman -Q ccache gcc clang
error: package 'ccache' was not found
gcc 7.3.0-1
clang 5.0.1-2

@doofus-01
Copy link
Member

@doofus-01 doofus-01 commented on c820009 Feb 10, 2018

Choose a reason for hiding this comment

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

I can no longer compile since this commit, did the minimum requirements get increased?

collect2: fatal error: cannot find 'ld'
compilation terminated.

I didn't have ccache installed either, I'll try again with it installed and passed as an option.
EDIT: No, makes no difference.

compiler output: https://gist.github.com/doofus-01/3f7d10816d052333c90b946c8fcdeaf9

@jyrkive
Copy link
Member

Choose a reason for hiding this comment

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

Fixed (in a crude way) in commit a1e821f.

@doofus-01
Copy link
Member

Choose a reason for hiding this comment

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

Yes, it works again (even though I'm not using clang). Thanks.

Please sign in to comment.