]> git.cworth.org Git - notmuch/commitdiff
ruby: improve compilation with CFLAGS
authorFelipe Contreras <felipe.contreras@gmail.com>
Mon, 17 May 2021 05:47:46 +0000 (00:47 -0500)
committerDavid Bremner <david@tethera.net>
Sat, 22 May 2021 12:17:21 +0000 (09:17 -0300)
The ruby MakeMakefile generates a makefile that is suboptimal, which has
CFLAGS like this:

  CFLAGS   = $(CCDLFLAGS) -march=x86-64 -mtune=generic \
    -O2 -pipe -fno-plt -fPIC $(ARCH_FLAG)

This works as long as the user doesn't modify the Makefile.

Certain flags (namely -fPIC) need to be present regardless of what
CFLAGS are specified.

The Makefile should have done this instead:

  CFLAGS = -march=x86-64 -mtune=generic -O2
  override CFLAGS += $(CCDLFLAGS) -pipe -fno-plt -fPIC $(ARCH_FLAG)

Unfortunately they didn't, so we need to workaround their lack of
foresight.

We can simply add the necessary flags in the parent Makefile so everyone
is happy.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>

No differences found