9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Bengt Kleberg <bengt.kleberg@ericsson.com>
To: 9fans@cse.psu.edu
Subject: [9fans] plan9port, sun-os, cc, how to compile
Date: Mon, 24 May 2004 15:15:55 +0000	[thread overview]
Message-ID: <c8st9q$ffc$1@newstree.wise.edt.ericsson.se> (raw)

greetings,

this is about the plan9port plan9-20040517.tar.gz. i have sun-os 5.8,
and sun-cc.


first i had trouble with sun-os yield() vs plan9 yield(). sun-os and
plan9 man pages both agree on
void	yield(void)
but plan9/include/thread.h and plan9/src/libthread/sched.c uses
int 	yield(void)
it has proved impossible (so far) to hide the sun-os definition of
yield(). i decided to redefine plan9 yield().
*** /home/eleberg/private/plan9/include/thread.h	Mon May 24 14:07:45 2004
--- /home/eleberg/private/plan9/include/thread.h.original	Mon May 24
14:06:52 2004
***************
*** 121,130 ****
   int	tprivalloc(void);
   void	tprivfree(int);
   void	**tprivaddr(int);
! int	p9yield(void);
! #ifndef NOPLAN9DEFINES
! #define	yield	p9yield
! #endif
   long		threadstack(void);

   extern	int		mainstacksize;
--- 121,128 ----
   int	tprivalloc(void);
   void	tprivfree(int);
   void	**tprivaddr(int);
! int	yield(void);
!
   long		threadstack(void);

   extern	int		mainstacksize;



next problem was in plan9/src/libmach. there is no SunOS.c. i have
copied Darwin.c to SunOS.c, which allows the installation to continue.
i think i have written before about this to comp.os.plan9.


finally i had to add a comment to plan9/src/cmd/astro/comet.c.
*** /home/eleberg/private/plan9/src/cmd/astro/comet.c	Mon May 24
14:22:27 2004
--- /home/eleberg/private/plan9/src/cmd/astro/comet.c.original	Mon May
24 14:22:17 2004
***************
*** 73,79 ****
   		151.0510,
   		83.1909,
   	};	/*C/1999 S4 (Linear) */
! /*	elem=(struct elem)
   	{
   		etdate(2002, 3, 18.9784),
   		0.5070601,
--- 73,79 ----
   		151.0510,
   		83.1909,
   	};	/*C/1999 S4 (Linear) */
! 	elem=(struct elem)
   	{
   		etdate(2002, 3, 18.9784),
   		0.5070601,

doing this allows the installation to continue. it is obvious from the
code that the function now uses non initialised data, but the compiler
only complains about
./astro.h:203: warning: macro redefined: sun
:-)


bengt


                 reply	other threads:[~2004-05-24 15:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='c8st9q$ffc$1@newstree.wise.edt.ericsson.se' \
    --to=bengt.kleberg@ericsson.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).