[haiku-development] Re: [haiku] Can't build (jam) anyboot-image because of artificial barrier

  • From: "Thomas Mueller" <mueller6723@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 02 Aug 2014 08:01:05 +0000

from François Revol and my original post:

On 01/08/2014 11:40, Thomas Mueller wrote:
> > I tried to configure to build tools from NetBSD-current amd64 host
> > but was blocked by Unsupported build platform: netbsd

> It's not "artificial", it's just because it wasn't tested.

It's artificial in that the failure is due to the Haiku scripts rather than any 
fault of the NetBSD-hosted cross-build tools.

Better if the Haiku scripts would warn about possible pitfalls associated with 
an unsupported host platform, make suggestions if possible, and let the user 
proceed at his/her own risk.

If Haiku can be cross-compiled from OpenBSD, NetBSD ought to have a fair chance 
too.

There are some Linux cross-buildable toolchains that I might want to try.

They wouldn't forbid building from an unsupported host platform, but the user 
would have to make proper adjustments, and no guarantees.

> but got around that by making a script nbconfigure, starting with
> configure script but adding
> [...]
> Lines with "netbsd" were my modifications.

> If the build works (and only if) you will want to make a ticket with a
> proper patch attached. See:
> https://dev.haiku-os.org/wiki/SubmittingPatches

So far, cross-tools built successfully, now I have to see if Haiku anyboot will 
build.

> > After the first modification, building the cross-tools failed
> > apparently because of incompatibility with BSD make, just as building
> > jam failed with "make" but succeeded with "gmake".

> This is the reason why NetBSD was not listed in the tested platforms and
> configure told you so, because it wasn't tested and probably didn't work
> with the defaults.

> > Then I successfully built the cross-tools using gcc-aux, which
> > includes Ada as well as C and C++, for both x86_gcc2 and X86 hybrid,
> > and x86_64.
 
> > But when I go to haiku/haiku.nbgenerated directory and try to build
> > the anyboot-image with
 
> > jam -q @anyboot-image
 
> > I get
 
> > Unsupported host platform: netbsd
 
> > I grep'ed recursively on "supported" and "SUPPORTED", found
> > SUPPORTED_PLATFORMS, but how do I add netbsd to that list, or disable
> > the filter that blocks me?

> It's in:

> build/jam/HelperRules:                                Exit Unsupported 
> $(platformKind) platform:
> $(platform) ;

> it's a rule used in build/jam/BuildSetup :

> # check the host platform compatibility
> SetPlatformCompatibilityFlagVariables HOST_PLATFORM : HOST : host
>         : linux openbsd freebsd darwin sunos cygwin ;

> You'll want to add there as well.

I found that later by 

grep -r -n "supported" build/jam
grep -r -n "openbsd" build/jam

On the question of flex or lex, I checked for both NetBSD and FreeBSD, and flex 
and lex, in /usr/bin/, look to be the same thing, hard-linked.  I also checked 
the man page,  and can't find a difference between flex and lex as implemented 
on FreeBSD and NetBSD.  Maybe using flex would be safer?


> > Is this the wrong way?  Should UserBuildConfig be in another
> > directory?  Documentation is not very clear.

> It should be in build/jam/ just like the template IIRC.
> Anyway, you don't need it.

I see toward the end of Jamrules file, it looks like UserBuildConfig should be 
in $HAIKU_OUTPUT_DIR or HAIKU_BUILD_RULES_DIR.  Maybe this is wrong?

If there is use for a UserBuildConfig, it might be different for different 
"generated" configurations.  Or maybe setting SUPPORTED_PLATFORMS has no effect 
anyway?

Anyway, thanks for the suggestions.  I intend to make the modifications and try 
again, keeping copies of the original files just to be safe.

Modifications should have no adverse effect on a subsequent cross-build from 
FreeBSD.

I intend to report back on my results.

Tom


Other related posts: