Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Mar 2014 08:02:14 GMT
From:      Stoyan Dimov <pr.freebsd.org@registrations.systeem.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/187441: security/libgcrypt builds with generic MPI code instead of optimized assembler code
Message-ID:  <201403110802.s2B82Edu057497@cgiserv.freebsd.org>
Resent-Message-ID: <201403110810.s2B8A00D073279@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         187441
>Category:       ports
>Synopsis:       security/libgcrypt builds with generic MPI code instead of optimized assembler code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 11 08:10:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Stoyan Dimov
>Release:        9.1-RELEASE-p8, 10.0-RELEASE
>Organization:
>Environment:
FreeBSD test 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r261435: Mon Feb 24 15:41:34 UTC 2014     root@test:/usr/obj/usr/src/sys/JERRY  amd64

>Description:
security/libgcrypt builds with generic C code instead of optimized assembler code. 
>How-To-Repeat:
In /usr/ports/security/libgcrypt do:
make configure
Towards the end you will see:
config.status: linking mpi/generic/mpih-add1.c to mpi/mpih-add1.c
config.status: linking mpi/generic/mpih-sub1.c to mpi/mpih-sub1.c
config.status: linking mpi/generic/mpih-mul1.c to mpi/mpih-mul1.c
config.status: linking mpi/generic/mpih-mul2.c to mpi/mpih-mul2.c
config.status: linking mpi/generic/mpih-mul3.c to mpi/mpih-mul3.c
config.status: linking mpi/generic/mpih-lshift.c to mpi/mpih-lshift.c
config.status: linking mpi/generic/mpih-rshift.c to mpi/mpih-rshift.c
config.status: linking mpi/generic/mpi-asm-defs.h to mpi/mpi-asm-defs.h


For amd64 architecture the lines above should look like this:
config.status: linking mpi/amd64/mpih-add1.S to mpi/mpih-add1-asm.S
config.status: linking mpi/amd64/mpih-sub1.S to mpi/mpih-sub1-asm.S
config.status: linking mpi/amd64/mpih-mul1.S to mpi/mpih-mul1-asm.S
config.status: linking mpi/amd64/mpih-mul2.S to mpi/mpih-mul2-asm.S
config.status: linking mpi/amd64/mpih-mul3.S to mpi/mpih-mul3-asm.S
config.status: linking mpi/amd64/mpih-lshift.S to mpi/mpih-lshift-asm.S
config.status: linking mpi/amd64/mpih-rshift.S to mpi/mpih-rshift-asm.S
config.status: linking mpi/amd64/mpi-asm-defs.h to mpi/mpi-asm-defs.h

>Fix:
configure script uses a helper script to decide which MPI code to use. That script is mpi/config.links.

The problem is that configure script detects that host x86_64-unknown-freebsdX while FreeBSD port systems sets the 'build' type to amd64-portbld-freebsdX.

In mpi/config.links there is a section for x86_64-*-* but there is nothing about amd64-*-*. 

IMHO the easiest way to fix this is to patch mpi/config.links by adding amd64-*-* section same as x86_64-*-* section. Attached file does that for libgcrypt 1.5.3.

Patch attached with submission follows:

diff -r -N -u security/libgcrypt.orig/files/patch-mpi-config.links security/libgcrypt/files/patch-mpi-config.links
--- security/libgcrypt.orig/files/patch-mpi-config.links	1970-01-01 00:00:00.000000000 +0000
+++ security/libgcrypt/files/patch-mpi-config.links	2014-03-10 14:27:01.192576531 +0000
@@ -0,0 +1,14 @@
+--- mpi/config.links.orig	2014-03-10 14:24:48.337585447 +0000
++++ mpi/config.links	2014-03-10 14:25:16.754600736 +0000
+@@ -117,6 +117,11 @@
+ 	cat  $srcdir/mpi/i386/syntax.h	    >>./mpi/asm-syntax.h
+ 	path="amd64"
+ 	;;
++    amd64-*-*)
++	echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
++	cat  $srcdir/mpi/i386/syntax.h	    >>./mpi/asm-syntax.h
++	path="amd64"
++	;;
+     alpha*-*-*)
+ 	echo '/* configured for alpha */' >>./mpi/asm-syntax.h
+ 	path="alpha"


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403110802.s2B82Edu057497>