[haiku-development] Re: Cross-compiling Haiku with jam: how to make clean?

  • From: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 14 Aug 2017 12:56:13 +0200

On Mon, Aug 14, 2017 at 09:58:49AM +0000, Thomas Mueller wrote:

To replace -lstdc++ with appropriate linker flags, where would I do that?  
Would I have to edit something in the haiku tree?  Or maybe something in the 
generated build/BuildConfig (use UserBuildConfig?)?

I again ran
grep -rn "HOST_PLATFORM" haiku
to find the HOST_PLATFORM-sensitive things.

I found some things that are suspicious regarding FreeBSD.

One was in haiku/build/jam/BuildSetup

  } else if $(HOST_PLATFORM) = freebsd {
                if $(HOST_CPU) = x86_64 {
                        # amd64 FreeBSD 8 doesn't come without a shared 
libsupc++, and the
                        # static one prevents us from building shared 
libraries. So we have
                        # to work around by using the shared libstdc++.
                        HOST_LIBSUPC++ = stdc++ ;
                        HOST_LIBSTDC++ = ;
                }
        }

        # Unlike glibc FreeBSD's libc doesn't have built-in regex support.
        if $(HOST_PLATFORM) = freebsd {
                HOST_LIBROOT += /usr/lib/libgnuregex.so ;
                HOST_STATIC_LIBROOT += /usr/lib/libgnuregex.so ;
        } else if $(HOST_PLATFORM) = darwin {
                HOST_LIBROOT += libgnuregex_build.so ;
                HOST_STATIC_LIBROOT += libgnuregex_build.so ;
        }

Reference to FreeBSD 8 was suspicious in that the oldest supported version of 
FreeBSD, at FreeBSD end, is 10.3.  Things have changed since FreeBSD 8.x.

Yes, that looks like the right place to change. If you can figure out
the correct options for current versions of FreeBSD we can update this.


I would also have liked to try building Haiku from NetBSD, but it seems that 
setting up requires knowledge of not only where everything is in NetBSD but 
Haiku as well, including extended attributes.

You can disable the use of extended attributes when configuring haiku,
in fact, this is the default behavior unless you specify --use-xattr or
--use-xattr-ref. However, in that case we use an emulation of xattrs (as
separate files) which is known to have some limitations. Sometimes it
will fall out of sync with the actual files. But you should still be
able to build Haiku with it.

Would I do better with Linux?

Possibly, it seems most Haiku devs are working from Linux these days.
But it would be nice to restore FreeBSD support, especially if it is
just about tweaking some linker flags.

-- 
Adrien.

Other related posts: