[kmscon-devel] Amended linker check for OS X

Florian Gilcher florian.gilcher at asquera.de
Thu Mar 27 01:50:29 PDT 2014


Hi,

I went through a few manuals last evening and hopefully amended the patch to
your li(n)king.

First of all, using another linker is not really an option, as the
apple-provided one is the only one I know building correct Mach-O binaries, and
apple does not ship their fork of GNU ld anymore.

It attempts not to get to far with implementing new macros or including
additional M4 libraries.

As libtool only checks for GNU ld or not, I decided to check for the host
platform next. As the OS linker is used in that case, that seems like the most
stable way to go. I decided not to check for apples ld using its version string
(because it doesn't seem very stable).

On Darwin, it now links with -dead_strip,-dead_strip_dylibs (equivalent to
--as-needed, --gc-sections) and -bind_at_load (similar to -z,now). I decided no
to use -read_only_relocs, as it is not available on x86_64 and there is no
32bit OS X in support anymore.

--version_script has no equivalent on OS X, as two-level namespaces are used
and applied by default.[1]

Also, if nothing can be guessed, i'd still err on the side of at least
compiling. A warning can be applied.

I hope that solves most problems with this patch.

Best,
Florian

[1]: https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/MachOTopics/1-Articles/executing_files.html



More information about the kmscon-devel mailing list