From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eClpE3JnoWCbKwAAgWs5BA (envelope-from ) for ; Sun, 16 May 2021 20:41:54 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id cJsND3JnoWDSCQAAB5/wlQ (envelope-from ) for ; Sun, 16 May 2021 18:41:54 +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 79DB21744D for ; Sun, 16 May 2021 20:41:53 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id B334129039; Sun, 16 May 2021 14:41:47 -0400 (EDT) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by mail.notmuchmail.org (Postfix) with ESMTPS id 0B7ED271EB for ; Sun, 16 May 2021 14:41:44 -0400 (EDT) Received: by mail-wr1-x429.google.com with SMTP id q5so4163136wrs.4 for ; Sun, 16 May 2021 11:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NbwDRlkUHE5n9LUsP1inSHbh/rRZzU2mWPow024yGPk=; b=OWoZ0kbRWNVnuBGoq/RcYMaVE9NqlzXwkHCzfdRaIf59j9Ki3XCItDGUadje3S2WTV viqrajEoAI+0ngLV84izeyIoVUAxQoOMyWnctOETHXSweuKEBWNH7JD725CA0VzSSmBx URCvtdhZ0fbSkCO35aqRaT3OGvk8V1H54gSWijVe5yfOp5SqSYLZ6IwZfVOjbN1ug8rP FU+9zkKH5XRzIYt8wqxWVovLAIL0ZRstbcRqoo4nE7VjasPLbFK8ASDF+Jy8cAs7s11x KREmNR4j8cSNdZ88Gngmb4xOcTJiyGFLaYUElVAKtxFMEgP0r8YY1F05qHFTB/+Tz7gu TWFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NbwDRlkUHE5n9LUsP1inSHbh/rRZzU2mWPow024yGPk=; b=g60yA6gTqsKkfJ2oArGr6YjDn7BtlpoR9R3c6z0Aa2h5Zf7Dd/cO34+4S1bM3joZNM w8qCpi3WTRku39WemXGnOSeX8rqCsU7iO5OK0SLtgCG9q1i7wHQ/+xVjV+nHpiOrybHD DkAFb344B7pbICS/xr1EHW5pjcHYOoo9hZDnFqN6bczbwh8jYKiXLQHRv6hikDev2l8e iJY8OqgPuyStOMehw7PXR5j9A8tZl4+LsxU9BfgCP7ju3klGaPYmZGbdd0hg0zXJHVnE 1btalF2c3aMbqWYZ3fNKN/MqNRxD0D5lRdhPu3oPffYOMVrCqRXWxYrAoPTqc9whuXYr GRXw== X-Gm-Message-State: AOAM5327zRhb5ZJo9LnUdyvssJF0BrRe1ox3T0HJBoJgWDXDN3J/3zSN glZn1Bw2vIXvRacaaGHI9KsWKeukZuOZc0I7XeymV+d83ezZow== X-Google-Smtp-Source: ABdhPJzp5aHnbK6IGeqmzMp0dMAI2GBsZa1FK3fWE8RJcvn1O18N7oi5eAehOYFa9T1jRTUxyshR8iVYhSjJthJXeiI= X-Received: by 2002:adf:e8c3:: with SMTP id k3mr28834912wrn.255.1621190495577; Sun, 16 May 2021 11:41:35 -0700 (PDT) MIME-Version: 1.0 References: <87v97izwuk.fsf@tethera.net> In-Reply-To: <87v97izwuk.fsf@tethera.net> From: Felipe Contreras Date: Sun, 16 May 2021 13:41:24 -0500 Message-ID: Subject: Re: ruby: building with CFLAGS="something" To: David Bremner Message-ID-Hash: LM56754WQQ46PWU5FCJ77KCWC5DBSK6J X-Message-ID-Hash: LM56754WQQ46PWU5FCJ77KCWC5DBSK6J X-MailFrom: felipe.contreras@gmail.com 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 CC: "notmuch@notmuchmail.org" 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=1621190513; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=9Sau8SEEkoVDutIheA3OglCdllzgfTqXR8BdumZPjGc=; b=XPAZK36Ed+ZrWHsrnj/34trDr5y7mspQH7IICDmXoLyhChrxx0u/x4cUcCb1muAGsimraD JNcThke91cgaikegKpvWGOYKzeq+Bgk+X8FRUK4DQ5CL8Ymqoiw5J0RY1Zr5YuY+BaACGh FNq7IlyMK/cyAXG8KirWaviR1K+vj2forqDvoWSJAAjiTya+GV9Sdt1VJ4wAjeQWBr4QTQ ixSFoLFRdzC7buPS3RJGl9wREId16nrBrXWg0BfW/cTFTbV3mcOK0qJo/sBj4zvdc/dkig haFlb7g7O371Qk5/8s3j9IKOHt6lO8rozqhrYCIZUz3JHzJT6ByUCrEaK05vrw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621190513; a=rsa-sha256; cv=none; b=u5rMJMOPYx0Cd6B2CbdJsv5XFMPUxPgP9VJDAgh1J+AH3Cz5pq6aORnnkD/X6h6lHhc3Ns pbat8jzmU5JUPAS+VsMA3gnR9ysS0x+k0RY1YWkUlZlARSvQL5il9M/7NosA0y5vryc2zB NUqiMi8Oa6NQzsQ4g5NX7BwR9VeCNNLzNuBBM1AmVtpTPf0mTM+9oMubBTL10l70vA1dnr SsBqwjcL9hUmDDRc1Q+PA25r8+cGRLiVnOSF92PuncS6renDiAS3P9zmZp7fw3BrCRd77L aUL0O3fm0zfG8gTyrTVbpRIb+/pcxTZqJHk/HrRParEQi8uIgMhrJopKd63JKg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=OWoZ0kbR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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.53 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=OWoZ0kbR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 79DB21744D X-Spam-Score: 0.53 X-Migadu-Scanner: scn0.migadu.com X-TUID: tn7K7KVWXZOr On Sun, May 16, 2021 at 7:28 AM David Bremner 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" 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