9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: ron minnich <rminnich@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] 9vx
Date: Mon, 27 Apr 2009 22:10:31 -0700	[thread overview]
Message-ID: <13426df10904272210v5e6eb273n185899b4365ee60c@mail.gmail.com> (raw)
In-Reply-To: <20080627151526.76D701E8C2B@holo.morphisms.net>

On Fri, Jun 27, 2008 at 8:17 AM, Russ Cox <rsc@swtch.com> wrote:

> if you make clean
> and then edit the top-level src/Makefrag file to add -m32
> to the HOST_CFLAGS and then make 9vx/9vx
> you are likely to get a working binary.

I'm just trying this now. I was missing stubs-32.h on FC9.
I had to do this:

sudo yum install compat-gcc-34 compat-gcc-34-c++

It's a very important file; it has stuff like this in it :-)

#ifdef _LIBC
 #error Applications may not define the macro _LIBC
#endif

#define __stub___kernel_cosl
#define __stub___kernel_sinl
#define __stub___kernel_tanl
#define __stub_chflags
#define __stub_fattach
#define __stub_fchflags
#define __stub_fdetach
#define __stub_gtty
#define __stub_lchmod
#define __stub_revoke
#define __stub_setlogin
#define __stub_sigreturn
#define __stub_sstk
#define __stub_stty

Pretty!

I also had to do this:
diff -r a18e9872164b src/9vx/Makefrag
--- a/src/9vx/Makefrag	Wed Dec 10 03:29:15 2008 -0800
+++ b/src/9vx/Makefrag	Mon Apr 27 22:02:37 2009 -0700
@@ -124,7 +124,8 @@
 		x11-kernel.o \
 		x11-keysym2rune.o \
 	)
-PLAN9_x11_LIBS = -L/usr/X11R6/lib -L/usr/local/lib -lX11
+#PLAN9_x11_LIBS = -L/usr/X11R6/lib -L/usr/local/lib -L/usr/lib -lX11
+PLAN9_x11_LIBS =  /usr/lib/libX11.so.6

 PLAN9_osx_OBJS =\
 	$(addprefix 9vx/osx/, \
@@ -148,7 +149,7 @@
 	libvx32/libvx32.a \

 9vx/9vx: $(PLAN9_DEPS)
-	$(HOST_CC) -o $@ $(PLAN9_DEPS) $(PLAN9_GUI_LIBS) -lpthread
+	$(HOST_CC) $(HOST_LDFLAGS) -o $@ $(PLAN9_DEPS) $(PLAN9_GUI_LIBS) -lpthread

 9vx/a/%.o: 9vx/a/%.c
 	$(HOST_CC) $(HOST_CFLAGS) -I. -I9vx -I9vx/a -Wall
-Wno-missing-braces -c -o $@ $<
diff -r a18e9872164b src/Makefrag
--- a/src/Makefrag	Wed Dec 10 03:29:15 2008 -0800
+++ b/src/Makefrag	Mon Apr 27 22:02:37 2009 -0700
@@ -1,9 +1,9 @@
 # Main top-level makefile fragment for the vx32 virtual machine.

 # Compiler flags common to both host and VX32 environment files.
-COMMON_CFLAGS = -g -O3 -MD -std=gnu99 -I. $(CFLAGS)
+COMMON_CFLAGS = -g -O3 -MD -std=gnu99 -I. $(CFLAGS) -m32
 #COMMON_CFLAGS = -g -MD -std=gnu99 -I. $(CFLAGS)
-COMMON_LDFLAGS = -g -L. $(LDFLAGS)
+COMMON_LDFLAGS = -g -L. $(LDFLAGS) -m32

 # Host environment compiler options
 HOST_CC		:= $(CC)

Comments:
1. No, it can't find -lX11 even with a little hand-holding -L/usr/lib
to help it. Don't know, don't care...
2. It really seems to need HOST_LDFLAGS to work correctly on the
9vx/9vx link step.
3. It didn't work well for me unless I put -m32 on the COMMON_CFLAGS
4. I think what I'm doing with LDFLAGS is wrong wrong wrong

And, well, it builds. But it dies.

 9vx panic: user fault: signo=11 addr=0 [useraddr=28054000] read=1
eip=80c222a esp=d724cd5c
aborting, to dump core.

which is:
0x080c2228 <vxrun+24>:	mov    %eax,%es
0x080c222a <vxrun+26>:	mov    %eax,%ss

which makes sense I guess.

Anyway, I figure I'll go back and look some more. Probably reset my
changes first.

ron



  parent reply	other threads:[~2009-04-28  5:10 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-27 11:07 9vx Russ Cox
2008-06-27 13:18 ` [9fans] 9vx David Leimbach
2008-06-27 13:40   ` David Leimbach
2008-06-27 13:46     ` Pietro Gagliardi
2008-06-27 13:50       ` Russ Cox
2008-06-27 13:58         ` a
2008-06-27 13:56       ` David Leimbach
2008-06-27 13:49     ` a
2008-06-27 13:59       ` Russ Cox
2008-06-27 13:49     ` Latchesar Ionkov
2008-06-27 13:57       ` David Leimbach
2008-06-27 13:52     ` Russ Cox
2008-06-27 13:58       ` David Leimbach
2008-06-27 13:58       ` Venkatesh Srinivas
2008-06-27 14:08         ` john
2008-06-27 14:12           ` erik quanstrom
2008-06-30 15:32             ` sqweek
2008-06-30 16:09               ` Russ Cox
2008-06-30 17:00                 ` andrey mirtchovski
2008-06-30 17:07                   ` andrey mirtchovski
2008-06-30 18:02                   ` Russ Cox
2008-06-30 18:34                     ` andrey mirtchovski
2008-06-30 18:44                       ` Russ Cox
2008-06-27 14:19           ` Russ Cox
2008-06-27 14:10         ` Gorka Guardiola
2008-06-27 14:11           ` erik quanstrom
2008-06-27 14:21       ` David Leimbach
2008-06-27 14:29         ` Russ Cox
2008-06-27 14:30         ` Pat Hacker
2008-06-27 14:32           ` Francisco J Ballesteros
2008-06-27 14:34             ` David Leimbach
2008-06-27 14:39             ` andrey mirtchovski
2008-06-27 14:45               ` David Leimbach
2008-06-27 14:47                 ` David Leimbach
2008-06-27 14:55               ` andrey mirtchovski
2008-06-27 15:31             ` andrey mirtchovski
2008-06-27 14:57 ` ron minnich
2008-06-27 15:14   ` ron minnich
2008-06-27 15:17   ` Russ Cox
2008-06-27 15:52     ` ron minnich
2008-06-27 17:39       ` ron minnich
2008-06-27 18:57         ` Pietro Gagliardi
2008-06-27 18:59         ` David Leimbach
2008-06-27 21:39           ` ron minnich
2008-06-27 22:51             ` David Leimbach
2008-06-27 23:29             ` Brian L. Stuart
2008-06-28  0:36               ` ron minnich
2008-06-28  4:59               ` Brian L. Stuart
2008-06-28 11:25                 ` erik quanstrom
2009-04-28  5:10     ` ron minnich [this message]
2009-04-30 14:12       ` Russ Cox
2008-06-27 15:41   ` Uriel
2008-06-27 15:54     ` ron minnich
2008-06-27 23:13 ` Skip Tavakkolian
2008-06-27 23:24   ` Skip Tavakkolian
2008-06-27 23:34   ` Pietro Gagliardi
2008-06-27 23:52     ` David Leimbach
2008-06-28  5:03   ` lucio
2008-06-28 15:23     ` Russ Cox
2008-06-28 17:29       ` lucio
2008-06-28 17:30       ` Pietro Gagliardi
2008-07-01  2:29       ` Anthony Martin
2008-07-01  9:09         ` erik quanstrom
2008-07-01 12:10         ` Russ Cox
2008-07-01 13:25           ` erik quanstrom
2008-07-01 14:40             ` Russ Cox
2008-07-01 17:23               ` erik quanstrom
2008-07-01 17:32                 ` Russ Cox
2008-07-01 18:50                   ` erik quanstrom
2008-07-01 19:11                     ` rc bug Russ Cox
2008-07-01 21:13                       ` [9fans] " erik quanstrom
2008-07-01 21:28                         ` [9fans] 9vx ps bug Russ Cox
2008-07-01 21:59                       ` [9fans] rc bug Fazlul Shahriar
2008-07-01 23:11                         ` Russ Cox
2008-07-01 23:12                           ` erik quanstrom
2008-07-01 23:31                             ` Russ Cox
2008-07-01 23:38                               ` erik quanstrom
2008-06-28 17:28     ` [9fans] 9vx Pietro Gagliardi
2008-06-28 17:35       ` Pietro Gagliardi
2008-06-27 23:41 ` Dave Eckhardt
2008-06-27 23:52   ` David Leimbach
2008-06-28  0:23   ` Uriel
2008-06-28 15:32     ` David Leimbach
2008-06-28  4:36 ` Fernan Bolando
2008-12-21 19:19 erik quanstrom
2008-12-22 18:52 ` Russ Cox
2023-06-25  5:53 Ben Huntsman
2023-06-25 18:59 ` David du Colombier
2023-06-26  9:28 ` Stuart Morrow
2023-06-26 13:39   ` hiro
2023-06-26 17:49     ` ibrahim via 9fans

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=13426df10904272210v5e6eb273n185899b4365ee60c@mail.gmail.com \
    --to=rminnich@gmail.com \
    --cc=9fans@9fans.net \
    /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).