[compiler-rt] [builtins] Fix divtc3.c etc. compilation on Solaris/SPARC with gcc (PR #101662)

Zibi Sarbinowski via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 08:58:18 PDT 2024


zibi2 wrote:

> `-save-temps` probably did work, but what's confusing is that the `.i` file is stored alongside the `.o`, not in the working directory as one would expect.

Unfortunately the `.i` is not created due to unrelated errors.

> * I find `CRT_HAS_128BIT` first defined (from `int_types.h` since `__LP64__` is defined), that immediately undefined.       However, in the source, that's guarded like this:
>   ```
>   #if defined(_MSC_VER) && !defined(__clang__)
>   #undef CRT_HAS_128BIT
>   #endif

Our downstream code has modified guard as follows:
```
#if (defined(_MSC_VER) && !defined(__clang__)) ||                              \
    defined(__MVS__)
#undef CRT_HAS_128BIT
#endif
```

> * The `.i` file claims to be from `compiler-rt/lib/builtins/divthc3.c`, which files doesn't exist upstream.  The body of the file isn't anything like `divtc3.c` either.

Sorry I included wrong file,  let me try again,  
[divtc3.c.txt](https://github.com/user-attachments/files/16627070/divtc3.c.txt)


> All the functions use (`__compiler_rt_logbtf` and several more) are guarded by `CRT_HAS_TF_MODE`. That works on SPARC, but won't for you since it isn't defined in your `.i` file. Are you maybe using modified sources?

Unfortunately, we don't have CRT_HAS_TF_MODE defined. I will check how come calling `__compiler_rt_logbtf1` is fine for us. 


https://github.com/llvm/llvm-project/pull/101662


More information about the llvm-commits mailing list