Bug 3502 – Fix for dropped Mac OS X 10.5

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Mac OS X
Creation time
2009-11-13T14:43:00Z
Last change time
2015-06-09T05:13:48Z
Assigned to
nobody
Creator
doob

Attachments

IDFilenameSummaryContent-TypeSize
496osx.patchFix for dropped Mac OS X 10.5text/plain10697
1196ld64-77_src_debugline_c.patchld64-77 patchtext/plain428
1197ld64-77_src_debugline_c.patchld64-77 patchtext/plain487

Comments

Comment #0 by doob — 2009-11-13T14:43:42Z
Created attachment 496 Fix for dropped Mac OS X 10.5 The attached path fixes the dropped Mac OS X 10.5 support as far as I can see.
Comment #1 by bugzilla — 2009-11-13T15:59:40Z
I don't think the changes to machobj.c are necessary. Did you try it without them?
Comment #2 by doob — 2009-11-14T03:19:19Z
Yes I tried, it doesn't work, bus error. If I build the compiler with this patch on 10.5 and build a binary on 10.5 it runs on 10.5 and 10.6. If I use the same compiler and build a binary on 10.6 it runs on 10.6 but not on 10.5. Maybe not perfect but at least it's better.
Comment #3 by bugzilla — 2009-12-02T15:28:12Z
I installed the 10.4 sdk from the OSX 10.6 sdk. Unfortunately, now the .4u sdk seems to be missing stdarg.h (it was there with 10.5's version of the .4u sdk). I changed it to the .5 sdk, and now it builds.
Comment #4 by doob — 2009-12-04T02:52:12Z
I'm closing this one now, it seems to work, don't know what I did the first time
Comment #5 by bugzilla — 2009-12-06T00:47:53Z
Fixed dmd 1.053 and 2.037
Comment #6 by code — 2013-02-26T17:02:50Z
Why do we check for the OS version to workaround linker bugs? If there really is no other way we should at least check the linker/gcc-toolchain version. If I understood the changes correctly then the "10.6" linker segfaults when linking empty segments, right? What's the issue with 10.5? >If I use the same compiler and build a binary on 10.6 it runs on 10.6 but not on 10.5. Maybe not perfect but at least it's better. What has happened here? Isn't all of this completely unnecessary now that we use onAddImage/getSection?
Comment #7 by doob — 2013-02-26T23:59:17Z
(In reply to comment #6) > Why do we check for the OS version to workaround linker bugs? > If there really is no other way we should at least check the > linker/gcc-toolchain version. How would you do that during runtime? > If I understood the changes correctly then the "10.6" linker segfaults when > linking empty segments, right? > What's the issue with 10.5? Yes, I think so. The changes to fix 10.6 broke the 10.5 support. I just added back the code that worked in 10.5, depending on what version the compiler is running. > >If I use the same compiler and build a binary on 10.6 it > runs on 10.6 but not on 10.5. Maybe not perfect but at least it's better. > > What has happened here? > > Isn't all of this completely unnecessary now that we use onAddImage/getSection? I don't know, maybe.
Comment #8 by code — 2013-02-28T04:10:25Z
On OSX 10.5.2 the XCode3.0 linker (ld64-77) still crashes when handling debug_line sections with an empty line table because it calculates the wrong minimal section length. This bug is still present on ld64-134.9 but they "fixed" the symptom by adding a NULL check in ld64-87. ---- http://www.opensource.apple.com/source/ld64/ld64-97.2/ChangeLog ---- 2008-07-18 Nick Kledzik <[email protected]> * src/MachOReaderRelocatable.hpp: don't crash if debug_line section has no line table ----
Comment #9 by code — 2013-02-28T04:14:37Z
Created attachment 1196 ld64-77 patch
Comment #10 by code — 2013-02-28T04:28:15Z
Created attachment 1197 ld64-77 patch
Comment #11 by bugzilla — 2013-03-06T22:43:04Z