From: Tomi Ollila <tomi.ollila@iki.fi>
To: Felipe Contreras <felipe.contreras@gmail.com>,
David Bremner <david@tethera.net>
Cc: "notmuch@notmuchmail.org" <notmuch@notmuchmail.org>
Subject: Re: ruby: building with CFLAGS="something"
Date: Sun, 16 May 2021 22:08:57 +0300 [thread overview]
Message-ID: <m27djy7aye.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <CAMP44s1vK7RThN5+xCo5_fK2GJo4_Oc+MuA8ehn=UGYRezRc5A@mail.gmail.com>
On Sun, May 16 2021, Felipe Contreras wrote:
> On Sun, May 16, 2021 at 7:28 AM David Bremner <david@tethera.net> wrote:
>>
>>
>> The rest of the (C and C++) codebase supports
>>
>> make CFLAGS="-g -O0"
>>
>> or
>>
>> CFLAGS="-g -O0" ./configure
>>
>> but the ruby bindings don't build:
>
> That's because -fPIC is needed.
>
> The way Ruby's mkmf generates the Makefile is wrong, because it should do:
>
> override CFLAGS+=-fPIC
>
> So that the user can specify other CFLAGS.
>
> However, we can fix that by doing that ourselves:
>
> --- a/bindings/Makefile.local
> +++ b/bindings/Makefile.local
> @@ -10,7 +10,7 @@ ifeq ($(HAVE_RUBY_DEV),1)
> LIBNOTMUCH="../../lib/$(LINKER_NAME)" \
> NOTMUCH_SRCDIR='$(NOTMUCH_SRCDIR)' \
> $(RUBY) extconf.rb --vendor
> - $(MAKE) -C $(dir)/ruby
> + $(MAKE) -C $(dir)/ruby CFLAGS="$(CFLAGS) -pipe -fno-plt -fPIC"
forget my suggestion -- also in general, usually, make variables have more
"power" than defining such a thing in environment (would not be in those
cases there is intermediate wrapper which does not get the make variable...)
Tomi
> endif
>
> We lose -march=x86-64 -mtune=generic (at least on my machine), but I
> guess that's not a big deal since libnotmuch itself isn't getting
> compiled with those.
>
> I'll send a patch soonish.
>
> --
> Felipe Contreras
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org
prev parent reply other threads:[~2021-05-16 19:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-16 12:28 ruby: building with CFLAGS="something" David Bremner
2021-05-16 18:41 ` Felipe Contreras
2021-05-16 19:08 ` Tomi Ollila [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m27djy7aye.fsf@guru.guru-group.fi \
--to=tomi.ollila@iki.fi \
--cc=david@tethera.net \
--cc=felipe.contreras@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).