ardi via llvm-dev
2016-Apr-12 13:48 UTC
[llvm-dev] Availability of "-export_dynamic" when compiling with support for older OS X releases
Looking at tools/clang/lib/Driver/Tools.cpp , there's this fragment of code: if (Args.hasArg(options::OPT_rdynamic) && Version[0] >= 137) CmdArgs.push_back("-export_dynamic"); I built LLVM 3.4.2 from a OS X 10.11 "El Capitan" but specifying a fat build (386+x86_64) and requesting support back up to 10.6. It went fine, and the build passes all tests when run on a 10.6.8 machine. But now, trying to compile LLVM 3.8.0, on 10.6.8, with that LLVM 3.4.2 build, everything goes fine until trying to link bugpoint. Then the linker reports the -export_dynamic option as an error. My guess is that when I built 3.4.2 in El Capitan, it found that the toolchain being used did support "-export_dynamic", but, however I wasn't interested in that toolchain, but in the system standard linker in 10.6.8. Is there any way I can build LLVM 3.4.2 in El Capitan, specifying that the linker will be the one from 10.6.8? Thanks!
ardi via llvm-dev
2016-Apr-13 10:57 UTC
[llvm-dev] Availability of "-export_dynamic" when compiling with support for older OS X releases
On Tue, Apr 12, 2016 at 3:48 PM, ardi <ardillasdelmonte at gmail.com> wrote: [...]> > Is there any way I can build LLVM 3.4.2 in El Capitan, specifying that > the linker will be the one from 10.6.8?In case anybody else faces this problem, if you build LLVM on a recent OS X release but specifying the deployment target to an older OS X version, when you run such build on the older OS X version, you need to specify -mlinker-version=97.17 as an option to clang/clang++ if the -rdynamic flag is also used. Otherwise, it will call the linker supposing it's a newer one, and it will fail because of unsupported options. It's somewhat uncomfortable to specify -mlinker-version=97.17 on each clang/clang++ invocation, but at least it fixes this problem and it works. ardi.
Bruce Hoult via llvm-dev
2016-Apr-13 12:12 UTC
[llvm-dev] Availability of "-export_dynamic" when compiling with support for older OS X releases
Thanks for your progress messages. I still have 10.6.8 machines that I might one day want a modern LLVM on, ranging from a Core Solo Mac Mini, to an alternative boot partition on my main quad core i7 17" MBP (take it from my cold dead hands etc etc). Do you now have LLVM 3.8 working? On Wed, Apr 13, 2016 at 10:57 PM, ardi via llvm-dev <llvm-dev at lists.llvm.org> wrote:> On Tue, Apr 12, 2016 at 3:48 PM, ardi <ardillasdelmonte at gmail.com> wrote: > [...] > > > > Is there any way I can build LLVM 3.4.2 in El Capitan, specifying that > > the linker will be the one from 10.6.8? > > In case anybody else faces this problem, if you build LLVM on a recent > OS X release but specifying the deployment target to an older OS X > version, when you run such build on the older OS X version, you need > to specify -mlinker-version=97.17 as an option to clang/clang++ if the > -rdynamic flag is also used. Otherwise, it will call the linker > supposing it's a newer one, and it will fail because of unsupported > options. > > It's somewhat uncomfortable to specify -mlinker-version=97.17 on each > clang/clang++ invocation, but at least it fixes this problem and it > works. > > ardi. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160414/dec0fb55/attachment.html>