[M3devel] some multi-arch conclusions

Jay jayk123 at hotmail.com
Fri Apr 18 17:13:24 CEST 2008


When cm3cg --help prints
-m32 [enabled]
-m64 [disabled]

enabled/disabled is the present (default) setting. It doesn't indicate if the compiler supports the flag.
To see the meaning of the switch spelled out, use cm3cg --quiet --help.
  Found by searching the code for [enabled]. Seems backwards, and gcc/cc1 don't work this way. No matter.

To see if the switch works, try running it:
  cm3cg -m32 
  cm3cg -m64  

Some variants will give a clear error that the feature isn't there. Otherwise press control-d (or z) twice to exit.

AMD64 hosts by default can target 64 bit and 32 bit.
PowerPC and SPARC ought to be the same imho but I don't think they are (yet).
I saw some mail thread people asking for this for PowerPC.
The docs indicate it is there for PowerPC. The code or the ChangeLog at least shows churn here for SPARC.

32 bit hosts do not default to being able to target multiple architectures.
But you can configure them so:

x86 hosts can be configured to have a working -m64 switch via
--enable-targets=all
or --enable-targets=i686-pc-linux-gnu,amd64-pc-linux-gnu

Same for 32 bit PowerPC I think, and maybe SPARC.

Those same switches should work for AMD64 hosts, but it is the default.
I guess you might be able to trim out the x86 target via --enable-targets-amd64-pc-linux-gnu or --disable-targets=i686-pc-linux-gnu, but I didn't try that.

There is a term "biarch" or "bi-arch" for "two architectures".
When searching the code, be sure to also look for bi-arch.
Searching the web I see people refer to --enable-biarch, but I don't believe there is any "biarch" flag anywhere in gcc.
Just this --enable-targets=all.
And --multilibs stuff.

I can't speak to glibc and binutils. Perhaps biarch does mean something in the code. Or maybe it used to.

That's what I know.

Tony -- your multiarch cm3cg may or may not run on x86.
As I understand, there are both 32 bit and 64 bit Intel Macintoshes out there.
  The first generation were "Core" not "Core 2" and no 64 bit.
In the hardware. And presumably in the software. I don't know when they enabled 64 bit Intel.
Lately I believe all Intel Macintoshes are 64 bit hardware. I don't know if therefore they can all run 64 bit user mode code, or if this isn't always enabled.
I'm not sure if the kernel is 32 bit or 64 bit but we don't care, I'm sure.

Historically we have built WAY more of gcc than is generally needed.
I can see there being bootstrap scenarios from Sun/IBM/SGI tools, and whatnot, and certainly gcc needs this stuff, they need the bootstrap scenario, etc.
However for Modula-3, on systems with a reasonably current gcc already, lots of extra.
My machine also took hours to build m3cc recently and now just 7 minutes. Yeah.

Later,
 - Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080418/5ea7688c/attachment-0001.html>


More information about the M3devel mailing list