<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Please try my updated Darwin.common.<br><br>IsX86 = equal(TARGET, "I386_DARWIN") or equal(TARGET, "AMD64_DARWIN")<br><br>proc configure_assembler() is<br>  if defined("SYSTEM_ASM")<br>    return<br>  end<br>  SYSTEM_ASM = "/usr/libexec/gcc/darwin/" & DarwinArch & "/as"<br>  if not FileExists(SYSTEM_ASM)<br>    if IsX86<br>      configure_c_compiler ()<br>      SYSTEM_ASM = SYSTEM_CC_ASM & " -c -x assembler"<br>    else<br>      SYSTEM_ASM = "as"<br>    end<br>  end<br>  %SYSTEM_ASM = SYSTEM_CC_ASM & " -v -c -x assembler"<br>end<br><br>proc configure_c_compiler() is<br><br>  if defined("SYSTEM_CC")<br>    return<br>  end<br><br>  %<br>  % older compiler doesn't like -m32 or -arch<br>  %<br>  % gcc -c -m32 -x c /dev/null<br>  % cc1: error: invalid option ‘m32’<br>  %<br>  % fPIC is not usually needed here.<br>  % It is the default for Apple gcc and left<br>  % here in case user is using a self-built FSF gcc.<br>  %<br><br>  SYSTEM_CC = "gcc -gstabs+ -fPIC"<br>  SYSTEM_CC_ASM = "gcc -fPIC"<br>  local m = " -m" & {"32BITS":"32","64BITS":"64"}{WORD_SIZE}<br>  local arch = " -arch " & DarwinArch<br>  if not equal(try_exec("@" & SYSTEM_CC & m & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: invalid option \\\`32'\" >/dev/null"), 0)<br>    SYSTEM_CC = SYSTEM_CC & m<br>    SYSTEM_CC_ASM = SYSTEM_CC_ASM & m<br>  end<br>  if not equal(try_exec("@" & SYSTEM_CC & arch & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: unrecognized command line option \\\\\"-arch\\\\\"\" >/dev/null"), 0)<br>    SYSTEM_CC = SYSTEM_CC & arch<br>    SYSTEM_CC_ASM = SYSTEM_CC_ASM & arch<br>  end<br>  %write("SYSTEM_CC is " & SYSTEM_CC)<br>end<br><br><br> - Jay<br><br><hr id="stopSpelling">From: jay.krell@cornell.edu<br>To: mika@async.caltech.edu; m3devel@elegosoft.com<br>Date: Sun, 12 Dec 2010 05:49:29 +0000<br>Subject: Re: [M3devel] cm3 on snow leopard?<br><br>

<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</style>


