9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Has Anyone compiled 9vx on snow leopard ?
@ 2010-02-26  9:43 prem
  2010-02-26 15:16 ` Oleg Finkelshteyn
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: prem @ 2010-02-26  9:43 UTC (permalink / raw)
  To: 9fans

Hi,
I am trying to get 9vx compiled on SnowLeopard 10.6.2

first of all it complains,
/usr/include/ucontext.h:42:2: error: #error ucontext routines are
deprecated, and require _XOPEN_SOURCE to be defined

I resolved this using other defines in the source, added -
D_XOPEN_SOURCE=500

then I get this error
libvx32/darwin.c:20:2: error: #error "vx32 on Darwin x86-64 is
unimplemented."

Then I added -m32 to all the CFLAGS (for 9vx and libvx32) then I ended
up in following errors

Undefined symbols:
  "_vxrun_cleanup", referenced from:
      _xscan in libvx32.a(emu.o)
      _xemit in libvx32.a(emu.o)
      _vxproc_run in libvx32.a(emu.o)
      _vxrun_cleanup$non_lazy_ptr in libvx32.a(sig.o)
      _vx32_sighandler in libvx32.a(darwin.o)
  "_vxrun", referenced from:
....
 A lot like this

I am using 9vx hg head from code.swtch.com

Cheers,
/Prem



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

* Re: [9fans] Has Anyone compiled 9vx on snow leopard ?
  2010-02-26  9:43 [9fans] Has Anyone compiled 9vx on snow leopard ? prem
@ 2010-02-26 15:16 ` Oleg Finkelshteyn
  2010-03-02 17:02   ` [9fans] compiler warnings for libavl/avl.c EBo
  2010-03-02 17:40   ` EBo
  2010-03-01  9:49 ` [9fans] Has Anyone compiled 9vx on snow leopard ? prem
  2010-03-01  9:49 ` prem
  2 siblings, 2 replies; 12+ messages in thread
From: Oleg Finkelshteyn @ 2010-02-26 15:16 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> I am trying to get 9vx compiled on SnowLeopard 10.6.2

Andre has some problems posting to 9fans, but he says this should fix
your problem:
http://qcx.be/attic/9vx-osx-fix.patch

-Oleg



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

