From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Cc: Felipe Contreras <felipe.contreras@gmail.com>
Subject: ruby: building with CFLAGS="something"
Date: Sun, 16 May 2021 09:28:35 -0300 [thread overview]
Message-ID: <87v97izwuk.fsf@tethera.net> (raw)
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:
linking shared-object notmuch.so
/usr/bin/ld: status.o: warning: relocation against `notmuch_rb_eUnbalancedAtomicError' in read-only section `.text'
/usr/bin/ld: database.o: relocation R_X86_64_PC32 against symbol `ID_db_create' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:262: notmuch.so] Error 1
make[1]: Leaving directory '/home/bremner/software/upstream/notmuch/bindings/ruby'
make: *** [bindings/Makefile.local:9: ruby-bindings] Error 2
It would be nice if bindings/ruby/Makefile could be made to confirm to
the notmuch conventions, but since it's autogenerated I don't know how
realistic that is. Failing that we could think about adjusting the
notmuch build system, ideally conforming to some standard-ish
behaviour.
I guess a hack that might work is to unset the corresponding variables
in the shim bindings/Makefile.local; something like the following, but
more portable
diff --git a/bindings/Makefile.local b/bindings/Makefile.local
index bc960bbc..8e3cd051 100644
--- 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
+ env -u CFLAGS $(MAKE) -C $(dir)/ruby
endif
next reply other threads:[~2021-05-16 12:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-16 12:28 David Bremner [this message]
2021-05-16 18:41 ` ruby: building with CFLAGS="something" Felipe Contreras
2021-05-16 19:08 ` Tomi Ollila
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=87v97izwuk.fsf@tethera.net \
--to=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).