I'm more sympathetic to using the already installed C compiler<br>to drive the assembler, than to build the current gcc driver.<br><br><br>You can see on Darwin we already probe around fairly aggressively<br>for a C compiler that can be told the target:<br><br>Darwin.common:<br><br><br>proc configure_c_compiler() is<br><br>  if defined("SYSTEM_CC")<br>    return<br>  end<br><br>  %<br>  % older compiler doesn't like -m32 or -arch<br>  %<br>  % gcc -c -m32 -x c /dev/null<br>  % cc1: error: invalid option ‘m32’<br>  %<br>  % fPIC is not usually needed here.<br>  % It is the default for Apple gcc and left<br>  % here in case user is using a self-built FSF gcc.<br>  %<br><br>  SYSTEM_CC = "gcc -gstabs+ -fPIC"<br>  local m = " -m" & {"32BITS":"32","64BITS":"64"}{WORD_SIZE}<br>  local arch = " -arch " & DarwinArch<br>  if not equal(try_exec("@" & SYSTEM_CC & m & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: invalid option \\\`32'\" >/dev/null"), 0)<br>    SYSTEM_CC = SYSTEM_CC & m<br>  end<br>  if not equal(try_exec("@" & SYSTEM_CC & arch & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: unrecognized command line option \\\\\"-arch\\\\\"\" >/dev/null"), 0)<br>    SYSTEM_CC = SYSTEM_CC & arch<br>  end<br>  %write("SYSTEM_CC is " & SYSTEM_CC)<br>end<br><br><br>Most likely if we merely set SYSTEM_ASM = SYSTEM_CC & "-x assembler"<br>it'll work well.<br>Maybe only in this else case:<br><br><br>proc configure_assembler() is<br>  if defined("SYSTEM_ASM")<br>    return<br>  end<br>  SYSTEM_ASM = "/usr/libexec/gcc/darwin/" & DarwinArch & "/as"<br>  if not FileExists(SYSTEM_ASM)<br>      SYSTEM_ASM = "as" <<== here<br>  end<br>end<br><br><br>All this is addressed by autoconf and/or a C-generating backend.....<br><br><br> - Jay<br><br><br><br><br><br><br><hr id="ecxstopSpelling">From: jay.krell@cornell.edu<br>To: mika@async.caltech.edu; m3devel@elegosoft.com<br>Date: Sun, 12 Dec 2010 05:26:37 +0000<br>Subject: Re: [M3devel] cm3 on snow leopard?<br><br>



<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
</style>


I'm rudely (but helpfully) ignoring your details and giving some of mine.<br><br>I though what is supposed to happen, specifically on Darwin, is the assembly code is supposed to indicate an architecture.<br><br>jbook2:m3core jay$ CM3_TARGET=I386_DARWIN M3CONFIG=/cm3/bin/config/I386_DARWIN cm3 -keep<br>^C<br><br>jbook2:m3core jay$ CM3_TARGET=AMD64_DARWIN M3CONFIG=/cm3/bin/config/AMD64_DARWIN cm3 -keep<br>^C<br><br>head */RTHooks.ms<br><br>but no.<br><br>But then this:<br><br>jbook2:m3core jay$ CM3_TARGET=AMD64_DARWIN M3CONFIG=/cm3/bin/config/AMD64_DARWIN cm3 -keep -commands<br>--- building in AMD64_DARWIN ---<br><br>..<br>/usr/libexec/gcc/darwin/x86_64/as RTAllocator.ms -o RTAllocator.mo<br><br>CM3_TARGET=I386_DARWIN M3CONFIG=/cm3/bin/config/I386_DARWIN cm3 -keep -commands<br><br>...<br>/usr/libexec/gcc/darwin/i386/as Ctypes.is -o Ctypes.io<br><br>i386 vs. x86_64.<br><br>Darwin.common:<br>proc configure_assembler() is<br>  if defined("SYSTEM_ASM")<br>    return<br>  end<br>  SYSTEM_ASM = "/usr/libexec/gcc/darwin/" & DarwinArch & "/as"<br>  if not FileExists(SYSTEM_ASM)<br>      SYSTEM_ASM = "as"<br>  end<br>end<br><br><br>jbook2:m3core jay$ grep DarwinArch /dev2/cm3/m3-sys/cminstall/src/config-no-install/*<br>/dev2/cm3/m3-sys/cminstall/src/config-no-install/AMD64_DARWIN:DarwinArch = "x86_64"<br>/dev2/cm3/m3-sys/cminstall/src/config-no-install/ARM_DARWIN:DarwinArch = "armv6" % ?<br>/dev2/cm3/m3-sys/cminstall/src/config-no-install/Darwin.common:  SYSTEM_ASM = "/usr/libexec/gcc/darwin/" & DarwinArch & "/as"<br>/dev2/cm3/m3-sys/cminstall/src/config-no-install/Darwin.common:  local arch = " -arch " & DarwinArch<br>/dev2/cm3/m3-sys/cminstall/src/config-no-install/Darwin.common:      arch = " -arch_only " & DarwinArch & " "<br>/dev2/cm3/m3-sys/cminstall/src/config-no-install/I386_DARWIN:DarwinArch = "i386"<br>/dev2/cm3/m3-sys/cminstall/src/config-no-install/PPC64_DARWIN:DarwinArch = "ppc64"<br>/dev2/cm3/m3-sys/cminstall/src/config-no-install/PPC_DARWIN:DarwinArch = "ppc"<br><br>?<br>cm3 -commands?<br><br>find /usr/lib | grep /as$<br>find /usr/libexec | grep /as$<br>
<br>Maybe the path changed? Has a version? or is there is only i686-apple-darwin9, powerpc-apple-darwin9?<br><br>I should look into getting the architecture into the assembly code though and just running "as", esp. on newer hosts.<br><br> - Jay<br><br><br><hr id="ecxstopSpelling">From: jay.krell@cornell.edu<br>To: mika@async.caltech.edu; m3devel@elegosoft.com<br>Date: Sun, 12 Dec 2010 00:59:18 +0000<br>Subject: Re: [M3devel] cm3 on snow leopard?<br><br>



<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
</style>


I admit I'm still using Leopard.<br><br> - Jay<br><br><br><br>> To: m3devel@elegosoft.com<br>> Date: Sat, 11 Dec 2010 14:19:02 -0800<br>> From: mika@async.caltech.edu<br>> Subject: [M3devel] cm3 on snow leopard?<br>> <br>> Hello m3devel,<br>> <br>> I just tried to install CM3 from cm3-I386_DARWIN-REL.deb on a new MacBook<br>> Air, but it seems I have the wrong assembler?<br>> <br>> I had to force dpkg to override the architecture on install (it was expecting<br>> i386, I think, and my machine identified itself as being "i386-darwin"?)<br>> <br>> Here are some details...<br>> <br>> [HAL:~/test/src] mika% /usr/local/cm3/bin/cm3 -version<br>> Critical Mass Modula-3 version 5.8.6<br>>   last updated: 2010-04-11<br>>   compiled: 2010-07-14 21:27:23<br>>   configuration: /usr/local/cm3/bin/cm3.cfg<br>>   host: I386_DARWIN<br>>   target: I386_DARWIN<br>> <br>> compiling an empty Main.m3 yields:<br>> <br>> [HAL:~/test/src] mika% /usr/local/cm3/bin/cm3 -keep -commands<br>> --- building in ../I386_DARWIN ---<br>> <br>> cd ../I386_DARWIN<br>> rm .M3SHIP<br>> rm .M3OVERRIDES<br>> inhale prog.mx<br>> inhale /usr/local/cm3/pkg/m3core/I386_DARWIN/libm3core.a<br>> inhale /usr/local/cm3/pkg/libm3/I386_DARWIN/libm3.a<br>> <br>> new source -> compiling Main.m3<br>> m3front ../src/Main.m3 -w1<br>> /usr/local/cm3//bin/cm3cg -funwind-tables -fPIC -gstabs+ -m32 -quiet -fno-reorde<br>> r-blocks Main.mc -o Main.ms<br>> echo "rep movsl" | as -o /dev/null 2> /dev/null<br>> as Main.ms -o Main.mo<br>> Main.ms:15:suffix or operands invalid for `push'<br>>   assemble => 1<br>> assembler failed assembling: Main.ms<br>> rm Main.mo<br>> exhale prog.mx<br>> rm prog.manifest<br>> <br>> compilation failed => not building program "prog"<br>> Fatal Error: package build failed<br>> <br>> [HAL:~/test/src] mika% uname -a<br>> Darwin HAL.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov  5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386<br>> [HAL:~/test/src] mika% as -v<br>> Apple Inc version cctools-782~33, GNU assembler version 1.38<br>> <br>> <br>> I have XCode installed.<br>> <br>> [HAL:~/test/src] mika% gcc -v<br>> Using built-in specs.<br>> Target: i686-apple-darwin10<br>> Configured with: /var/tmp/gcc/gcc-5664~89/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1<br>> Thread model: posix<br>> gcc version 4.2.1 (Apple Inc. build 5664)<br>> [HAL:~/test/src] mika% which gcc<br>> /usr/bin/gcc<br>> <br>> <br>> I must be doing something very obviously wrong (obviously to someone on this list, right??)<br>> <br>>      Mika<br>                                      </body>
</html>