* Re: [9fans] Has Anyone compiled 9vx on snow leopard ?
  2010-02-26  9:43 [9fans] Has Anyone compiled 9vx on snow leopard ? prem
  2010-02-26 15:16 ` Oleg Finkelshteyn
@ 2010-03-01  9:49 ` prem
  2010-03-01  9:49 ` prem
  2 siblings, 0 replies; 12+ messages in thread
From: prem @ 2010-03-01  9:49 UTC (permalink / raw)
  To: 9fans

On Feb 26, 8:20 pm, olegf...@gmail.com (Oleg Finkelshteyn) wrote:
> > I am trying to get 9vx compiled on SnowLeopard 10.6.2
>
> Andre has some problems posting to 9fans, but he says this should fix
> your problem:http://qcx.be/attic/9vx-osx-fix.patch
>
> -Oleg

Thanks for the patch, I applied it on a clean tree. but it still
doesn't resolve the problem.
==================gcc -fno-inline -o 9vx/9vx 9vx/bootcode.o 9vx/devaudio.o 9vx/devaudio-
none.o 9vx/devfs-posix.o 9vx/devip.o 9vx/devip-posix.o 9vx/
devmntloop.o 9vx/devmouse.o 9vx/devtab.o 9vx/factotum.o 9vx/kprocdev.o
9vx/label.o 9vx/main.o 9vx/mmu.o 9vx/sched.o 9vx/sdloop.o 9vx/stub.o
9vx/term.o 9vx/time.o 9vx/trap.o 9vx/tty.o 9vx/vx32.o 9vx/osx/signal.o
9vx/a/allocb.o 9vx/a/auth.o 9vx/a/bo.o 9vx/a/chan.o 9vx/a/classmask.o
9vx/a/cleanname.o 9vx/a/convD2M.o 9vx/a/convM2D.o 9vx/a/convS2M.o 9vx/
a/convM2S.o 9vx/a/dev.o 9vx/a/devcap.o 9vx/a/devcons.o 9vx/a/devdraw.o
9vx/a/devdup.o 9vx/a/devenv.o 9vx/a/devmnt.o 9vx/a/devproc.o 9vx/a/
devpipe.o 9vx/a/devroot.o 9vx/a/devsd.o 9vx/a/devsrv.o 9vx/a/devssl.o
9vx/a/devtls.o 9vx/a/eipfmt.o 9vx/a/encodefmt.o 9vx/a/fault.o 9vx/a/
fcallfmt.o 9vx/a/fmt.o 9vx/a/getfields.o 9vx/a/ipaux.o 9vx/a/latin1.o
9vx/a/page.o 9vx/a/parse.o 9vx/a/parseip.o 9vx/a/pgrp.o 9vx/a/print.o
9vx/a/proc.o 9vx/a/qio.o 9vx/a/qlock.o 9vx/a/sdscsi.o 9vx/a/segment.o
9vx/a/strecpy.o 9vx/a/swap.o 9vx/a/sysfile.o 9vx/a/sysproc.o 9vx/a/
thwack.o 9vx/a/tokenize.o 9vx/a/u16.o 9vx/a/u32.o 9vx/a/u64.o 9vx/a/
unthwack.o 9vx/a/utf.o 9vx/osx/screen.o 9vx/osx/draw.o 9vx/libsec/
libsec.a 9vx/libmemlayer/libmemlayer.a 9vx/libmemdraw/libmemdraw.a 9vx/
libdraw/libdraw.a libvx32/libvx32.a  -m32 -ggdb -framework Carbon -
framework QuickTime -lpthread
Undefined symbols:
  "_vxrun_cleanup", referenced from:
      _xscan in libvx32.a(emu.o)
      _xemit in libvx32.a(emu.o)
      _vxproc_run in libvx32.a(emu.o)
      _vxrun_cleanup$non_lazy_ptr in libvx32.a(sig.o)
      _vx32_sighandler in libvx32.a(darwin.o)
  "_vxrun", referenced from:
      _vxproc_run in libvx32.a(emu.o)
  "_vxrun_return", referenced from:
      _vxrun_lookup_backpatch in libvx32.a(rts.o)
      _vxrun_lookup_indirect in libvx32.a(rts.o)
      _vxrun_gentrap in libvx32.a(rts.o)
  "_vx_run_S_start", referenced from:
      _vx_run_S_start$non_lazy_ptr in libvx32.a(sig.o)
  "_vxrun_setup", referenced from:
      _xscan in libvx32.a(emu.o)
      _xemit in libvx32.a(emu.o)
      _vxproc_run in libvx32.a(emu.o)
      _vx32_sighandler in libvx32.a(darwin.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [9vx/9vx] Error 1
=====================================


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

* Re: [9fans] Has Anyone compiled 9vx on snow leopard ?
  2010-02-26  9:43 [9fans] Has Anyone compiled 9vx on snow leopard ? prem
  2010-02-26 15:16 ` Oleg Finkelshteyn
  2010-03-01  9:49 ` [9fans] Has Anyone compiled 9vx on snow leopard ? prem
@ 2010-03-01  9:49 ` prem
  2010-03-01 10:30   ` John Stalker
  2 siblings, 1 reply; 12+ messages in thread
From: prem @ 2010-03-01  9:49 UTC (permalink / raw)
  To: 9fans

On Feb 26, 8:20 pm, olegf...@gmail.com (Oleg Finkelshteyn) wrote:
> > I am trying to get 9vx compiled on SnowLeopard 10.6.2
>
> Andre has some problems posting to 9fans, but he says this should fix
> your problem:http://qcx.be/attic/9vx-osx-fix.patch
>
> -Oleg

Thanks for the patch,
I had to comment out some more stuff to get it working.. for anyone
interested following is the patch. This patch doesn't do much
otherthan making everything to compile as a 32-bit. This however only
solves the compilation part. 9vx crashes while launching acme,
resizing window etc (i.e nearly unusable). and this is true for the
9vx.OSX.gz binary in the mercurial repository.

=============diff -r c7e9b5edb8d4 src/9vx/Makefrag
--- a/src/9vx/Makefrag	Sun Dec 27 09:49:22 2009 -0800
+++ b/src/9vx/Makefrag	Sun Feb 28 11:43:12 2010 +0530
@@ -132,7 +132,7 @@
 		screen.o \
 		draw.o \
 	)
-PLAN9_osx_LIBS = -ggdb -framework Carbon -framework QuickTime
+PLAN9_osx_LIBS = -m32 -ggdb -framework Carbon -framework QuickTime


 PLAN9_GUI_OBJS = $(PLAN9_$(PLAN9GUI)_OBJS)
diff -r c7e9b5edb8d4 src/9vx/a/dat.h
--- a/src/9vx/a/dat.h	Sun Dec 27 09:49:22 2009 -0800
+++ b/src/9vx/a/dat.h	Sun Feb 28 11:43:12 2010 +0530
@@ -1,3 +1,6 @@
+#if defined(__APPLE__)
+#define _XOPEN_SOURCE
+#endif
 #include <ucontext.h>
 #include "libvx32/vx32.h"

diff -r c7e9b5edb8d4 src/Makefrag
--- a/src/Makefrag	Sun Dec 27 09:49:22 2009 -0800
+++ b/src/Makefrag	Sun Feb 28 11:43:12 2010 +0530
@@ -5,6 +5,10 @@
 #COMMON_CFLAGS = -g -MD -std=gnu99 -I. $(CFLAGS)
 COMMON_LDFLAGS = -g -L. $(LDFLAGS)

+ifeq ($(OS),darwin)
+COMMON_CFLAGS := -m32 $(COMMON_CFLAGS)
+endif
+
 # Host environment compiler options
 HOST_CC		:= $(CC) -fno-inline
 HOST_LD		:= $(LD)
@@ -52,15 +56,24 @@


 # Include Makefrags for subdirectories
+# Don't try to build libvxc,vxrun,vxlinux,vxa,hash,micro or test on
darwin. It's broken beyond repair currently.
+
+ifneq ($(OS),darwin)
 include libvxc/Makefrag
+endif
+
 include libvx32/Makefrag
+ifneq ($(OS),darwin)
 include vxrun/Makefrag
 include vxlinux/Makefrag
 include vxa/Makefrag		# VXA decoders
 include hash/Makefrag		# cryptographic hash algorithms
 include micro/Makefrag		# microbenchmarks
+endif
 include 9vx/Makefrag	# Plan 9 VX
+ifneq ($(OS),darwin)
 include test/Makefrag		# vx32 tests
+endif

 DEPS_FILES := $(wildcard */*.d */*/*.d */*/*/*.d)
 CLEAN_FILES += .deps $(DEPS_FILES)
diff -r c7e9b5edb8d4 src/libvx32/Makefrag
--- a/src/libvx32/Makefrag	Sun Dec 27 09:49:22 2009 -0800
+++ b/src/libvx32/Makefrag	Sun Feb 28 11:43:12 2010 +0530
@@ -1,8 +1,8 @@
-ifeq ($(ARCH),x86_64)
-VX32_RUN = run64.o
-else
+#ifeq ($(ARCH),x86_64)
+#VX32_RUN = run64.o
+#else
 VX32_RUN = run32.o
-endif
+#endif

 ifeq ($(OS),darwin)
 VX32_RUN := $(VX32_RUN) darwin-asm.o
diff -r c7e9b5edb8d4 src/libvx32/darwin.c
--- a/src/libvx32/darwin.c	Sun Dec 27 09:49:22 2009 -0800
+++ b/src/libvx32/darwin.c	Sun Feb 28 11:43:12 2010 +0530
@@ -7,6 +7,9 @@
 #include <string.h>
 #include <signal.h>
 #include <assert.h>
+#if defined(__APPLE__)
+#define _XOPEN_SOURCE
+#endif
 #include <ucontext.h>
 #include <ucontext.h>
 #include <architecture/i386/table.h>
diff -r c7e9b5edb8d4 src/libvx32/sig.c
--- a/src/libvx32/sig.c	Sun Dec 27 09:49:22 2009 -0800
+++ b/src/libvx32/sig.c	Sun Feb 28 11:43:12 2010 +0530
@@ -1,4 +1,7 @@
 #include <sys/signal.h>
+#if defined(__APPLE__)
+#define _XOPEN_SOURCE
+#endif
 #include <ucontext.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -r c7e9b5edb8d4 src/libvx32/vx32impl.h
--- a/src/libvx32/vx32impl.h	Sun Dec 27 09:49:22 2009 -0800
+++ b/src/libvx32/vx32impl.h	Sun Feb 28 11:43:12 2010 +0530
@@ -1,6 +1,10 @@
 #ifndef VX32_IMPL_H
 #define VX32_IMPL_H

+#if defined (__APPLE__) && !defined (_XOPEN_SOURCE)
+#define _XOPEN_SOURCE
+#endif
+
 #include <setjmp.h>
 #include <sys/signal.h>
 #include <ucontext.h>
========================


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

* Re: [9fans] Has Anyone compiled 9vx on snow leopard ?
  2010-03-01  9:49 ` prem
@ 2010-03-01 10:30   ` John Stalker
  0 siblings, 0 replies; 12+ messages in thread
From: John Stalker @ 2010-03-01 10:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I'm using 9vx without problems on Snow Leopard.  I never tried compiling.
I just copied over the binary when I upgraded from Leopard.

--
John Stalker
School of Mathematics
Trinity College Dublin
tel +353 1 896 1983
fax +353 1 896 2282



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

* [9fans] compiler warnings for libavl/avl.c
  2010-02-26 15:16 ` Oleg Finkelshteyn
@ 2010-03-02 17:02   ` EBo
  2010-03-02 17:12     ` erik quanstrom
  2010-03-02 17:40   ` EBo
  1 sibling, 1 reply; 12+ messages in thread
From: EBo @ 2010-03-02 17:02 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


The following two subroutines are defined and not used anywhere.  Should they
redefined as void or possibly removed?

  EBo --

================

static void
walkavl(Avl *t, void (*f)(Avl*, void*), void *v)
{
	if(t == nil)
		return;
	walkavl(t->n[0], f, v);
	f(t, v);
	walkavl(t->n[1], f, v);
}

static void
checkparents(Avl *a, Avl *p)
{
	if(a == nil)
		return;
	if(a->p != p)
		print("bad parent\n");
	checkparents(a->n[0], a);
	checkparents(a->n[1], a);
}




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

* Re: [9fans] compiler warnings for libavl/avl.c
  2010-03-02 17:02   ` [9fans] compiler warnings for libavl/avl.c EBo
@ 2010-03-02 17:12     ` erik quanstrom
  0 siblings, 0 replies; 12+ messages in thread
From: erik quanstrom @ 2010-03-02 17:12 UTC (permalink / raw)
  To: ebo, 9fans

On Tue Mar  2 12:03:35 EST 2010, ebo@sandien.com wrote:
>
> The following two subroutines are defined and not used anywhere.  Should they
> redefined as void or possibly removed?

it's perfectly reasonable to leave code in for testing purposes
that never gets called.

> -int errno;
> +#include <errno.h>
>
> should the base source include this patch?

what's the advantage?  the current p9p system
has worked for a long time.  including errno.h
seems like it has the potential to break a lot of
stuff.

- erik



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

* Re: [9fans] compiler warnings for libavl/avl.c
  2010-02-26 15:16 ` Oleg Finkelshteyn
  2010-03-02 17:02   ` [9fans] compiler warnings for libavl/avl.c EBo
@ 2010-03-02 17:40   ` EBo
  2010-03-02 17:50     ` Edward E Elzey
  2010-03-02 17:52     ` erik quanstrom
  1 sibling, 2 replies; 12+ messages in thread
From: EBo @ 2010-03-02 17:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


> > The following two subroutines are defined and not used anywhere.  Should they
> > redefined as void or possibly removed?
>
> it's perfectly reasonable to leave code in for testing purposes
> that never gets called.

Agreed.  Should the declarations be changed then to void instead of static
void so that it does not give warnings?  I've worked on some projects where
the leads where very pedantic about cleaning up all warnings and was wondering
what the consensus amongst the plan 9 crowd.

> > -int errno;
> > +#include <errno.h>
> >
> > should the base source include this patch?
>
> what's the advantage?  the current p9p system
> has worked for a long time.  including errno.h
> seems like it has the potential to break a lot of
> stuff.

I simply noticed the patch and was wondering if there would be any advantage
to including it, so I have no idea if there is any specific advantage.  I also
was not sure if this was simply a POSIX'ism or a 9'ism, and if this
could/should be cleaned up.

  EBo --



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

* Re: [9fans] compiler warnings for libavl/avl.c
  2010-03-02 17:40   ` EBo
@ 2010-03-02 17:50     ` Edward E Elzey
  2010-03-02 17:52     ` erik quanstrom
  1 sibling, 0 replies; 12+ messages in thread
From: Edward E Elzey @ 2010-03-02 17:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

EBo wrote:

>>> -int errno;
>>> +#include <errno.h>

> I simply noticed the patch and was wondering if there would be any advantage
> to including it, so I have no idea if there is any specific advantage.  I also
> was not sure if this was simply a POSIX'ism or a 9'ism, and if this
> could/should be cleaned up.

Actually the good folks at Linux have broken errno:

9l -o o.9660srv main.o 9660srv.o xfile.o iobuf.o data.o
/usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss
mismatches non-TLS reference in main.o
/lib/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status

The include of errno.h is a necessary appeasment.

--
To err is human, to aaaaaargh: pirate.
Have you been touched by His noodley appendage?



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

* Re: [9fans] compiler warnings for libavl/avl.c
  2010-03-02 17:40   ` EBo
  2010-03-02 17:50     ` Edward E Elzey
@ 2010-03-02 17:52     ` erik quanstrom
  2010-03-02 18:41       ` EBo
  1 sibling, 1 reply; 12+ messages in thread
From: erik quanstrom @ 2010-03-02 17:52 UTC (permalink / raw)
  To: ebo, 9fans

> > > The following two subroutines are defined and not used anywhere.  Should they
> > > redefined as void or possibly removed?
> >
> > it's perfectly reasonable to leave code in for testing purposes
> > that never gets called.
>
> Agreed.  Should the declarations be changed then to void instead of static
> void so that it does not give warnings?  I've worked on some projects where
> the leads where very pedantic about cleaning up all warnings and was wondering
> what the consensus amongst the plan 9 crowd.

how about changing 9c so you don't get this warning?

- erik



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

* Re: [9fans] compiler warnings for libavl/avl.c
  2010-03-02 17:52     ` erik quanstrom
@ 2010-03-02 18:41       ` EBo
  2010-03-04 18:10         ` Russ Cox
  0 siblings, 1 reply; 12+ messages in thread
From: EBo @ 2010-03-02 18:41 UTC (permalink / raw)
  To: erik quanstrom, ebo, 9fans

erik quanstrom <quanstro@quanstro.net> said:

> how about changing 9c so you don't get this warning?

At the moment the compiler is set to report all warnings (-Wall).  I would
rather ignore these two warnings then turn the warnings off.

Out of curiosity is there a reason why the subroutines should not be declared
void walkavl... instead of static void walkavl?  I understand that removing
the static declaration puts the two subroutines in question into global
namespace when linking to libavl.

I did a quick check and removing the static declaration removed the warnings,
and plan9port built without incident.

I hope I am not being annoying, I really am trying to get a sense of the
communities coding and process standards.

  Thanks and best regards,

  EBo --




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

* Re: [9fans] compiler warnings for libavl/avl.c
  2010-03-02 18:41       ` EBo
@ 2010-03-04 18:10         ` Russ Cox
  0 siblings, 0 replies; 12+ messages in thread
From: Russ Cox @ 2010-03-04 18:10 UTC (permalink / raw)
  To: ebo, plan9port-dev

+plan9port-dev, -9fans

> At the moment the compiler is set to report all warnings (-Wall).

That's not true.  Many warnings are grepped out (look inside 9c).
What is the exact warning you are getting from libavl?

Russ


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

end of thread, other threads:[~2010-03-04 18:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-26  9:43 [9fans] Has Anyone compiled 9vx on snow leopard ? prem
2010-02-26 15:16 ` Oleg Finkelshteyn
2010-03-02 17:02   ` [9fans] compiler warnings for libavl/avl.c EBo
2010-03-02 17:12     ` erik quanstrom
2010-03-02 17:40   ` EBo
2010-03-02 17:50     ` Edward E Elzey
2010-03-02 17:52     ` erik quanstrom
2010-03-02 18:41       ` EBo
2010-03-04 18:10         ` Russ Cox
2010-03-01  9:49 ` [9fans] Has Anyone compiled 9vx on snow leopard ? prem
2010-03-01  9:49 ` prem
2010-03-01 10:30   ` John Stalker

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).