Cross-compiling Minix3 on OS X

406 views
Skip to first unread message

Emmanuel Blot

unread,
Oct 14, 2014, 5:32:53 AM10/14/14
to min...@googlegroups.com
Hi,

I'm trying to follow the instructions to build Minix3 (target:
BeableBone) from an OS X host (10.9 Mavericks, and in a couple of
weeks 10.10 Yosemite).

Building fails when the build script attempts to build gold linker -
which is not a real surprise as I already lost quite a few hours
trying to build this tool for the same host-target build environment.

What is the recommended workaround? Is it possible to get rid of gold
and use the regular GNU linker? Is there a wiki page about OS X
building environment?

I've notice that OS X Lion is a supported host from
http://wiki.minix3.org/DevelopersGuide/Crosscompiling, but Lion is now
**really** outdated, so maybe there is some fresher doc/ml thread/...
about OS X hosts?

Thanks,
Manu

Lionel Sambuc

unread,
Oct 14, 2014, 5:36:24 AM10/14/14
to min...@googlegroups.com
Hello,


We have two pending patches for cross-building on OSX.
- http://gerrit.minix3.org/#/c/2859/
- http://gerrit.minix3.org/#/c/2860/

This allows for cross build out of the box of an ARM SD image.

For cross builds of MINIX/x86 on OSX I believe some fixes are
required to get clang to compile as a tool.


Regards,

Lionel

Emmanuel Blot

unread,
Oct 14, 2014, 5:41:23 AM10/14/14
to min...@googlegroups.com
Hi Lionel,

> We have two pending patches for cross-building on OSX.
> - http://gerrit.minix3.org/#/c/2859/
> - http://gerrit.minix3.org/#/c/2860/

Ok thanks, I'll apply them.

> For cross builds of MINIX/x86 on OSX I believe some fixes are
> required to get clang to compile as a tool.

I can first try to build it from GCC 48 or GCC 49 series if it makes
things easier (Homebrew installs them easily)
Would there be a recommended way to change the default compiler - such
as defining CC/CXX env. vars?

Thanks for your help,
Manu.

Lionel Sambuc

unread,
Oct 14, 2014, 5:47:22 AM10/14/14
to min...@googlegroups.com
Hi again,


Actually, just give me 5 minutes, and they will be merged, the
wait period has expired, and I received no comments.

So all you have to do is to git pull in about 10 minutes.

For intel targets, it is not that simple, there is a mode where one
can provide an external (to the sources) toolchain, but this is not
the preferred way of doing things, and is part of advanced (NetBSD)
build system usage.

For ARM GCC is used and will be just fine, it should just work, as
soon as I have merged the two patches.

Just make sure to first do:
$ git clean -dxf .
in the minix sources, before to attempt to rebuild, as well as removing
your object directory.


Regards,

Lionel

PS: I would recommend to follow the minix-dev group as well, to
see which patches are submitted / pending.

Emmanuel Blot

unread,
Oct 14, 2014, 5:53:33 AM10/14/14
to min...@googlegroups.com
> Actually, just give me 5 minutes, and they will be merged, the
> wait period has expired, and I received no comments.
I've cherry picked them, but will revert :-)

> For ARM GCC is used and will be just fine, it should just work, as
> soon as I have merged the two patches.
Ok

> Just make sure to first do:
> $ git clean -dxf .
> in the minix sources, before to attempt to rebuild, as well as removing
> your object directory.
Ok, thanks for the hint

> PS: I would recommend to follow the minix-dev group as well, to
> see which patches are submitted / pending.
You are right, I'm going to subscribe right now.

Thanks,
Manu

Emmanuel Blot

unread,
Oct 15, 2014, 11:44:03 AM10/15/14
to min...@googlegroups.com
>> For ARM GCC is used and will be just fine, it should just work, as
>> soon as I have merged the two patches.

Quick update: works fine with OS X 10.9. Thanks a lot!

BTW, are there some documents dedicated to ARM targets (except
DevelopersGuide/MinixOnARM) and/or porting Minix to new ARM-based
targets?

Thanks,
Manu.

Kristofer Younger

unread,
Oct 20, 2014, 10:20:21 AM10/20/14
to min...@googlegroups.com
Minixers: should this OSX build process work for creating an ARM image too, using the standard ./releasetools/arm_sdimage.sh ??

Lionel Sambuc

unread,
Oct 20, 2014, 10:27:43 AM10/20/14
to min...@googlegroups.com
The patches are in, so yes cross-compiling MINIX/arm on OSX is possible,
using the latest commit of git.minix3.org/minix.git

Given you are asking, I guess it didn't work for you. As the last two
patches contains changes to binutils, you will need to remove the object
directory as well as execute
'git clean -dxf . '
at the root of the MINIX sources, before executing
./releasetools/arm_sdimage.sh.


Regards,

Lionel
> --
> You received this message because you are subscribed to the Google
> Groups "minix3" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to minix3+un...@googlegroups.com
> <mailto:minix3+un...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Emmanuel Blot

unread,
Oct 20, 2014, 11:48:51 AM10/20/14
to min...@googlegroups.com
> Minixers: should this OSX build process work for creating an ARM image too,
> using the standard ./releasetools/arm_sdimage.sh ??

It works fine with the latest patches - the ones specified in this thread - yes.
I did not tried yet on Yosemite, but the build was successful on Mavericks.

Cheers,
Manu

Kristofer Younger

unread,
Oct 21, 2014, 7:54:20 AM10/21/14
to min...@googlegroups.com
Nope. With Xcode 6.0.1 on Mavericks; after having done the  'git clean -dxf . ' and removing the object directory, a 'git pull' (and no changes coming down), executing
./releasetools/x86_hdimage.sh

I manage to get a few hundred seconds in, and I get an error

In file included from /Volumes/Kristofer/ExternalUsers/kyounger/Projects/minix/src/tools/llvm-tblgen/../../external/bsd/llvm/bin/tblgen/../../dist/llvm/utils/TableGen/AsmMatcherEmitter.cpp:118:

In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream:174:

In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:133:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale:3679:52: error: use of undeclared identifier 'NL_CAT_LOCALE'

    catalog __cat = (catalog)catopen(__nm.c_str(), NL_CAT_LOCALE);

                                                   ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale:3700:5: error: unknown type name 'nl_catd'

    nl_catd __cat = (nl_catd)__c;

    ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale:3700:22: error: use of undeclared identifier 'nl_catd'

    nl_catd __cat = (nl_catd)__c;

                     ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale:3716:5: error: unknown type name 'nl_catd'

    nl_catd __cat = (nl_catd)__c;

    ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale:3716:22: error: use of undeclared identifier 'nl_catd'

    nl_catd __cat = (nl_catd)__c;

                     ^

5 errors generated.

*** [AsmMatcherEmitter.lo] Error code 1


in addition, immediately after this, I try to do a 

$ ./releasetools/arm_sdimage.sh 

**Skipping image creation: missing tool 'mcopy'




Thomas Veerman

unread,
Oct 21, 2014, 8:00:12 AM10/21/14
to Kristofer Younger, min...@googlegroups.com
Hi Kristofer,

You're building for x86, but you asked about ARM. However, I've fixed the x86 build on OSX as well, but there are currently some technical difficulties with the test system preventing the patch from being processed. See attached patch.

-- 
Thomas Veerman
--
You received this message because you are subscribed to the Google Groups "minix3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minix3+un...@googlegroups.com.
0001-buildsystem-fix-build-errors-for-x86-on-OSXv2.patch

Emmanuel Blot

unread,
Oct 21, 2014, 8:06:18 AM10/21/14
to min...@googlegroups.com
> **Skipping image creation: missing tool 'mcopy'

"brew install mtools", if you are using Homebrew

Emmanuel Blot

unread,
Oct 21, 2014, 9:21:33 AM10/21/14
to min...@googlegroups.com
> I did not tried yet on Yosemite, but the build was successful on Mavericks.
Update: building for ARM from OS X 10.10.0 / XCode 6.1 works fine as well.
Reply all
Reply to author
Forward
0 new messages