From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id EDC611F453 for ; Thu, 17 Jan 2019 22:08:06 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 8C8F8121778; Fri, 18 Jan 2019 07:08:04 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 8E933121778 for ; Fri, 18 Jan 2019 07:08:02 +0900 (JST) Received: by filter0077p3mdw1.sendgrid.net with SMTP id filter0077p3mdw1-25149-5C40FCBF-2B 2019-01-17 22:07:59.759744262 +0000 UTC m=+244843.201716573 Received: from herokuapp.com (ec2-3-81-3-226.compute-1.amazonaws.com [3.81.3.226]) by ismtpd0023p1iad2.sendgrid.net (SG) with ESMTP id i7izfk01QbOiYf7zjvYbBg for ; Thu, 17 Jan 2019 22:07:59.645 +0000 (UTC) Date: Thu, 17 Jan 2019 22:08:01 +0000 (UTC) From: naruse@airemix.jp To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66599 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15520 X-Redmine-Issue-Author: mistydemeo X-Redmine-Sender: naruse X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6MdVp/FNtpfcVTH1uMi5fStOlcSbQhjMspOm Tw3HCkehXzHHceR5Vsar+hdOwhJjd+otqkoKC6v6kXs76aMPmG8Tj28eJ2OGK9l1bBGq8916/xfcs/ Cl40QyD6yTsyKtRwwNZwjjILeus8xndEZtdu50wDNRbdhDNCAkGc7G22aA== X-ML-Name: ruby-core X-Mail-Count: 91149 Subject: [ruby-core:91149] [Ruby trunk Bug#15520] [patch] configure should refuse to build with jemalloc when headers are missing X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15520 has been updated by naruse (Yui NARUSE). Backport changed from 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED to 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE ruby_2_6 r66852 merged revision(s) 66779. ---------------------------------------- Bug #15520: [patch] configure should refuse to build with jemalloc when headers are missing https://bugs.ruby-lang.org/issues/15520#change-76380 * Author: mistydemeo (Misty De Meo) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.7.0dev (2019-01-10 fix_jemalloc_i.. 66768) [x86_64-darwin18] * Backport: 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE ---------------------------------------- When the `--with-jemalloc` option is passed, the configure script will correctly fail with an error if the library is missing. However, if the library is present and headers are missing, configure will succeed and allow the build to proceed. The actual build is unlikely to succeed in this case since the functions won't be defined. Steps to reproduce: 1. Install jemalloc. 2. Delete jemalloc's headers. 3. Run ./configure --with-jemalloc &&is make Expected behaviour: configure fails because the requested jemalloc's headers are missing Actual behaviour: configure succeeds. On macOS, the build then fails with the following: ~~~ compiling gc.c gc.c:7955:12: error: implicit declaration of function 'malloc_usable_size' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return malloc_usable_size(ptr); ^ gc.c:7955:12: note: did you mean 'malloc_good_size'? /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/malloc/malloc.h:134:15: note: 'malloc_good_size' declared here extern size_t malloc_good_size(size_t size); ^ 1 error generated. make: *** [gc.o] Error 1 ~~~ The attached patch fixes this by ensuring that configure fails if `--with-jemalloc` is passed but the headers are missing in the same way that it will fail if the library is missing. This patch is against trunk. I've also reproduced it in several previous versions of Ruby. ---Files-------------------------------- 0001-configure-refuse-to-build-with-jemalloc-when-header-.patch (933 Bytes) -- https://bugs.ruby-lang.org/