ports/114098: [patch] sysutils/devcpu does not build on amd64

Simun Mikecin numisemis at yahoo.com
Thu Jun 28 15:50:04 UTC 2007


>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 at 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:



More information about the freebsd-ports-bugs mailing list