From owner-freebsd-ruby@freebsd.org Tue Sep 6 15:30:35 2016 Return-Path: Delivered-To: freebsd-ruby@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D1A9B96E25 for ; Tue, 6 Sep 2016 15:30:35 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 0F71F164F for ; Tue, 6 Sep 2016 15:30:35 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 0B74BB96E22; Tue, 6 Sep 2016 15:30:35 +0000 (UTC) Delivered-To: ruby@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B1E8B96E21 for ; Tue, 6 Sep 2016 15:30:35 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mail-oi0-x244.google.com (mail-oi0-x244.google.com [IPv6:2607:f8b0:4003:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7425164C; Tue, 6 Sep 2016 15:30:34 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by mail-oi0-x244.google.com with SMTP id 2so15229183oif.2; Tue, 06 Sep 2016 08:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=myD06zpJwMaW9T1X32IUXd2XZB2lX5n9sKCuuiqMpE0=; b=ip80I10y4sQXgGKTPaHzf53y8XQSmBFhRH2RtebhQpJrZQcTuTzxTiEjloim8Mchxq 18eC6sjsT9VrUxvgYTd5raBybkMfv52a7bWSV3Ldhv1MI2eSI+6NJJG65XK0U6GR/PE3 vQornODRuPfLBe7dH2AAY9pyp0SwSLQ70eOnc6JDIFr6JCC4G3SOGC+ROw8Gmnp4dJg1 R7f/Rf/96K5upDnL8XkbbFjnjBQ0fqWeQnC0+FczCSaaGk+tIrDUvowixJSUAiRt79/Q GlDA5HY75kRCqWynCSpbNizbP94RAXi8oXFR1iPlTxevKbmc8WNFTnfxFxvrp0jpv+A/ NxTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=myD06zpJwMaW9T1X32IUXd2XZB2lX5n9sKCuuiqMpE0=; b=czb6B+Ld2qTvjs+e1Z7sMxxLWIlQ0nCf34oM19z8zNmME19BTsC2JAa/iwgeSRbCow PNbffsdaSyE4TNkh9wZOvmwKzuM4A+buOWMr8u5rqDYn0J/mBW4bpDNFtFbYvaBZ5cC4 sGg3UesSmhnT41BEbSgj2vbNJLYAtyYL3LOFSH5HDbpxPwsuOLE/tPZABu7n2owrIKD8 yFNOydpBJ+B535QOeldHw9y4hrxOsFUDUawWJRC2S9g87RkeD6IvpbJDyy7Cdw7Wi2qV pK20l7RowsyLC4WoTXWjqjXkuIKkMVQR95TOCH8ccmnoa8vi7YKEyAK3zJEMgzhMJAbo NsRw== X-Gm-Message-State: AE9vXwNG/9k/Lg4Be4yxhwL8KkDnpsHlr3dYl2ne7A5bdDWLz89otTShb+CE3vlg4UUTmDX07s5qe8ovHUBySg== X-Received: by 10.36.33.17 with SMTP id e17mr32136721ita.41.1473175834008; Tue, 06 Sep 2016 08:30:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.26.3 with HTTP; Tue, 6 Sep 2016 08:30:33 -0700 (PDT) From: Ben Woods Date: Tue, 6 Sep 2016 23:30:33 +0800 Message-ID: Subject: r303920: Add crypt_r(3) To: ed@freebsd.org, ruby@freebsd.org, Adam Weinberger Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-ruby@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: FreeBSD-specific Ruby discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2016 15:30:35 -0000 Hi Ed, The recent addition of crypt_r(3) to FreeBSD 12 has broken the build of port security/rubygem-bcrypt. > current directory: /wrkdirs/usr/ports/security/rubygem-bcrypt/work/stage/usr/local/lib/ruby/gems/2.2/gems/bcrypt-3.1.11/ext/mri > make "DESTDIR=" > compiling crypt_gensalt.c > compiling crypt.c > In file included from crypt.c:2: > ./ow-crypt.h:19:14: error: conflicting types for 'crypt_r' > extern char *crypt_r(__CONST char *key, __CONST char *setting, void *data); > ^ > /usr/include/unistd.h:499:7: note: previous declaration is here > char *crypt_r(const char *, const char *, struct crypt_data *); > ^ > 1 error generated. > *** Error code 1 > > I tried patching the file in the port, with the following: > --- ext/mri/ow-crypt.h.orig 2016-09-06 14:48:21 UTC > +++ ext/mri/ow-crypt.h > @@ -6,6 +6,8 @@ > #ifndef _OW_CRYPT_H > #define _OW_CRYPT_H > > +#include > + > #undef __CONST > #if defined __GNUC__ > #define __CONST __const > @@ -16,8 +18,10 @@ > > #ifndef __SKIP_GNU > extern char *crypt(__CONST char *key, __CONST char *setting); > +#if __FreeBSD_version < 1200002 > extern char *crypt_r(__CONST char *key, __CONST char *setting, void > *data); > #endif > +#endif > > #ifndef __SKIP_OW > extern char *crypt_rn(__CONST char *key, __CONST char *setting, > But then the build fails in wrapper.c instead: > wrapper.c:188:7: error: conflicting types for 'crypt_r' > char *crypt_r(__CONST char *key, __CONST char *setting, void *data) > ^ > /usr/include/unistd.h:499:7: note: previous declaration is here > char *crypt_r(const char *, const char *, struct crypt_data *); > ^ > 1 error generated. > *** Error code 1 > This file only defines crypt_r if the following is not true: > #if defined(__GLIBC__) && defined(_LIBC) > Any ideas on the right way to fix this? Thanks in advance, Ben -- From: Benjamin Woods woodsb02@gmail.com