unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* ruby: building with CFLAGS="something"
@ 2021-05-16 12:28 David Bremner
  2021-05-16 18:41 ` Felipe Contreras
  0 siblings, 1 reply; 3+ messages in thread
From: David Bremner @ 2021-05-16 12:28 UTC (permalink / raw)
  To: notmuch; +Cc: Felipe Contreras


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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-16 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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).