[haiku-development] [RFC] Problems bootstrapping ARM with PM

  • From: François Revol <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 29 Sep 2013 22:49:17 +0200

Hi,
I had a hard time getting just haiku_loader built for ARM, but I finally
ended up getting a bootable flash image (though it KDLs quite early).

There are still some issues:


* zlib sources are not found correctly, I had to patch
build/jam/BuildFeatures (however then x86 doesn't build anymore).

I suppose the bootstrap source package is not created correctly but I
have no idea where to look.


* the BReferenceable class pulled into haiku_loader uses atomic_add(),
which isn't always available on ARM, since we do not have syscalls yet...
Worked around with a #define but it's ugly.

* I had to remove most packages to get to haiku_loader.

* It seems the makebootable rule is declared twice, I don't see why it
would need libbe yet...

* I had to bump the MAXLINE in jam, but I still get a weird stop when
linking libroot. Jam stops complaining about a failed action but
actually doesn't give any error, and manually running the link command
in a shell script just works and allows it to continue...
I'll try to strace it.


I used:
(cd generated-arm-gcc4/; jam -q -sHAIKU_BOOT_BOARD=verdex
-sHAIKU_BOOTSTRAP_BUILD=1 haiku-mmc-image haiku-flash-uimage)


Comments?

François.
diff --git a/build/jam/BuildFeatures b/build/jam/BuildFeatures
index 5e40740..6998ef9 100644
--- a/build/jam/BuildFeatures
+++ b/build/jam/BuildFeatures
@@ -439,7 +439,7 @@ if [ IsPackageAvailable zlib_devel ] {
                # sources are required for the primary architecture only
                primary @{
                        file: source zlib_source
-                               sources: 
develop/sources/%portRevisionedName%/source
+                               sources: 
develop/sources/%portRevisionedName%/sources
                }@
                ;
 
diff --git a/build/jam/repositories/HaikuPortsCross/arm 
b/build/jam/repositories/HaikuPortsCross/arm
index 55bb642..780f1fe 100644
--- a/build/jam/repositories/HaikuPortsCross/arm
+++ b/build/jam/repositories/HaikuPortsCross/arm
@@ -5,26 +5,6 @@ BootstrapPackageRepository HaikuPortsCross
        haikuporter-0-1
        :
        # repository architecture packages (stage 1)
-       autoconf_bootstrap-2.69-1
-       automake_bootstrap-1.13.1-1
-       binutils_bootstrap-2.23.2_2013_04_09-3
-       bison_bootstrap-2.4.3-1
-       flex_bootstrap-2.5.35-1
-       freetype_bootstrap-2.4.9-1
-       freetype_bootstrap_devel-2.4.9-1
-       gcc_bootstrap-4.7.3_2013_08_12-1
-       grep_bootstrap-2.14-1
-       icu_bootstrap-4.8.1.1-1
-       icu_bootstrap_devel-4.8.1.1-1
-       libtool_bootstrap-2.4-8
-       libtool_bootstrap_libltdl-2.4-8
-       m4_bootstrap-1.4.16-1
-       make_bootstrap-3.82-1
-       ncurses_bootstrap-5.9-1
-       ncurses_bootstrap_devel-5.9-1
-       python_bootstrap-2.6.8-1
-       sed_bootstrap-4.2.1-1
-       texinfo_bootstrap-4.13a-1
        zlib_bootstrap-1.2.8-2
        zlib_bootstrap_devel-1.2.8-2
        :
@@ -34,23 +14,7 @@ BootstrapPackageRepository HaikuPortsCross
 
        :
        # source packages
-       autoconf_bootstrap
-       automake_bootstrap
-       binutils_bootstrap
-       bison_bootstrap
-       flex_bootstrap
-       freetype_bootstrap
-       gawk_bootstrap
-       gcc_bootstrap
-       grep_bootstrap
        libsolv_bootstrap
-       libtool_bootstrap
-       m4_bootstrap
-       make_bootstrap
-       ncurses_bootstrap
-       python_bootstrap
-       sed_bootstrap
-       texinfo_bootstrap
        zlib_bootstrap
        :
        # debuginfo packages
diff --git a/src/kits/support/Referenceable.cpp 
b/src/kits/support/Referenceable.cpp
index ca849f8..0682a14 100644
--- a/src/kits/support/Referenceable.cpp
+++ b/src/kits/support/Referenceable.cpp
@@ -20,6 +20,9 @@
 #      define TRACE(x, ...)
 #endif
 
+#ifdef _BOOT_MODE
+#define atomic_add(p,v) ({int32 old = *(p); *(p) += v; old;})
+#endif
 
 BReferenceable::BReferenceable()
        :
diff --git a/src/tools/makebootable/platform/u-boot/Jamfile 
b/src/tools/makebootable/platform/u-boot/Jamfile
index eac99f0..7876a4a 100644
--- a/src/tools/makebootable/platform/u-boot/Jamfile
+++ b/src/tools/makebootable/platform/u-boot/Jamfile
@@ -6,7 +6,9 @@ SEARCH_SOURCE
 BuildPlatformMain <build>makebootable :
        makebootable.cpp
        $(hostPlatformSources)
-       : $(HOST_LIBBE) $(HOST_LIBSTDC++) $(HOST_LIBSUPC++)
+       :
+       # $(HOST_LIBBE)
+       $(HOST_LIBSTDC++) $(HOST_LIBSUPC++)
 ;
 
-BuildPlatformMain <build>makebootable : makebootable.cpp : $(HOST_LIBSTDC++) ;
+#BuildPlatformMain <build>makebootable : makebootable.cpp : $(HOST_LIBSTDC++) ;

Other related posts: