Makefile/compiling

9 views
Skip to first unread message

Ernie Rael

unread,
Mar 26, 2023, 12:39:58 PM3/26/23
to vim...@googlegroups.com

(BTW: Minor bug in Makefile comment about getting "-O -g" by default.)

I'm curious about the "best" way to compile vim. For example,
can I crank up the optimization to extreme levels?

-ernie

In the Makefile it has

# When not defined, configure will try to use -O2 -g for gcc and -O for cc.
#CFLAGS = -g
#CFLAGS = -O

I've added, and put in a prefix ="

+CONF_OPT_GUI = --enable-gui=gtk3
+CONF_OPT_PYTHON3 = --enable-python3interp

Did "make reconfig" gcc is used and the options are

-O2 -fno-strength-reduce -Wall -Wno-deprecated-declarations

No "-g", like having it just in case a core shows up. (Use -g -O0 for debugging).

gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

I can't find any doc for "-fno-strength-reduce".
Is it historical or for some other compiler?

Bram Moolenaar

unread,
Mar 26, 2023, 4:28:22 PM3/26/23
to vim...@googlegroups.com, Ernie Rael

Ernie Rael wrote:

> (BTW: Minor bug in Makefile comment about getting "-O -g" by default.)

I'll remove "-g".

> I'm curious about the "best" way to compile vim. For example,
> can I crank up the optimization to extreme levels?

Sure. Generally more optimization makes compilation slower. Sometimes
a lot slower. This depends on the compiler.

> I can't find any doc for "-fno-strength-reduce".
> Is it historical or for some other compiler?

It is not properly documented. In some versions of gcc the optimizer
had a bug that was avoided by using this argument. This was before
2000, I don't know in what gcc version this was fixed. There are also
comments that removing the option doesn't make the executable faster.

--
GUARD #2: It could be carried by an African swallow!
GUARD #1: Oh, yeah, an African swallow maybe, but not a European swallow,
that's my point.
GUARD #2: Oh, yeah, I agree with that...
The Quest for the Holy Grail (Monty Python)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages