[M3devel] Mac 10.10?

Jay K jay.krell at cornell.edu
Thu Aug 13 11:23:46 CEST 2015


Eh, seems like some off by one in my testing -- things work now, including X apps.
 - Jay



From: jay.krell at cornell.edu
To: m3devel at elegosoft.com
Date: Tue, 11 Aug 2015 11:44:33 +0000
Subject: Re: [M3devel] Mac 10.10?




Darn, there might still be problems -- i.e. running stubgen.Though again, the C backend works to build the entire system.And I think self-built gcc 5.2.0 helped.I'd rather not depend on that though.
I'm increasingly leary of the weak linkages among compiler/assembler/linker.
Interesting note, if you try to build stock gcc 4.7.4 on 10.10.4 it crashes pretty early.
I'll keep poking around but it could be a while.Anyone else running 10.10?
cm3cg is noticeably faster to run than the C backend, even on new machine.Darn, I was hoping modern hardware would make it look better. :(
 - Jay


From: jay.krell at cornell.edu
To: m3devel at elegosoft.com
Date: Tue, 11 Aug 2015 10:47:57 +0000
Subject: Re: [M3devel] Mac 10.10?




I figured out a big problem in 10.10.4 using the gcc backend.Probably the only problem.

 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67183  https://llvm.org/bugs/show_bug.cgi?id=24428 

I had previously hacked cm3cg to always be 10.4-compatible.I don't like the tools to probe their host and tailor theiroutput to it, lest the output or the tools meant to be copiedto an older/newer host.

The bug is demonstrated clearly in my bug reports.

The bug is this: 32bit   + 10.4 compatible  + gcc backend  + clang assembler 
  gcc/cm3cg output "stubs' and "non-lazy pointers" in any order. clang outputs them all stubs first, then non-lazy pointers. When the order isn't like clang, the LLVM assembler doesn't match up the refs and defs correctly, leading to function calls resolving to somewhat arbitrary other functions. 
 It is "like" a compiler bug, you get incorrect code, but it is an assembler bug.
  There are three classes of fix. But nothing perfect/easy.   1) Run the same assembler as gcc.  On my system this is "as" in path.  But I don't know if this is guaranteed to work.  I currently use gcc -x assembler as the assembler.    2) Drop 10.4 support -- don't output the stubs.   3) Change cm3cg to output all stubs before all non-lazy pointers. I'd have to see if that is easy or wait for the gcc developers to offer a patch.   4) Drop 32bit. :) 64bit never has stubs.   If gcc output object files directly, like most other compilers do, that'd fix it. The C backend has no problem.    - Jay

From: jay.krell at cornell.edu
To: m3devel at elegosoft.com
Subject: RE: Mac 10.10?
Date: Sun, 9 Aug 2015 03:01:30 +0000




And now 10.10 works.I think what changed is switching to a self-built gcc 5.2.0 from the builtin "gcc" which is actually clang/llvm (frontend and backend). I'll have to try again with the builtin. Strange.

It was failing with the 4.7 gcc backend. i.e. with very little C.And I believe it had failed with C backend (prior to the Builder.m3 problems).
I switched to the C backend for better debugging and it went away. I had somewhat accidentally also changed C compilers -- oops, too much change. Anyway, after I rebuild the entire system instead of just the compiler, I'll go back and try some more combinations and debug.. one has to learn a new debugger on this system too -- lldb replaces m3gdb, and the Xcode gui debugger was briefly working quite nicely but stopped working. :(
Is anyone else using 10.10 with the "builtin" gcc/clang?Or maybe clang toolset on another platform?
Later, - Jay

From: jay.krell at cornell.edu
To: m3commit at elegosoft.com; m3devel at elegosoft.com
Subject: alloca(jmpbuf_size) is in
Date: Sun, 9 Aug 2015 01:31:14 +0000




I've seen it work now on AMD64_LINUX, SPARC32_SOLARIS, and I386_DARWIN 10.5.8.I think MacOSX 10.10.4 has something else wrong with it that'll take a while to figure out.

So I commited it again.

PLEASE NOTE that the upgrade procedure is tricky like with cm3cg, but the results of getting it wrong are worse than the recent round of cm3cg changes.You will get runtime crashes.


upgrade.py and upgrade-full.sh and likely upgrade.sh all do the right thing, same as always.

Not only is cm3 closely tied with cm3cg, but it also closely tied with m3core.The compiler and runtime collaborate on producing and consuming certain data structures,and these data structures have changed now.


At least it should be more debuggable now with the C backend -- so I can see local variables for example.Fixing cm3cg to work with plain -g would be good.

Is anyone else running 10.10?

Thanks, - Jay


From: jay.krell at cornell.edu
To: m3commit at elegosoft.com
Date: Sat, 8 Aug 2015 18:59:55 +0000
Subject: Re: [M3commit] [modula3/cm3] 57ad34: Revert "allocate jmpbufs with alloca(external vari...




I believe this is working ok on MacOS X 10.5.8 with cm3cg and C backend.However things do not work on 10.10.4. I'm guessing for another unknownreason but I want to debug that separately for now.
If anyone else can give the previous a try on their configuration, that'd be appreciated.(In github app, you can revert my revert. I haven't found how to do w/ git command line).
Thank you.
Specifically on 10.0.4 I get:
* thread #1: tid = 0x3a9861, 0x002b7360 cm3`RTAllocator__GetTracedObj + 36, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x24)    frame #0: 0x002b7360 cm3`RTAllocator__GetTracedObj + 36  * frame #1: 0x002b6e90 cm3`RTHooks__AllocateTracedObj + 17    frame #2: 0x00281272 cm3`TextUtils_M3 + 49    frame #3: 0x002c705c cm3`RTLinker__RunMainBody + 763    frame #4: 0x002c6f2d cm3`RTLinker__RunMainBody + 460    frame #5: 0x002c6f2d cm3`RTLinker__RunMainBody + 460    frame #6: 0x002c6f2d cm3`RTLinker__RunMainBody + 460    frame #7: 0x002c6f2d cm3`RTLinker__RunMainBody + 460    frame #8: 0x002c6f2d cm3`RTLinker__RunMainBody + 460    frame #9: 0x002c6f2d cm3`RTLinker__RunMainBody + 460    frame #10: 0x002c6f2d cm3`RTLinker__RunMainBody + 460    frame #11: 0x002c6f2d cm3`RTLinker__RunMainBody + 460    frame #12: 0x002c6f2d cm3`RTLinker__RunMainBody + 460    frame #13: 0x002c6f2d cm3`RTLinker__RunMainBody + 460    frame #14: 0x002c6f2d cm3`RTLinker__RunMainBody + 460    frame #15: 0x002c6f2d cm3`RTLinker__RunMainBody + 460    frame #16: 0x002c64e8 cm3`RTLinker__AddUnitI + 287    frame #17: 0x002c6563 cm3`RTLinker__AddUnit + 116    frame #18: 0x00002341 cm3`main(argc=1, argv=0xbffffca8, envp=0xbffffcb0) + 97 at _m3main.c:22    frame #19: 0x9518e6d9 libdyld.dylib`start + 1

  - Jay

Date: Sat, 8 Aug 2015 11:49:10 -0700
From: jay.krell at cornell.edu
To: m3commit at elegosoft.com
Subject: [M3commit] [modula3/cm3] 57ad34: Revert "allocate jmpbufs with alloca(external vari...

  Branch: refs/heads/master
  Home:   https://github.com/modula3/cm3
  Commit: 57ad34f5034d5000bd5d63fb384851921bc782a1
      https://github.com/modula3/cm3/commit/57ad34f5034d5000bd5d63fb384851921bc782a1
  Author: jaykrell <jay.krell at cornell.edu>
  Date:   2015-08-08 (Sat, 08 Aug 2015)
 
  Changed paths:
    M m3-libs/m3core/src/runtime/ex_frame/RTExFrame.m3
    M m3-sys/m3back/src/M3C.m3
    M m3-sys/m3cc/gcc/gcc/m3cg/parse.c
    R m3-sys/m3front/src/misc/Jmpbufs.i3
    R m3-sys/m3front/src/misc/Jmpbufs.m3
    M m3-sys/m3front/src/misc/M3.i3
    M m3-sys/m3front/src/misc/Marker.i3
    M m3-sys/m3front/src/misc/Marker.m3
    M m3-sys/m3front/src/misc/m3makefile
    M m3-sys/m3front/src/stmts/TryFinStmt.m3
    M m3-sys/m3front/src/stmts/TryStmt.m3
    M m3-sys/m3front/src/values/Module.i3
    M m3-sys/m3front/src/values/Module.m3
    M m3-sys/m3front/src/values/Procedure.m3
    M m3-sys/m3middle/src/M3RT.m3
    M m3-sys/m3middle/src/Target.i3
    M m3-sys/m3middle/src/Target.m3
 
  Log Message:
  -----------
  Revert "allocate jmpbufs with alloca(external variable initialized in C)"
 
This reverts commit 44fbd1608a73affa0625a9df4bff1c7248cc6f3c.
 
 

_______________________________________________
M3commit mailing list
M3commit at elegosoft.com
https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3commit 		 	   		  

_______________________________________________
M3commit mailing list
M3commit at elegosoft.com
https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3commit 		 	   		   		 	   		   		 	   		  

_______________________________________________
M3devel mailing list
M3devel at elegosoft.com
https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel 		 	   		  

_______________________________________________
M3devel mailing list
M3devel at elegosoft.com
https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20150813/06668392/attachment-0002.html>


More information about the M3devel mailing list