www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - OS X linker warnings

reply John Colvin <john.loughran.colvin gmail.com> writes:
On OS X (ldc built from source) I am getting a lot of warnings 
like this:

ld: warning: object file 
(/usr/local/Cellar/ldc/0.16.0/lib/libphobos2-ldc.a(functional.o)) 
was built for newer OSX version (15.0) than being linked (10.11)

one for every object file. Is there some way of fixing this?
Oct 27 2015
parent reply David Nadlinger via digitalmars-d-ldc <digitalmars-d-ldc puremagic.com> writes:
On 27 Oct 2015, at 11:14, John Colvin via digitalmars-d-ldc wrote:
 one for every object file. Is there some way of fixing this?
This only started appearing with Xcode 7. Note that 15.0 is the Darwin version, whereas 10.11 is the "public" OS X release number. Not sure what is going on there. If you want to give it a try, I'd start comparing the object files with what Clang produces (e.g. using macho-dump). — David
Oct 27 2015
parent reply Dan Olson <gorox concast.net> writes:
On Tuesday, 27 October 2015 at 09:19:08 UTC, David Nadlinger 
wrote:
 On 27 Oct 2015, at 11:14, John Colvin via digitalmars-d-ldc 
 wrote:
 one for every object file. Is there some way of fixing this?
This only started appearing with Xcode 7. Note that 15.0 is the Darwin version, whereas 10.11 is the "public" OS X release number. Not sure what is going on there. If you want to give it a try, I'd start comparing the object files with what Clang produces (e.g. using macho-dump). — David
Xcode 7 ld64 does additional checks to make sure all objects meet min os version. The cause may be that ldc produces a triple of x86_64-apple-darwin whereas clang produces the triple x86_64-apple-macosx. Usually the latest version is appended too. Probably ldc should set OS to macosx like clang.
Oct 27 2015
parent reply Dan Olson <gorox comcast.net> writes:
Dan Olson <gorox concast.net> writes:

 On Tuesday, 27 October 2015 at 09:19:08 UTC, David Nadlinger wrote:
 On 27 Oct 2015, at 11:14, John Colvin via digitalmars-d-ldc wrote:
 one for every object file. Is there some way of fixing this?
This only started appearing with Xcode 7. Note that 15.0 is the Darwin version, whereas 10.11 is the "public" OS X release number. Not sure what is going on there. If you want to give it a try, I'd start comparing the object files with what Clang produces (e.g. using macho-dump). — David
Xcode 7 ld64 does additional checks to make sure all objects meet min os version. The cause may be that ldc produces a triple of x86_64-apple-darwin whereas clang produces the triple x86_64-apple-macosx. Usually the latest version is appended too. Probably ldc should set OS to macosx like clang.
I confirmed that changing triple OS from Triple::Darwin (the default) to Triple::MacOSX gets rid of all these ld warnings. I think we need a PR. Maybe dup the logic clang uses to pick the triple on OS X? -- Dan
Nov 11 2015
parent Dan Olson <gorox comcast.net> writes:
Dan Olson <gorox comcast.net> writes:

 Dan Olson <gorox concast.net> writes:

 On Tuesday, 27 October 2015 at 09:19:08 UTC, David Nadlinger wrote:
 On 27 Oct 2015, at 11:14, John Colvin via digitalmars-d-ldc wrote:
 one for every object file. Is there some way of fixing this?
This only started appearing with Xcode 7. Note that 15.0 is the Darwin version, whereas 10.11 is the "public" OS X release number. Not sure what is going on there. If you want to give it a try, I'd start comparing the object files with what Clang produces (e.g. using macho-dump). — David
Xcode 7 ld64 does additional checks to make sure all objects meet min os version. The cause may be that ldc produces a triple of x86_64-apple-darwin whereas clang produces the triple x86_64-apple-macosx. Usually the latest version is appended too. Probably ldc should set OS to macosx like clang.
I confirmed that changing triple OS from Triple::Darwin (the default) to Triple::MacOSX gets rid of all these ld warnings. I think we need a PR. Maybe dup the logic clang uses to pick the triple on OS X?
Just a simple change to macosx for now. https://github.com/ldc-developers/ldc/pull/1209
Nov 12 2015