Package: x86info
Version: 1.15-2
Severity: important
Tags: patch
Hi,
x86info fails to build on GNU/kFreeBSD because a few things are done in
a linux specific way. Also kfreebsd-i386 is not listed in the
architecture list.
Please find attached a patch to fix that. The changes to the upstream
code are taken from the FreeBSD ports CVS. It would be nice if you could
apply this patch in the next upload.
Thanks in advance,
Aurelien
-- System Information:
Debian Release: testing/unstable
Architecture: kfreebsd-i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: GNU/kFreeBSD 5.4-1-686
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Versions of packages x86info depends on:
ii debconf [debconf-2.0] 1.4.66 Debian configuration management sy
ii libc0.1 2.3-1+kbsd.15 GNU C Library: Shared libraries an
ii makedev 2.3.1-79 creates device files in /dev
x86info recommends no packages.
-- debconf information excluded
Author: aurel32
Status: in BTS
diff -u x86info-1.15/debian/control x86info-1.15/debian/control
--- x86info-1.15/debian/control
+++ x86info-1.15/debian/control
@@ -6,7 +6,7 @@
Standards-Version: 3.6.2
Package: x86info
-Architecture: i386 amd64
+Architecture: i386 kfreebsd-i386 amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, makedev (>= 2.3.1-53)
Description: Display diagnostic information about i386 compatible CPUs
x86info displays diagnostic information about the CPUs fitted to i386
--- x86info-1.15.orig/bench/benchmarks.c
+++ x86info-1.15/bench/benchmarks.c
@@ -1,7 +1,8 @@
#include <time.h>
#include <sys/time.h>
-#include <asm/unistd.h>
+#include <sys/unistd.h>
#include <sys/stat.h>
+#include <sys/syscall.h>
#include <stdio.h>
#include "../x86info.h"
#include "bench.h"
@@ -13,7 +14,7 @@
if (show_bench != 1)
return;
- TIME(asm volatile("int $0x80" :"=a" (ret) :"0" (__NR_getppid)), "int
0x80");
+ TIME(asm volatile("int $0x80" :"=a" (ret) :"0" (SYS_getppid)), "int
0x80");
TIME(asm volatile("cpuid": : :"ax", "dx", "cx", "bx"), "cpuid");
TIME(asm volatile("addl $1,0(%esp)"), "addl");
--- x86info-1.15.orig/x86info.h
+++ x86info-1.15/x86info.h
@@ -1,10 +1,10 @@
#ifndef _X86INFO_H
#define _X86INFO_H
-#include <linux/types.h>
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned int u32;
+#include <sys/types.h>
+typedef u_int8_t u8;
+typedef u_int16_t u16;
+typedef u_int32_t u32;
#define VENDOR_AMD 1
#define VENDOR_CENTAUR 2