From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iIHrN6gDomCcKgEAgWs5BA (envelope-from ) for ; Mon, 17 May 2021 07:48:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aLCGM6gDomCkVQAAbx9fmQ (envelope-from ) for ; Mon, 17 May 2021 05:48:24 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (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 8D3251C297 for ; Mon, 17 May 2021 07:48:24 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 3A8F829043; Mon, 17 May 2021 01:48:17 -0400 (EDT) Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by mail.notmuchmail.org (Postfix) with ESMTPS id C067B271EC for ; Mon, 17 May 2021 01:48:14 -0400 (EDT) Received: by mail-oi1-x230.google.com with SMTP id u11so5495765oiv.1 for ; Sun, 16 May 2021 22:48:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VyyfToDvHGO4yfTjOb4AD3nYpBk3r+17y5/UNKNpAqo=; b=gLj5xfLQssbtkxzus2O6JH0kWIiEXQje+rrngHVQdO/mQcdGjo0Z8FL6zLVGop/4rN x0SONOWSG1sUt7yTXt6xdlHO8yPFD+9GZ/liRxXCcqh+CWF7oouJXeSLYNZWsltbaK4X IrOiojJJWcbI44+jCozWKtdmP3wFsQ1HtvRu4okFOd6/Q1nhsHGgWuEqQTw7Eu1tXpHc Ioej3ikJ1CH7jMF6Zw5xp8BC3NFyg297rGNib61v0dlp09hwHMkDfzZR+uGZdcwAhrDM 5iFtwRUwsbEZdDlYheSuE6VXwlZedF8JNAWFgXu4OFFtbfxWYblcBQ+qFG4e/z1w9bKz j9UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VyyfToDvHGO4yfTjOb4AD3nYpBk3r+17y5/UNKNpAqo=; b=NqKwwYmcz1uNLPVJYvPnh1eNimjlPKO3Zvq9RqXgQDe6i5Yxtbt8LimvBaqh9KAbkT LjNuP9J2px8j7olESsQk3DUiG8Ax+kRFeo+u0rIaEWxArtWgdqIpf3SR6O2UkukjuOnC KeWfI4q9mjPm04f6MVPGe2aW7iTb6DxsCsVa3vcUAqNnpIF5MLJfM9sBsOxQ2YZvCEGL AQhIiDIfQa9ocq3wxPRHfHCq71CXbDZKG+D14yb/Qqh0Hue7IJ7z4FZ0/neOhpguR4S/ ZucLClAIPErK9qtm2pAE+A6pCnU+rwuv7mH0XIhQacuW0b9xFNxXARj4M8BRAnTO3hdN DILA== X-Gm-Message-State: AOAM533sImj44LupiGHvmBOY6Hiyv4qbV1nNpXirlEs6q5m6K67aCTmp uGxrlMrUjvdtmvLRc4vanjrkP21HnxeDPw== X-Google-Smtp-Source: ABdhPJz//YyGq4eVqhmYh/NcepdXGklnJdf6o3jfWsYIbObGzi307dHsKN4nLZH997qR5xjwvgYI3Q== X-Received: by 2002:aca:4c58:: with SMTP id z85mr42292171oia.46.1621230488129; Sun, 16 May 2021 22:48:08 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id y11sm2914809ooq.2.2021.05.16.22.48.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 May 2021 22:48:07 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH] ruby: improve compilation with CFLAGS Date: Mon, 17 May 2021 00:47:46 -0500 Message-Id: <20210517054746.1144078-1-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Message-ID-Hash: 7KNSIMUCIEVUP2F4GABZHRODU6EWA566 X-Message-ID-Hash: 7KNSIMUCIEVUP2F4GABZHRODU6EWA566 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: Tomi Ollila 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=1621230504; 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:dkim-signature; bh=GK9w9OCHUe/Bb4FkJ5a2PkagPggo2gTn4KNSoYuWD98=; b=t8oVN3pdli7bxXSNI6/gZ9zY/ANLukuQvYCE0FIeQg4kUzgKkOYhMKHiE7mVDaCf9oxN1I CwEk4TRjj56cbVhl4k8L528e8xu91BTiDyc9Wzb7BeXu7F4qaV591VF/sScuNNqn+Cu7iX lA3D6LItpPzvJGugZtfpkwDnTd+DR2t8iETg175uXZC54zqqLlhbvY5LyliPw5HlqPsi2F s6eU8y//9InrnGWyxrpGSsg8ptv7x9uAy81Bh/Zr44QwgQanoHiVgf/41sPKQoTuq7gwDM +UXFifOzEGKUi5N7mLvvxaCIOLzn5ROOF61w0oYdJmoh2x7RcnzT/54e8tkLdQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621230504; a=rsa-sha256; cv=none; b=l6Ied2FKwBO+eg/6SlzW2W2c7htig3DZFyID84RtkdhTOQ3cVzu0B2cLVUDfkqIlVCniNO fj2j1prQCjmNFXlxlmA0rq6V6dG7vmuvgnBBueW0rRzoXKY7Qwce5urXD/vmJNPlpEbzEp F/spWG44TNhSvIo3OFmQi7FOzjZlu3m5LZVtTUzPvQqQn/+BCVK66kjAbg4U8nWxp08Z4F Zh5hhfy3lpp7VwPUBq1AgfDh628dx1+4arZnFBwz8791Kz+UJ8FaIUBrV5yJWiV2Mx1dyS JR4G83qGqeY0YvDN+Sgg7X/AXwcadyKB0L40uLtChv3M866CsaFaLdRhqyXRAw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=gLj5xfLQ; 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 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.95 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=gLj5xfLQ; 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 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 8D3251C297 X-Spam-Score: -0.95 X-Migadu-Scanner: scn0.migadu.com X-TUID: d8z61dQvwHMl The ruby MakeMakefile generates a makefile that is suboptimal, which has CFLAGS like this: CFLAGS = $(CCDLFLAGS) -march=x86-64 -mtune=generic \ -O2 -pipe -fno-plt -fPIC $(ARCH_FLAG) This works as long as the user doesn't modify the Makefile. Certain flags (namely -fPIC) need to be present regardless of what CFLAGS are specified. The Makefile should have done this instead: CFLAGS = -march=x86-64 -mtune=generic -O2 override CFLAGS += $(CCDLFLAGS) -pipe -fno-plt -fPIC $(ARCH_FLAG) Unfortunately they didn't, so we need to workaround their lack of foresight. We can simply add the necessary flags in the parent Makefile so everyone is happy. Signed-off-by: Felipe Contreras --- bindings/Makefile.local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/Makefile.local b/bindings/Makefile.local index bc960bbc..3672e69f 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 + $(MAKE) -C $(dir)/ruby CFLAGS="$(CFLAGS) -pipe -fno-plt -fPIC" endif python-cffi-bindings: lib/$(LINKER_NAME) -- 2.31.1