[haiku-development] Re: [PATCH] Buildutils on Solaris (was: Buildutils on powerpc)

  • From: Andreas Färber <andreas.faerber@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 9 Aug 2008 18:08:31 +0200


Am 09.08.2008 um 17:44 schrieb Ingo Weinhold:

I've applied your patch with some changes:

--- configure   (revision 26872)
+++ configure   (working copy)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# configure [ <options> ]

IIRC this is a no-go, since bash is not located in /bin in FreeBSD. I'd
recommend replacing Solaris' /bin/sh with an actually POSIX compatible
shell.

This change was not supposed to be applied. Whether or not Bourne Shell is POSIX-compliant, replacing it is not an option. There are a lot of bashisms around that are not necessarily POSIX. Anyway, a better solution is to do /bin/bash configure ... but this way it's more convenient for me in my copy. In case we need it in more scripts, we should make sure that Jam uses the current shell for, e.g., build/ scripts/*.

--- src/bin/rc/rc.cpp   (revision 26872)
+++ src/bin/rc/rc.cpp   (working copy)
@@ -29,10 +29,16 @@
#include "rdef.h"


+#ifndef HAIKU_HOST_PLATFORM_SUNOS
extern const char *__progname;
+#endif

static const char *kTitle = "Haiku Resource Compiler 1.1";
+#ifdef HAIKU_HOST_PLATFORM_SUNOS
+static const char *kProgramName = "rc";
+#else
static const char *kProgramName = __progname;
+#endif

I've applied these changes, but don't particularly like them. #ifdef'ing
build platform stuff in Haiku code is a bit ugly (makebootable is an
extreme example). If there is an alternative on Solaris to get the program
name that would be much preferred (i.e. defining __progname to that
alternative in BeOSBuildCompatibility.h).

I wasn't expecting these changes to be applied, thanks anyway. I just guess what __progname might return to get on with compiling. I have no idea whether there is an easier way. First time I encountered __progname. :)


What I get is this:

BuildHaikuImage1 /export/home/andreas/Haiku/haiku/generated-x86/
haiku.image
/export/home/andreas/Haiku/haiku/generated-x86/haiku.image

Creating image ...
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0,242203 s, 433 MB/s
Writing boot code to "/export/home/andreas/Haiku/haiku/generated-x86/
haiku.image" (partition offset: 0 bytes) ...
Error: Failed to open connection to FS shell: No such file or directory

export imagePath="/export/home/andreas/Haiku/haiku/generated-x86/
haiku.image"
export isImage="1"
export isVMwareImage=""
/export/home/andreas/Haiku/haiku/build/scripts/build_haiku_image /
export/home/andreas/Haiku/haiku/generated-x86/haiku.image-init-vars /
export/home/andreas/Haiku/haiku/generated-x86/haiku.image-make-dirs /
export/home/andreas/Haiku/haiku/generated-x86/haiku.image-copy- files /
export/home/andreas/Haiku/haiku/generated-x86/haiku.image-unzip-files

...failed BuildHaikuImage1 /export/home/andreas/Haiku/haiku/ generated-
x86/haiku.image ...
...removing /export/home/andreas/Haiku/haiku/generated-x86/ haiku.image
...failed updating 1 target(s)...
...updated 978 target(s)...


I have verified that dd works okay, creating a my.image file okay. As
you can see, I am just creating an image file (no UserBuildConfig), so
no special makebootable sections seemed necessary. Executing jam run
":<build>makebootable" my.image does write something to the file. So I
assume the error is somewhere in fs_shell... The only change I did
there was to link in Sun's libxnet.so to make it build.

I'd guess that initializing the image with BFS fails for some reason. Since no error message is produced, you'll have to add debug output along the
initialization code path in the FS shell respectively in BFS.

I didn't want to spam the list, so here's what I found in the meantime:

Initializing BFS appears to work, i.e. `jam run ":<build>bfs_shell" -- initialize my.image Haiku` writes something into an empty file and does not return an error.

`jam run ":<build>bfs_shell" my.image` however crashes, this is what gdb made of it:

andreas@sunshine:~/Haiku/haiku/generated-x86$ gdb objects/sunos/x86/ release/tools/bfs_shell/bfs_shell core
GNU gdb 6.3.50_2004-11-23-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-pc-solaris2.11"...
Core was generated by `/export/home/andreas/Haiku/haiku/generated-x86/ objects/sunos/x86/release/tools/'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /export/home/andreas/Haiku/haiku/generated-x86/ objects/sunos/lib/libroot_build.so...done. Loaded symbols for /export/home/andreas/Haiku/haiku/generated-x86/ objects/sunos/lib/libroot_build.so
Reading symbols from /usr/sfw/lib/libstdc++.so.6...done.
Loaded symbols for /usr/sfw/lib/libstdc++.so.6
Reading symbols from /lib/libxnet.so.1...done.
Loaded symbols for /lib/libxnet.so.1
Reading symbols from /lib/libc.so.1...done.
Loaded symbols for /lib/libc.so.1
Reading symbols from /usr/sfw/lib/libgcc_s.so.1...done.
Loaded symbols for /usr/sfw/lib/libgcc_s.so.1
Reading symbols from /lib/libm.so.2...done.
Loaded symbols for /lib/libm.so.2
Reading symbols from /lib/libsocket.so.1...done.
Loaded symbols for /lib/libsocket.so.1
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
#0  0xfecd2e40 in countbytes () from /lib/libc.so.1
(gdb) bt
#0  0xfecd2e40 in countbytes () from /lib/libc.so.1
#1  0xfed14476 in _ndoprnt () from /lib/libc.so.1
#2  0xfed167ca in vprintf () from /lib/libc.so.1
#3  0x0808b642 in fssh_dprintf ()
#4  0x0808289b in bfs_mount ()
#5  0x08092398 in FSShell::fs_mount ()
#6  0x08092c73 in FSShell::_kern_mount ()
#7  0x0809661f in FSShell::standard_session ()
#8  0x08096a1d in main ()
(gdb)

Andreas


Other related posts: