9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] some pcc questions
@ 2012-04-20 16:01 Jens Staal
  2012-04-20 16:24 ` cinap_lenrek
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Jens Staal @ 2012-04-20 16:01 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hi all

I have some problems that I sometimes run into while trying to port
stuff. One is that some files just "freezes" the compilation process
(but load goes down to 0 so it is not just labour intensive, but
rather that it just "sticks" there without doing anything) and when I
exit the compilation (by pressing "delete") I get different error
messages every time.

Is there a way to track down what is really happening in those cases
in order to solve them?


The second issue that I have been meaning to ask the list is about pcc
and bitfields - are they supported or is this some sort of can of
worms I have stepped into?

Here I have a more specific issue with compiling GNU m4: Compiling the
gnulib and all other files except src/builtin.c works fine with APE
libs and pcc, but builtin.c fails due to bitfields.
At the other side of the spectrum, a modern GNU m4 (including
src/builtin.c) can be compiled with the old GCC port, but there the
GCC-ported APE-libs are too old (vsnprintf etc not supported), so it
fails at the final linking phase since lots of stuff are not provided
by the C library.

Personally, I would prefer to crack that particular nut with pcc than
to go for an updated APE libs port to GCC so if there are specific
changes that can be done to bitfields in order to get it working, it
would be very interesting to hear about them...

some more details on why I even would bother doing such a thing:
http://code.google.com/p/ports2plan9/wiki/GNUonPlan9



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] some pcc questions
  2012-04-20 16:01 [9fans] some pcc questions Jens Staal
@ 2012-04-20 16:24 ` cinap_lenrek
  2012-04-20 16:29   ` cinap_lenrek
  2012-04-20 17:31   ` Charles Forsyth
  2012-04-23  6:30 ` Jens Staal
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: cinap_lenrek @ 2012-04-20 16:24 UTC (permalink / raw)
  To: 9fans

Attach: /rc/bin/tap

if something hangs, theres a good opportunity to figure
out what is happening by looking in what state the
various processes of the horde are using acid or acid -k.

this does require knowledge of wich process waits for whom.

for simple await() relationship, it is easy. there are
various pstree programs arround for plan9.

for process pipelines, i'v written the program tap (attached
to this mail) that walks the filedescriptor table of a
process, checks for a pipe and then searches /proc for other
processes having the other end of that pipe open doing this
recursively.

deadlocked fileservers are harder to track down.

if these hang conditions are reproducable, you might also try
stuff like rons ratrace.

good luck :)

--
cinap



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] some pcc questions
  2012-04-20 16:24 ` cinap_lenrek
@ 2012-04-20 16:29   ` cinap_lenrek
  2012-04-20 17:31   ` Charles Forsyth
  1 sibling, 0 replies; 9+ messages in thread
From: cinap_lenrek @ 2012-04-20 16:29 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 70 bytes --]

that attachment didnt quite work, lets try it this way :)

--
cinap

