<thefossguy>
I’m now wondering what’s glibc doing now
<thefossguy>
* I’m now wondering what’s glibc doing
<davidlt[m]>
Most work is HW feature detection, vectors, and in general optimized stuff.
<thefossguy>
Well, its not like I cant see the src but the GCC sources scare me 😳
<thefossguy>
davidlt[m]: Do you mean this is the case for GCC and therefore its faster?
<thefossguy>
*^faster at memcpy
<davidlt[m]>
Well the article states that LLVM glibc memcpy is slower even with these patches compared to glibc.
<thefossguy>
That was my initial question. Why is it slower? 😅
<davidlt[m]>
And glibc and GCC are independent projects.
<davidlt[m]>
Probably less interest?
<thefossguy>
Ah, gotcha for both
<davidlt[m]>
I am not sure what would actually use it.
<thefossguy>
I recall ldd-ing my Rust binary and seeing it depend on libgcc_s. Was amusing ;)
<davidlt[m]>
That's gcc runtime bits.
<thefossguy>
Yeah
<thefossguy>
Is it possible to see which extensions a binary was compiled for? I'm trying to compile without the c extension but I don't think that it is working.
<thefossguy>
Using this gcc command: gcc src/main.c -o rv64g-c -march=rv64imafd
<davidlt[m]>
there is a flag in ELF headers IIRC for C.
<davidlt[m]>
Tag_RISCV_arch contains a string for the target architecture taken from the option -march. Different architectures will be integrated into a superset when object files are merged.
<davidlt[m]>
```
<davidlt[m]>
I think there were some discussions about it recently
<davidlt[m]>
That you cannot trust it or something like that.
<thefossguy>
It also has c2p0, which I assume is for the c extension. But I specifically didn't specify it.
<thefossguy>
s/>`?/>` to not be overridden by `-march=native`?/
<davidlt[m]>
> One random fact of note: binutils stopped ascribing any information to
<davidlt[m]>
> the tag a few releases ago, we found a show-stopped bug days before
<davidlt[m]>
> release related to one of the ISA string spec changes and determined it
<davidlt[m]>
> wasn't worth bothering with them any more.
<davidlt[m]>
I think it even got disabled on the kernel side recently.
<thefossguy>
Well, that's helpful /s
<thefossguy>
I just wanna make sure that gcc doesn't use the c extension. Any way to make sure of this?
<thefossguy>
It's a simple hello world c program
<davidlt[m]>
march should be enough for that, I think.
<davidlt[m]>
There is not native support in GCC, but it did land in LLVM/Clang recently.
<davidlt[m]>
There is no way to detect what is "native" these days.
<davidlt[m]>
Probably once hwprobe lands and get exposed via glibc, or something.
<thefossguy>
Capstone doesn't seem to disassemble the '.text' section if the binary was built with compressed instructions... I'll try building with clang