This is an archive of the discontinued LLVM Phabricator instance.

Driver: support ARM/HF on a single toolchain
ClosedPublic

Authored by compnerd on Sep 19 2015, 3:11 PM.

Details

Reviewers
rengolin
jroelofs
Summary

ARM EABI adds target attributes to the object file. Amongst the attributes that
are emitted is the VFP argument passing (Hard vs Soft). The linker is
responsible for checking these attributes and erroring on mismatches. This
causes problems for the compiler-rt builtins when targeting both hard and
soft. Because both of these options name the builtins compiler-rt component
the same (libclang_rt.builtins-arm.a or libclang_rt.builtins-arm-android). GCC
is able to get away with this as it does one target per toolchain. This
changes the naming convention for the ARM compiler-rt builtins to differentiate
between HF and Soft. Although this means that compiler-rt may be duplicated, it
enables supporting both variants from a single toolchain. A similar approach is
taken by the Darwin toolchain, naming the library to differentiate between the
calling conventions.

Diff Detail

Event Timeline

compnerd updated this revision to Diff 35180.Sep 19 2015, 3:11 PM
compnerd retitled this revision from to Driver: support ARM/HF on a single toolchain.
compnerd updated this object.
compnerd added a reviewer: rengolin.
compnerd added a subscriber: cfe-commits.

You'll also need a corresponding patch for compiler-rt to make it use the new name appropriately.

Yeah, I realize that we will need that part of the change as well. However, I think that this is a sufficiently standalone piece that we can merge this first.

Won't it break hf-only builds, if you don't do both commits at the same time?

rengolin edited edge metadata.Sep 23 2015, 7:40 PM

IIUC, HF builds still produce soft float attributes, and that's the problem.

It would fail to link previously anyways, since as Renato correctly explained, you would have objects that were built with the soft float attribute, and then were linking against hard float built object.

Oh, yeah, true.

jroelofs accepted this revision.Sep 25 2015, 11:43 AM
jroelofs added a reviewer: jroelofs.

Now that you've got D13155 squared away, LGTM.

This revision is now accepted and ready to land.Sep 25 2015, 11:43 AM
compnerd closed this revision.Oct 4 2015, 11:50 AM