! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
cpugraph plugin can't be built on GNU/kFreeBSD
Status:
RESOLVED: FIXED
Product:
Xfce4-cpugraph-plugin
Component:
General

Comments

Description Yves-Alexis Perez editbugs 2007-03-21 18:21:18 CET
A Debian GNU/kFreeBSD user reported that xfce4-cpugraph-plugin couldn't be built using this special suite. He provided a patch (attached) to fix this.

Regards,

--
Yves-Alexis Perez
Comment 1 Yves-Alexis Perez editbugs 2007-03-21 18:22:29 CET
Created attachment 1051 
fix ftbfs on GNU/kFreeBSD
Comment 2 Florian Rivoal editbugs 2010-03-07 12:33:54 CET
I am a bit confused by this patch. Personally, I don't use Debian GNU/kFreeBSD, but I'd be glad to provide support for it. As far as I know (see the link below), Debian GNU/kFreeBSD uses FreeBSD's kernel APIs.

http://wiki.debian.org/Debian_GNU/kFreeBSD_FAQ#Q.3AWhichsyscallkernelinterfaceisusedbybinariescompiledforDebianGNU.2BAC8-kFreeBSD.3F

In that case, shouldn't we build xfce4-cpugraph on Debian GNU/kFreeBSD the same way as it is build on FreeBSD, rather than on linux? The only part that is OS dependent is the one that queries the Kernel for CPU usage.
Comment 3 Yves-Alexis Perez editbugs 2010-03-07 14:05:12 CET
Yep but it's Debian GNU/kFreeBSD, meaning we use the GNU libc (in fact eglibc, but still).
Comment 4 Florian Rivoal editbugs 2010-03-07 16:39:50 CET
This part of the code behind #ifdef __linux__ isn't using the glibc in particular. It is using the /proc filesystem to find information from the kernel, and that is typical of the linux kernel.

I suppose (and googling around seems to confirm that) that freebsd provides an emulation of that linux proc file system, so that's why the patch works. But it works because Freebsd supports /proc, not because GNU/kFreeBSD uses glibc. There is no guarantee that /proc will be available on any operating system that uses glibc. So using __GLIBC__ isn't a reliable way of checking if /proc is available.

That said, I am interested in supporting GNU/kFreeBSD, so I'll apply a similar patch, but rather that __GLIBC__, following the guideline posted in the link below, I'll be using __FreeBSD_kernel__.

http://glibc-bsd.alioth.debian.org/porting/PORTING

What I still have to see is if I'll read from /proc or if I'll use the FreeBSD system call. The second options sounds more native to GNU/kFreeBSD to me, but either way would be fine.

In any case, you can expect GNU/kFreeBSD support for 0.5
Comment 5 Yves-Alexis Perez editbugs 2010-03-07 18:26:29 CET
Hmhm, I didn't test the patch myself, and I'm not sure there's a /proc under kFreeBSD. Maybe the patch was just enough to build cpugraph but not enough for make it work.

If you need test builds I have access to a kFreeBSD machine (without X running though so I can't test afterwards)
Comment 6 Yves-Alexis Perez editbugs 2010-03-07 18:29:08 CET
mhm, after checking, yes there's some kind of /proc emulation:

io% uname -a
GNU/kFreeBSD io.debian.net 8.0-1-686 #0 Wed Jan 27 12:33:10 UTC 2010 i686 i386 AMD Sempron(tm) Processor 2600+ GNU/kFreeBSD
io% ls /proc
0      13     1360   286    59091  70842  71581  84962	  mounts      version
1      13295  14     3	    6	   70960  71583  84994	  mtab
10     13296  15     30999  66706  71018  71584  9	  net
10542  13307  16     349    66709  71019  71591  99488	  partitions
10543  1355   17     36299  66710  71158  76167  cmdline  scsi
11     1356   18     4	    7	   71433  76231  cpuinfo  self
12     1357   19     440    704    71476  7700	 devices  stat
1202   1358   2      473    705    71478  8	 loadavg  sys
1223   1359   22965  5	    706    71492  800	 meminfo  uptime
Comment 7 Florian Rivoal editbugs 2010-03-08 11:54:50 CET
Thanks for the info. I have a few other things to do first, but I'll comment again here bug when I get to this.
Comment 8 Florian Rivoal editbugs 2010-04-17 15:00:32 CEST
I committed a fix for this, letting GNU/kFreeBSD use the linux /proc emulation to fetch cpu data.

As I don't have access to a GNU/kFreeBSD machine, I'd be grateful if someone could report if it compiles and runs as expected.

Bug #3041

Reported by:
Yves-Alexis Perez
Reported on: 2007-03-21
Last modified on: 2010-10-03

People

Assignee:
Florian Rivoal
CC List:
1 user

Version

Version:
0.3.0 or older

Attachments

fix ftbfs on GNU/kFreeBSD (374 bytes, patch)
2007-03-21 18:22 CET , Yves-Alexis Perez
no flags

Additional information