1 |
2016-06-13 21:21 GMT+08:00 Felix Janda <felix.janda@××××××.de>: |
2 |
> [Added CC to the musl list] |
3 |
> |
4 |
> Lei Zhang wrote: |
5 |
>> 2016-06-13 3:07 GMT+08:00 Joerg Sonnenberger <joerg@×××.de>: |
6 |
>> > On Sun, Jun 12, 2016 at 10:51:11AM +0800, Lei Zhang via llvm-commits wrote: |
7 |
>> >> Hi, |
8 |
>> >> |
9 |
>> >> I'm replying to this thread; sorry I wasn't subscribed to the list, |
10 |
>> >> thus cannot reply to it directly. |
11 |
>> >> |
12 |
>> >> http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160606/161733.html |
13 |
>> >> |
14 |
>> >> Joerg, thanks for your reply. Could you please tell me what kind of |
15 |
>> >> test cases I should prepare? |
16 |
>> > |
17 |
>> > The target/triple parser has a unit test in |
18 |
>> > unittests/ADT/TripleTest.cpp. The rest should get output validation in |
19 |
>> > clang's test/Driver directory. Not sure which one is the primary |
20 |
>> > GNU/Linux test. |
21 |
>> |
22 |
>> Thanks for the pointer :) |
23 |
>> |
24 |
>> The patches are re-attached with test cases included. Do they look sane enough? |
25 |
> |
26 |
>> --- lib/Driver/ToolChains.cpp (revision 272546) |
27 |
>> +++ lib/Driver/ToolChains.cpp (working copy) |
28 |
>> @@ -4152,6 +4152,8 @@ |
29 |
>> |
30 |
>> if (Triple.isAndroid()) |
31 |
>> return Triple.isArch64Bit() ? "/system/bin/linker64" : "/system/bin/linker"; |
32 |
>> + else if (Triple.getEnvironment() == llvm::Triple::Musl) |
33 |
>> + return "/lib/ld-musl-" + Triple.getArchName().str() + ".so.1"; |
34 |
> |
35 |
> It does not seem to me that the dynamic linker name detection will work |
36 |
> on most archs not in the test cases. For example, the arm gentoo musl |
37 |
> stage3's have the target triple |
38 |
|
39 |
You're right. Frankly I've only had x86 platforms on my mind so far; |
40 |
but I agree with Rafael that we could extend this to other archs in |
41 |
the future. |
42 |
|
43 |
> It seems difficult to get all cases right and some of them might not be |
44 |
> very interesting, but it would be nice to have a more intelligent patch. |
45 |
> See for example |
46 |
> |
47 |
> http://git.alpinelinux.org/cgit/aports/plain/main/clang/clang-0004-Add-musl-targets-and-dynamic-linker.patch |
48 |
|
49 |
This looks neat :) |
50 |
|
51 |
|
52 |
Lei |