Created attachment 145618 [details] libgcrypt.diff The following patch was proposed by an user via mail to build happy libgrypt with GCC on FreeBSD 8.x Build logs: https://redports.org/buildarchive/20140804121800-54485/
> The following patch was proposed by an user via mail to build happy libgrypt > with GCC on FreeBSD 8.x Testbuild on 8.4amd64 @work. If I understand it, it *always* builds without using the assembler code ? Is my understanding correct ?
(In reply to Kurt Jaeger from comment #1) > > The following patch was proposed by an user via mail to build happy libgrypt > > with GCC on FreeBSD 8.x > > Testbuild on 8.4amd64 @work. > > If I understand it, it *always* builds without using the assembler code ? > Is my understanding correct ? Yes, libgcrypt has some assembly code routines but to disable it we can use '--disable-asm' option to the configure script.
I would have it disabled by default, but you can add an option to build with assembly routines. I think that's a pretty standard approach.
(In reply to John Marino from comment #3) > I would have it disabled by default, but you can add an option to build with > assembly routines. I think that's a pretty standard approach. Yes, I think that build libgcrypt with clang including -DNO_ASM flag in CFLAGS should work. Clarification: Using --disable-asm only disables the use of the MPI assembler modules but not of the other asm functions.
Created attachment 145657 [details] libgcrypt.diff New patch which fix libgcrypt build with GCC on 8.x/amd64 Build logs: https://redports.org/buildarchive/20140811092701-19531/
Created attachment 145708 [details] libgcrypt-fix-asm-8.x.diff Patch reworked to undefine assembly code with gcc on 8.x/amd64. Pending the OP report to commit it. Test build on 8.4-RELEASE/amd64: https://redports.org/~cpm/20140812103001-56669-232794/libgcrypt-1.6.1_4.log Rest of build logs: https://redports.org/buildarchive/20140812103001-56669/
moving to patch-ready
The OP confirms that the patch solves his problem. I show a copy of the email sent by Terry. Delivered-To: cjpugmed@gmail.com Received: by 10.220.131.202 with SMTP id y10csp270377vcs; Tue, 12 Aug 2014 22:22:35 -0700 (PDT) X-Received: by 10.140.87.244 with SMTP id r107mr2886017qgd.13.1407907354774; Tue, 12 Aug 2014 22:22:34 -0700 (PDT) Return-Path: <TERRY@tmk.com> Received: from server.tmk.com (server.tmk.com. [204.141.35.63]) by mx.google.com with ESMTPS id 94si972310qgl.88.2014.08.12.22.22.34 for <cjpugmed@gmail.com> (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 12 Aug 2014 22:22:34 -0700 (PDT) Received-SPF: pass (google.com: domain of TERRY@tmk.com designates 204.141.35.63 as permitted sender) client-ip=204.141.35.63; Authentication-Results: mx.google.com; spf=pass (google.com: domain of TERRY@tmk.com designates 204.141.35.63 as permitted sender) smtp.mail=TERRY@tmk.com Received: from tmk.com by tmk.com (PMDF V6.6 #37010) id <01PBBB7JZ74G001841@tmk.com> for cjpugmed@gmail.com; Wed, 13 Aug 2014 01:22:33 -0400 (EDT) Date: Wed, 13 Aug 2014 01:20:29 -0400 (EDT) From: Terry Kennedy <TERRY@tmk.com> Subject: Re: Port security/libgcrypt 1.6.1 upgrade In-reply-to: "Your message dated Tue, 12 Aug 2014 12:34:46 +0200" <CAHHLbRM0Tq66zFxoXzR=4JokzwM=jLye=_O5umahg466M_eBFA@mail.gmail.com> To: Carlos Jacobo Puga Medina <cjpugmed@gmail.com> Message-id: <01PBBBD0ZVZC001841@tmk.com> MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=UTF-8 References: <01PAY8UNOMJ80007SG@tmk.com> <20140803205850.GF1426@f10.opsec.eu> <01PAYHJ5PTXM0007SG@tmk.com> <CAHHLbRO_KUPDjHq3hOYsJmbcWV57snREmfHsAFMr+5UO0mAegg@mail.gmail.com> <CAHHLbRM6_qba6JdgpXBGCimK1iYWNua14EfigxBLdhfVhB5qFg@mail.gmail.com> <01PB86N5XWNC000TVX@tmk.com> <CAHHLbRN0pW-qN+vY1EHiG5GOuXoqGXNQwdHMy2-TsTXuzDFTmA@mail.gmail.com> <CAHHLbRMFWc-Dm5xX_LGe27RYAd28zw=UtTUYRbBFdKbhq-XDaQ@mail.gmail.com> <01PBA1JNRH88000V3D@tmk.com> <CAHHLbRMyPR4ZNepRYtWOuBD9rrKeAzTLY-TN-3Pi9D-0E=rnRg@mail.gmail.com> <CAHHLbRPqhAAOun+6XZuuT7q=qGZ_4sWrjRpTkHciw=gZuPfYSg@mail.gmail.com> > Sorry, I forgot to fix the patch name :) > > Test build on 8.4/amd64: > https://redports.org/~cpm/20140812103001-56669-232794/libgcrypt-1.6.1_4.log This one (https://bugs.freebsd.org/bugzilla/attachment.cgi?id=145708) works. Ok to commit. Thanks, Terry
(In reply to Carlos Jacobo Puga Medina from comment #6) > Created attachment 145708 [details] > libgcrypt-fix-asm-8.x.diff > > Patch reworked to undefine assembly code with gcc on 8.x/amd64. Pending the > OP report to commit it. tested on 10.0-amd64, has issues with it: # make /!\ libgcrypt-1.6.1_4: Makefile errors /!\ you cannot include bsd.port[.pre].mk twice *** Error code 1 Stop. make[1]: stopped in /usr/local/home/pi/myp/security/libgcrypt *** Error code 1 Stop.
Created attachment 145756 [details] libgcrypt-fix-asm-8.x-v1.diff Current patch fixes the problem. Build logs: https://redports.org/buildarchive/20140813125100-24398/
(In reply to Carlos Jacobo Puga Medina from comment #10) > Created attachment 145756 [details] > libgcrypt-fix-asm-8.x-v1.diff Test-build via poudriere on 8.4-i386 and amd64, 9.1-amd64, and 10.0-amd64.
(In reply to Kurt Jaeger from comment #11) > (In reply to Carlos Jacobo Puga Medina from comment #10) > > Created attachment 145756 [details] > > libgcrypt-fix-asm-8.x-v1.diff > > Test-build via poudriere on 8.4-i386 and amd64, 9.1-amd64, and 10.0-amd64. http://people.freebsd.org/~pi/misc/gcrypt/84i.log http://people.freebsd.org/~pi/misc/gcrypt/91a.log http://people.freebsd.org/~pi/misc/gcrypt/10a.log
moving back to patch-ready.
ack, same mistake. We are waiting for umq@ueo.co.jp (maintainer) Start the clock.
Do we have any news about this?
I'm retesting with the new framework, and commit if it builds.
A commit references this bug: Author: pi Date: Tue Sep 2 20:47:44 UTC 2014 New revision: 367081 URL: http://svnweb.freebsd.org/changeset/ports/367081 Log: security/libgcrypt: fix build without assembler on 8.x/amd64 PR: 192555 Submitted by: Carlos Jacobo Puga Medina <cpm@fbsd.es> Approved by: maintainer (timeout) Changes: head/security/libgcrypt/Makefile head/security/libgcrypt/files/extra-patch-configure
Committed, thanks for your patience.
Hint from tijl@: The patch removes .elif ${ARCH} == "amd64" which leads to CONFIGURE_ARGS+= --disable-drng-support for i386 (which is wasn't before). Is that what you intended ? If so, why ?
Created attachment 146721 [details] re-add disable drng support on amd64 I removed it by mistake. Bump PORTREVISION to re-add it.
Created attachment 146723 [details] re-add disable drng support on amd64
Created attachment 146724 [details] re-add disable drng support on amd64
Indeed --disable-drng-support is only applied on amd64. Both before and after modifying Makefile. Is it intended? https://redports.org/buildarchive/20140903085200-19734/
That's because clang-in-world generates bytecode with RDRAND instructions. They don't work on AMD amd64. The last version makes vpnc dump core on SIGILL for me.
(In reply to arcade from comment #24) > That's because clang-in-world generates bytecode with RDRAND instructions. > They don't work on AMD amd64. > > The last version makes vpnc dump core on SIGILL for me. Fixes this patch your problem? https://bugs.freebsd.org/bugzilla/attachment.cgi?id=146724
(In reply to Carlos Jacobo Puga Medina from comment #26) > (In reply to arcade from comment #24) > > That's because clang-in-world generates bytecode with RDRAND instructions. > > They don't work on AMD amd64. > > > > The last version makes vpnc dump core on SIGILL for me. > > Fixes this patch your problem? > > https://bugs.freebsd.org/bugzilla/attachment.cgi?id=146724 I'm sorry, I clicked twice when I replied you :)
1. This is not a patch, this is whole Makefile. 2. Taking out bumping version to 1.6.2_5 this works for me. I mean this works: --- Makefile (revision 367239) +++ Makefile (working copy) @@ -41,6 +41,10 @@ CONFIGURE_ARGS+= --disable-aesni-support .endif +.elif ${ARCH} == "amd64" +.if (${OSVERSION} < 900000) +USE_GCC= yes +.endif CONFIGURE_ARGS+= --disable-drng-support .endif
This would seem to be redundant, since we already have: # Fix build without ASM on 8.x/amd64 .if ${OPSYS} == FreeBSD && ${ARCH} == "amd64" && ${OSVERSION} < 900000 USE_GCC= any EXTRA_PATCHES+= ${FILESDIR}/extra-patch-configure .endif The problem (how we got into this swamp in the first place) is that "USE_GCC= yes" wants to drag in gcc (currently gcc47) and its huge list of dependencies, just so a few assembly instructions not recognized by the base GCC in 8-STABLE (4.2.1) can be used. "USE_GCC= any" permits the use of the base GCC. However, none of the --disable-foo knobs in configure to control assembly language are actually connected to anything useful, hence the need for extra-patch-configure to beat configure into submission.
What this patch actually does is moving "CONFIGURE_ARGS+= --disable-drng-support" from i386 to amd64.
Ok, as long as we end up with "USE_GCC= any" (instead of yes) on FreeBSD 8.x amd64. Unless I'm missing something, bugzilla is pretty confusing because there doesn't seem to be any way to ask for either the complete, patched file or just the patch as of any comment that proposes a patch. Sometimes I get one, sometimes the other, and sometimes nothing...
Created attachment 146774 [details] libgcrypt-1.6.1_5.diff Fix build without ASM on 8.x and relocate '--disable-drng-support' flag.
Created attachment 146778 [details] libgcrypt-1.6.1_5.diff
I'm not sure we're making progress here. Looks like the CONFIGURE_ARGS in this patch has a # commenting it out, and disable-drng-support is missing the -- at the beginning.
Created attachment 146779 [details] libgcrypt-1.6.1_5.diff Thanks, it was fixed.
(In reply to Carlos Jacobo Puga Medina from comment #35) > Created attachment 146779 [details] > libgcrypt-1.6.1_5.diff > > Thanks, it was fixed. http://people.freebsd.org/~pi/logs/security__libgcrypt-10a-1409850078.txt http://people.freebsd.org/~pi/logs/security__libgcrypt-91a-1409850078.txt http://people.freebsd.org/~pi/logs/security__libgcrypt-84i-1409850078.txt Builds. Tested with vpnc on AMD based amd64 CPU with 10.0p7, works. So I'm committing this.
A commit references this bug: Author: pi Date: Thu Sep 4 17:28:35 UTC 2014 New revision: 367293 URL: http://svnweb.freebsd.org/changeset/ports/367293 Log: security/libgcrypt: fix build with GCC on 8.x/amd64, 2nd attempt Thanks to tijl@ for spotting the Makefile bug. PR: 192555 Submitted by: Carlos Jacobo Puga Medina <cpm@fbsd.es> Approved by: maintainer (timeout) Changes: head/security/libgcrypt/Makefile