From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Jun 28 15:50:04 2007 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B1E016A400 for ; Thu, 28 Jun 2007 15:50:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id F03C913C457 for ; Thu, 28 Jun 2007 15:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5SFo3q2090115 for ; Thu, 28 Jun 2007 15:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5SFo37L090114; Thu, 28 Jun 2007 15:50:03 GMT (envelope-from gnats) Resent-Date: Thu, 28 Jun 2007 15:50:03 GMT Resent-Message-Id: <200706281550.l5SFo37L090114@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, Simun Mikecin Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95D2616A41F for ; Thu, 28 Jun 2007 15:41:37 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 6E90E13C4AE for ; Thu, 28 Jun 2007 15:41:37 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l5SFfbM7042066 for ; Thu, 28 Jun 2007 15:41:37 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l5SFfbLa042065; Thu, 28 Jun 2007 15:41:37 GMT (envelope-from nobody) Message-Id: <200706281541.l5SFfbLa042065@www.freebsd.org> Date: Thu, 28 Jun 2007 15:41:37 GMT From: Simun Mikecin To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: ports/114098: [patch] sysutils/devcpu does not build on amd64 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: Thu, 28 Jun 2007 15:50:04 -0000 >Number: 114098 >Category: ports >Synopsis: [patch] sysutils/devcpu does not build on amd64 >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: Thu Jun 28 15:50:03 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Simun Mikecin >Release: FreeBSD/amd64 6.2-STABLE >Organization: >Environment: FreeBSD data.home.hr 6.2-STABLE FreeBSD 6.2-STABLE #0: Sat Jun 23 11:46:36 CEST 2007 root@data.home.hr:/var/tmp/obj/usr/src.6/sys/DATA amd64 >Description: Code in cpu.c is not 64-bit clean when doing pointer to integer conversion. >How-To-Repeat: Try this on FreeBSD/amd64 machine: # cd /usr/ports/sysutils/devcpu # make Building will die with an error: cc -O2 -fno-strict-aliasing -pipe -march=athlon-fx -march=athlon-fx -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I- -I. -I@ -I@/contrib/altq -I@/../include -I/usr/include -finline-limit=8000 -fno-common -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions -std=c99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -c cpu.c cpu.c: In function `update_intel': cpu.c:336: warning: cast from pointer to integer of different size cpu.c: In function `update_amd': cpu.c:396: warning: cast from pointer to integer of different size *** Error code 1 >Fix: Patch attached with submission follows: diff -urN devcpu.orig/files/patch-cpu_cpu.c devcpu/files/patch-cpu_cpu.c --- devcpu.orig/files/patch-cpu_cpu.c Thu Jan 1 01:00:00 1970 +++ devcpu/files/patch-cpu_cpu.c Thu Jun 28 17:35:09 2007 @@ -0,0 +1,20 @@ +--- cpu/cpu.c.orig Tue Dec 12 12:06:02 2006 ++++ cpu/cpu.c Thu Jun 28 17:34:36 2007 +@@ -333,7 +333,7 @@ + /* + * Perform update + */ +- cpu_wrmsr(MSR_BIOS_UPDT_TRIG, (uint64_t)(0 | (unsigned int)ptr)); ++ cpu_wrmsr(MSR_BIOS_UPDT_TRIG, (uint64_t)ptr); + cpu_wrmsr(MSR_BIOS_SIGN, 0); + + /* Serialize instruction flow */ +@@ -393,7 +393,7 @@ + /* + * Perform update + */ +- cpu_wrmsr(MSR_K8_UCODE_UPDATE, (uint64_t)(0|(unsigned int)args->data)); ++ cpu_wrmsr(MSR_K8_UCODE_UPDATE, (uint64_t)args->data); + + /* Serialize instruction flow */ + do_cpuid(0, tmp); >Release-Note: >Audit-Trail: >Unformatted: