From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qPv3GP4PoWC4HgEAgWs5BA (envelope-from ) for ; Sun, 16 May 2021 14:28:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id CAqOFP4PoWB6fwAAB5/wlQ (envelope-from ) for ; Sun, 16 May 2021 12:28:46 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1625E10ADD for ; Sun, 16 May 2021 14:28:46 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id C1D43271E3; Sun, 16 May 2021 08:28:40 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id B47631FAC2 for ; Sun, 16 May 2021 08:28:37 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 84CDA60018; Sun, 16 May 2021 08:28:37 -0400 (EDT) Received: (nullmailer pid 3228533 invoked by uid 1000); Sun, 16 May 2021 12:28:35 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: ruby: building with CFLAGS="something" Cc: Felipe Contreras Date: Sun, 16 May 2021 09:28:35 -0300 Message-ID: <87v97izwuk.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 64QMGDEYEX2HMI5DSFOERHVA5AOCORU7 X-Message-ID-Hash: 64QMGDEYEX2HMI5DSFOERHVA5AOCORU7 X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621168126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vRWcyFL6ZKKM6zM5DcRo8cUQW7wUohuXsGOmcQNmDtI=; b=hCoJk6Q1AQwm2XzDAfZk02APbAd6Zmj+zGhRzjuWjGC9uiVlWLilzvCqUS6UGtayx/TUPv +0axRll88VlNDJq+IOusyM20RE9gL0twaHy+QYpInsnSciYDxTg73ffRrp111iLVNORggf oaP2KuPJ3ynCyKZGfLsSKRugIxy6DTIs0qA0VZbF4UOWzdI0eGi0wXZZohhTf3YGv42YAP ICmX+mAogpzcr3EbsB0z4NbSeDz8nsikztlfCkC7UTxyCBKyG7k5UGuHeJ0nIhRykSBV8Y AEKLFMjgUYc6foYacAAwwMKxGveNkr23sNCHZ595BURiW0CF35qn2aAY3QZlFg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621168126; a=rsa-sha256; cv=none; b=TgWPnxoq1zJdx//3SrC2EUwvpFOWHOIl8n5p9f8SJIQMXh184T22CF1szHsAriB79CqY8x xfsB4rKL8pQG7VkSOdQTQTAhCpNPQoWbwAgMPCh/Ejyi+ilCt/NMoqWT22nzV6hZ5qcmNe oA7ddsjRmJrisQL2hKA/jgMxmFaU9DL3zNIuy8z35F+VJhiMD0c3dmKoWlASnmtEYjsjEn t2ty4ieEi5cqKRdcgiKDS7Lz9g/MpGhb4nD8ouqYkuSoyxf7tsyBhs7hxidWn16oQ9KAxg s0thbF/JttMqe3K3PFA7ky9PyxUhjmrm+6frh8uJayHastvy/WGUEE5UBPgg7w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.57 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 1625E10ADD X-Spam-Score: -0.57 X-Migadu-Scanner: scn0.migadu.com X-TUID: dh/d3XEZ30mg 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