This is an archive of the discontinued LLVM Phabricator instance.

Fix two bugs for musl-libc on ARM
ClosedPublic

Authored by zlei on Jul 28 2016, 1:19 AM.

Details

Summary

Bug #1: triples like armv7-pc-linux-musl uses wrong linker name ld-musl-armv7.so.1; the right name should be ld-musl-arm.so.1, disregarding the subarch field.

Bug #2: when compiler option -mhard-float is used, we should use the "hardfloat" linker, no matter whether the triple itself mentions "hardfloat".

Diff Detail

Event Timeline

zlei updated this revision to Diff 65881.Jul 28 2016, 1:19 AM
zlei retitled this revision from to Fix two bugs for musl-libc on ARM.
zlei updated this object.
zlei added reviewers: cfe-commits, rafael.

Hi Lei,

Thanks for the fix. A few comments. Also, please, add some tests.

cheers,
--renato

lib/Driver/ToolChains.cpp
4266

This is an early return, no need for brackets not the "else" below. Ex:

if (Android)
  return ...

if (musl) {
  ...
  return ...
}
zlei updated this revision to Diff 66074.Jul 28 2016, 7:25 PM

Restructure the code and add a few tests.

zlei added a comment.Jul 28 2016, 7:27 PM

@rengolin Thanks for your comments. Patch updated.

rengolin accepted this revision.Jul 31 2016, 7:38 AM
rengolin added a reviewer: rengolin.

LGTM. Thanks!

This revision is now accepted and ready to land.Jul 31 2016, 7:38 AM
zlei added a comment.Aug 7 2016, 9:00 PM

@rengolin Could you please apply this patch? I don't have the permission.

Thanks.

This revision was automatically updated to reflect the committed changes.
rovka added a subscriber: rovka.Aug 8 2016, 1:37 AM

Hi Lei,

Renato is on vacation, so I committed this for you.

Regards,
Diana

zlei added a comment.Aug 8 2016, 6:14 PM

@rovka Thanks a lot :)