build: Don't use -O0 which is not portable.

Authored by gniibe on Jan 7 2020, 8:22 AM.


build: Don't use -O0 which is not portable.

* src/ (mkheader): Remove -O0 option.
  • Signed-off-by: NIIBE Yutaka <>


gniibeJan 7 2020, 8:22 AM
rE308574372055: New error codes for SQLite
werner added a subscriber: werner.Jan 7 2020, 10:17 AM

Well, that was probably from the time I wrote that tool.

Do you really think that -O0 is non-portable in praxis? In libgcrypt we use for certain modules (twofish.c iirc)

gniibe added a comment.Jan 8 2020, 1:28 AM

The particular part of mkheader compilation with -O0 was introduced by dkg for cross build support.
I believe that -O<number> (where <number> is not zero) is common but -O<something-other> is dependent.
Requesting non-optimization by -O0 seems GCC specific.
(I grep-ped autoconf-archive and observed the use cases of -O0.)

If we really want to support -O0 here, it would be best to add checking by:

test "$GCC" = "yes"

in configure and only add -O0 when it's gcc.

I checked libgcrypt. -O0 is used in random/ for o_flag_munging to disable optimization for rndjent.c. For Solaris, we can skip that by --disable-O-flag-munging.

werner added a comment.Jan 8 2020, 8:30 AM

No need to support it. What I had in mind was the compilation of tiger.c where we replace optimization flags by -O1 which, as you remarked, seems to b widely portable.