$ v -prod -cflags -flto foo.v
$ du -hs foo
12K foo
$ v -prod foo.v
$ du -hs foo
72K foo
$
As a workaround, you can pass explicitly -cc clang or -cc gcc , in which case -flto will be added with -prod .
The reason is that by default, v uses cc, and v does not know at the moment what exactly cc is on each platform, and if cc supports the -flto flag.
makes sense, but it will be nice if cc default could autodetect the compiler
On 1 Dec 2019, at 20:30, Delyan Angelov notifications@github.com wrote:
As a workaround, you can pass explicitly -cc clang or -cc gcc , in which case -flto will be added with -prod .
The reason is that by default, v uses cc, and v does not know at the moment what exactly cc is on each platform, and if cc supports the -flto flag.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/vlang/v/issues/2948?email_source=notifications&email_token=AAG75FSKMSC5EXIPFLQN7OTQWQGDVA5CNFSM4JTMQHN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFRTD7Y#issuecomment-560148991, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG75FU7BFMD7XJDUZTCUH3QWQGDVANCNFSM4JTMQHNQ.
I agree. When doing -prod, the additional time to autodetect/parse cc --version first will not be a problem.