3502 – Fix for dropped Mac OS X 10.5

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3502 - Fix for dropped Mac OS X 10.5
Summary: Fix for dropped Mac OS X 10.5
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Mac OS X
: P2 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
Reported: 2009年11月13日 14:43 UTC by Jacob Carlborg
Modified: 2015年06月09日 05:13 UTC (History)
2 users (show)

See Also:


Attachments
Fix for dropped Mac OS X 10.5 (10.45 KB, patch)
2009年11月13日 14:43 UTC, Jacob Carlborg
Details | Diff
ld64-77 patch (428 bytes, text/plain)
2013年02月28日 04:14 UTC, Martin Nowak
Details
ld64-77 patch (487 bytes, text/plain)
2013年02月28日 04:28 UTC, Martin Nowak
Details
Show Obsolete (1) Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Jacob Carlborg 2009年11月13日 14:43:42 UTC
Created attachment 496 [details] 
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 Walter Bright 2009年11月13日 15:59:40 UTC
I don't think the changes to machobj.c are necessary. Did you try it without them?
Comment 2 Jacob Carlborg 2009年11月14日 03:19:19 UTC
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 Walter Bright 2009年12月02日 15:28:12 UTC
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 Jacob Carlborg 2009年12月04日 02:52:12 UTC
I'm closing this one now, it seems to work, don't know what I did the first time
Comment 5 Walter Bright 2009年12月06日 00:47:53 UTC
Fixed dmd 1.053 and 2.037
Comment 6 Martin Nowak 2013年02月26日 17:02:50 UTC
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 Jacob Carlborg 2013年02月26日 23:59:17 UTC
(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 Martin Nowak 2013年02月28日 04:10:25 UTC
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 <kledzik@apple.com>
	* src/MachOReaderRelocatable.hpp: don't crash if debug_line section has no line table
----
Comment 9 Martin Nowak 2013年02月28日 04:14:37 UTC
Created attachment 1196 [details] 
ld64-77 patch
Comment 10 Martin Nowak 2013年02月28日 04:28:15 UTC
Created attachment 1197 [details] 
ld64-77 patch
Comment 11 Walter Bright 2013年03月06日 22:43:04 UTC
https://github.com/D-Programming-Language/dmd/pull/1701 


AltStyle によって変換されたページ (->オリジナル) /