From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jul 23 20:50:04 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B9F1106566C for ; Sat, 23 Jul 2011 20:50:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DC8F98FC16 for ; Sat, 23 Jul 2011 20:50:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p6NKo3il017063 for ; Sat, 23 Jul 2011 20:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p6NKo3Qa017062; Sat, 23 Jul 2011 20:50:03 GMT (envelope-from gnats) Resent-Date: Sat, 23 Jul 2011 20:50:03 GMT Resent-Message-Id: <201107232050.p6NKo3Qa017062@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, David Shao Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AEF71065670 for ; Sat, 23 Jul 2011 20:40:26 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 1FFCD8FC12 for ; Sat, 23 Jul 2011 20:40:26 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p6NKePfo000738 for ; Sat, 23 Jul 2011 20:40:25 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p6NKePUm000736; Sat, 23 Jul 2011 20:40:25 GMT (envelope-from nobody) Message-Id: <201107232040.p6NKePUm000736@red.freebsd.org> Date: Sat, 23 Jul 2011 20:40:25 GMT From: David Shao To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/159147: Patch cmp to cmpq for security/libgcrypt 1.5.0 fails on earlier Pentium 4 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2011 20:50:04 -0000 >Number: 159147 >Category: ports >Synopsis: Patch cmp to cmpq for security/libgcrypt 1.5.0 fails on earlier Pentium 4 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jul 23 20:50:03 UTC 2011 >Closed-Date: >Last-Modified: >Originator: David Shao >Release: FreeBSD 9.0-CURRENT >Organization: >Environment: FreeBSD 9.0-CURRENT FreeBSD 9.0-CURRENT #1: Thu Jul 21 14:13:09 PDT 2011 root@:/usr/obj/usr/src/sys/MYKERNEL i386 >Description: PR 158994 "Fix security/libgcrypt 1.5.0 build with clang" included a patch to change inline asm cmp to cmpq in rijndael.c of libgcrypt 1.5.0, patch file patch-cipher-rijndael.c. The system with problems has for its compiler: Target: i386-undermydesk-freebsd Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 4.2.2 20070831 prerelease [FreeBSD] Unfortunately on an early Pentium 4 without EMT64 instructions, partial dmesg output of: CPU: Intel(R) Pentium(R) 4 CPU 1.80GHz (1816.21-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0xf24 Family = f Model = 2 Stepping = 4 Features=0x3febfbff and partial kenv output of: smbios.bios.reldate="08/06/2002" smbios.bios.vendor="Award Software, Inc." smbios.bios.version="ASUS P4B266 ACPI BIOS Revision 1010" tests using the gcc compiler show that "cmpq" is not recognized in inline asm whereas "cmp" and "cmpl" are recognized. >How-To-Repeat: On an earlier Pentium 4 machine without emt64 instructions, update to latest ports and try to update libgcrypt to 1.5.0. An error similar to the following will occur: /bin/sh /usr/local/bin/libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/usr/local/include -I/usr/local/include -O2 -pipe -fno-strict-aliasing -std=gnu89 -fvisibility=hidden -Wall -MT rijndael.lo -MD -MP -MF .deps/rijndael.Tpo -c -o rijndael.lo rijndael.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/usr/local/include -I/usr/local/include -O2 -pipe -fno-strict-aliasing -std=gnu89 -fvisibility=hidden -Wall -MT rijndael.lo -MD -MP -MF .deps/rijndael.Tpo -c rijndael.c -fPIC -DPIC -o .libs/rijndael.o {standard input}: Assembler messages: {standard input}:423: Error: suffix or operands invalid for `cmp' {standard input}:429: Error: suffix or operands invalid for `cmp' {standard input}:439: Error: suffix or operands invalid for `cmp' {standard input}:498: Error: suffix or operands invalid for `cmp' {standard input}:504: Error: suffix or operands invalid for `cmp' {standard input}:605: Error: suffix or operands invalid for `cmp' {standard input}:617: Error: suffix or operands invalid for `cmp' >Fix: The gcc 4.2.2 compiler appears perfectly capable of deducing an acceptable suffix for cmp for inline asm, perhaps due to the compiler's ability to use type information of memory arguments of integer size "int". The problem may be more with the present clang compiler than with the source code of libgcrypt 1.5.0. If a suffix for cmp must be supplied, it seems a general policy of using "cmpl" would be preferable to maintain backwards compatibility with older hardware that does not support 64-bit extensions. >Release-Note: >Audit-Trail: >Unformatted: