FS#37690 - [clang][llvm] build with support for compiler-rt

Attached to Project: Arch Linux
Opened by Daniel Micay (thestinger) - Friday, 08 November 2013, 03:53 GMT
Last edited by Evangelos Foutras (foutrelis) - Tuesday, 19 August 2014, 06:13 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

LLVM's code generation backend uses the runtime library to lower instructions that are not supported natively by the architecture. Many of the symbols are also exposed by the GNU runtime library so this is generally a non-issue, but there are missing symbols the backend expects to find.

A simple sample program, as an example:

```
#include <stdio.h>
#include <inttypes.h>

int main(void) {
int64_t x = 5;
int64_t y = 10;
int64_t result = x * y;
printf("%" PRId64 "\n", result);
return 0;
}
```

If you build with checked overflow support (-ftrapv) on i686, the `__mulodi4` symbol will fail to be found because it's supported by compiler-rt but not libgcc_s.
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Tuesday, 19 August 2014, 06:13 GMT
Reason for closing:  Upstream
Comment by Evangelos Foutras (foutrelis) - Monday, 28 July 2014, 14:11 GMT
I don't believe this is a packaging issue but an upstream one:

http://llvm.org/bugs/show_bug.cgi?id=14469

It doesn't look like this will be addressed by upstream soon...

Note that if you specify the static library that includes __mulodi4 then it compiles fine, but this is nothing more than a messy workaround:

$ clang -ftrapv -o test test.c /usr/lib/clang/3.4.2/lib/linux/libclang_rt.full-i386.a

Loading...