[-- Attachment #2: tap --]
[-- Type: text/plain, Size: 691 bytes --]

#!/bin/rc

v=()

fn otherqid {
	x=`{echo $1 | sed 's/[12]$//'}
	switch($1){
	case $x^1
		echo $x^2
	case $x^2
		echo $x^1
	}
}

fn traceqid {
	while(! ~ $#* 0){
		echo '['$2']' $3 $1
		tracepid `{grep -n `{otherqid $1} /proc/*/fd | sed 's!^/proc/([^/]+)/.*!\1!g'} \
			| sed 's/^/	/g'
		shift
		shift
		shift
	}
}

fn tracepid {
	while(! ~ $#* 0){
		echo $1 `{cat /proc/$1/args >[2]/dev/null}
		switch($1){
		case $v
			echo '	...'
		case *
			v=($1 $v)
			traceqid `{awk '/\|/{q=substr($5,2);print q" "$1" "$10}' /proc/$1/fd} \
				| sed 's/^/	/g'
		}
		shift
	}
}

if(~ $#* 0){
	echo 'Usage: ' $0 '[ pid ... ]' >[1=2]
	exit usage
}

tracepid $*

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] some pcc questions
  2012-04-20 16:24 ` cinap_lenrek
  2012-04-20 16:29   ` cinap_lenrek
@ 2012-04-20 17:31   ` Charles Forsyth
  1 sibling, 0 replies; 9+ messages in thread
From: Charles Forsyth @ 2012-04-20 17:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 119 bytes --]

cute.

On 20 April 2012 17:24, <cinap_lenrek@gmx.de> wrote:

> for process pipelines, i'v written the program tap

[-- Attachment #2: Type: text/html, Size: 349 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] some pcc questions
  2012-04-20 16:01 [9fans] some pcc questions Jens Staal
  2012-04-20 16:24 ` cinap_lenrek
@ 2012-04-23  6:30 ` Jens Staal
  2012-04-23 13:23   ` Comeau At9Fans
  2012-04-23 13:19 ` Comeau At9Fans
       [not found] ` <CAE9W7-gU72RNgbs6Pcuxp5KEtXBUsApZNGzNiEpvTgLtbL7wjw@mail.gmail.c>
  3 siblings, 1 reply; 9+ messages in thread
From: Jens Staal @ 2012-04-23  6:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> The second issue that I have been meaning to ask the list is about pcc
> and bitfields - are they supported or is this some sort of can of
> worms I have stepped into?
>

I have just hit another "pcc can not initialize bitfields" problem
with netsurf libcss. If anyone know how to tackle that issue (or if it
even CAN be tackled) it would be greatly appreciated.
The broken build of libcss can be found either at
/n/sources/contrib/staal1978/pkg/libcss-alpha1.tbz or [1].

[1] http://code.google.com/p/ports2plan9/downloads/detail?name=libcss-alpha1.tbz

I hope by solving this issue I might be able to make a native APE
build of GNU m4 pretty easily afterwards if the bitfield issue is the
same ;)



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] some pcc questions
  2012-04-20 16:01 [9fans] some pcc questions Jens Staal
  2012-04-20 16:24 ` cinap_lenrek
  2012-04-23  6:30 ` Jens Staal
@ 2012-04-23 13:19 ` Comeau At9Fans
       [not found] ` <CAE9W7-gU72RNgbs6Pcuxp5KEtXBUsApZNGzNiEpvTgLtbL7wjw@mail.gmail.c>
  3 siblings, 0 replies; 9+ messages in thread
From: Comeau At9Fans @ 2012-04-23 13:19 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 757 bytes --]

On Fri, Apr 20, 2012 at 12:01 PM, Jens Staal <staal1978@gmail.com> wrote:

> The second issue that I have been meaning to ask the list is about pcc
> and bitfields - are they supported or is this some sort of can of
> worms I have stepped into?
>

Bitfields are allowed to have lots of *-defined behavior, so often they are
cans of worms on many platforms.  Don't know if you're referring to this
kind of issue or something more specific that you might feel is a
limitation on Plan 9.

--
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE ==>     http://www.comeaucomputing.com/tryitout
World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?

[-- Attachment #2: Type: text/html, Size: 1188 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] some pcc questions
  2012-04-23  6:30 ` Jens Staal
@ 2012-04-23 13:23   ` Comeau At9Fans
  0 siblings, 0 replies; 9+ messages in thread
From: Comeau At9Fans @ 2012-04-23 13:23 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 798 bytes --]

On Mon, Apr 23, 2012 at 2:30 AM, Jens Staal <staal1978@gmail.com> wrote:

> I have just hit another "pcc can not initialize bitfields" problem
> with netsurf libcss. If anyone know how to tackle that issue (or if it
> even CAN be tackled) it would be greatly appreciated....
>

>From what I recall, it comes up when a bitfield is nested inside a struct,
and in particular the default initialization to 0 is attempted.  There may
be other cases as well.  It may have only been an issue at file scope too,
can't recall exactly.

--
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE ==>     http://www.comeaucomputing.com/tryitout
World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?

[-- Attachment #2: Type: text/html, Size: 1252 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] some pcc questions
       [not found] ` <CAE9W7-gU72RNgbs6Pcuxp5KEtXBUsApZNGzNiEpvTgLtbL7wjw@mail.gmail.c>
@ 2012-04-23 13:42   ` erik quanstrom
  2012-04-23 14:37     ` Bakul Shah
  0 siblings, 1 reply; 9+ messages in thread
From: erik quanstrom @ 2012-04-23 13:42 UTC (permalink / raw)
  To: 9fans

> On Fri, Apr 20, 2012 at 12:01 PM, Jens Staal <staal1978@gmail.com> wrote:
>
> > The second issue that I have been meaning to ask the list is about pcc
> > and bitfields - are they supported or is this some sort of can of
> > worms I have stepped into?
> >
>
> Bitfields are allowed to have lots of *-defined behavior, so often they are
> cans of worms on many platforms.  Don't know if you're referring to this
> kind of issue or something more specific that you might feel is a
> limitation on Plan 9.

crazy idea i haven't tried.

why not use X in sam or acme to mass-edit fu:bar -> fu[bar] and just make
fu an array.

- erik



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] some pcc questions
  2012-04-23 13:42   ` erik quanstrom
@ 2012-04-23 14:37     ` Bakul Shah
  0 siblings, 0 replies; 9+ messages in thread
From: Bakul Shah @ 2012-04-23 14:37 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Apr 23, 2012, at 6:42 AM, erik quanstrom <quanstro@quanstro.net> wrote:
> crazy idea i haven't tried.
> 
> why not use X in sam or acme to mass-edit fu:bar -> fu[bar] and just make
> fu an array.

? How will that work for something like
   struct X {int a:5, :8, c:12,:7; float d;} x;
Usually you can convert bitfields ops to operations under masked -- what the compiler has to do. So reading x.c becomes ((x.i>>7)&0xfff) etc. Where x.i represents the same word where a &c are stored. I thought that (except for pcc) bitfields code gen & performance issues got fixed a long time ago?



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-04-23 14:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20 16:01 [9fans] some pcc questions Jens Staal
2012-04-20 16:24 ` cinap_lenrek
2012-04-20 16:29   ` cinap_lenrek
2012-04-20 17:31   ` Charles Forsyth
2012-04-23  6:30 ` Jens Staal
2012-04-23 13:23   ` Comeau At9Fans
2012-04-23 13:19 ` Comeau At9Fans
     [not found] ` <CAE9W7-gU72RNgbs6Pcuxp5KEtXBUsApZNGzNiEpvTgLtbL7wjw@mail.gmail.c>
2012-04-23 13:42   ` erik quanstrom
2012-04-23 14:37     ` Bakul Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).