[PATCH] D108416: [llvm-libgcc] initial commit

Christopher Di Bella via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 28 10:28:45 PST 2022


cjdb added a comment.

In D108416#3277189 <https://reviews.llvm.org/D108416#3277189>, @MaskRay wrote:

> Could you please comparing the symbol set with GCC libgcc_s.so.1 for these architectures you mostly care about?

Done for x86_64 just now, will move on to the others shortly.
I'd actually like to get some sort of pre-commit CI on this subproject if at all possible, but I'm not entirely sure how to do that.

> Knowing which symbols are missing and have mismatched versions will be useful. I spot checked a small set of symbols and found some minor issues.
> If 32-bit arm is so different from other architectures, perhaps use a global ifdef like
>
>   #ifdef __arm__
>   ....
>   #else
>   ...
>   #endif
>
> instead of special casing `#ifdef __arm__` (or the like) in every version node.

Is it really that unwieldy?



================
Comment at: llvm/tools/llvm-libgcc/generate_version_script.py:67
+  """
+    result = subprocess.run(args=['readelf', '-su', '--wide', path],
+                            capture_output=True)
----------------
MaskRay wrote:
> llvm-readelf and drop --wide
Why drop `--wide`?


================
Comment at: llvm/tools/llvm-libgcc/lib/gcc_s.ver:64
+  #elif defined(__x86_64__)
+    __register_frame_info; __register_frame_info_table; __register_frame_table;
+    __deregister_frame;    __deregister_frame_info;     __register_frame;
----------------
MaskRay wrote:
> `__register_frame_info` and its friends are generic. See `llvm-nm -jDU /usr/aarch64-linux-gnu/lib/libgcc_s.so.1` if you have installed aarch64 GCC cross compiler on a Debian/Ubuntu like distro.
Yep, but they're apparently versioned under `GLIBC_2.0` for everything else :-(


================
Comment at: llvm/tools/llvm-libgcc/lib/gcc_s.ver:179
+  #elif defined(__x86_64__)
+    __divtc3; __multc3;
+  #endif
----------------
MaskRay wrote:
> `__addtf3` and its friends are missing here.
> 
> ```
> % llvm-nm -jDU /lib/x86_64-linux-gnu/libgcc_s.so.1 | grep addtf3     
> __addtf3@@GCC_4.3.0
> ```
`__addtf3` is in neither `libclang_rt.builtins-x86_64.a` nor `libunwind.a` for x86-64, which is why it's omitted here. I think we'd need to add it to `libclang_rt.builtins-x86_64` in order for it to be usable?


================
Comment at: llvm/tools/llvm-libgcc/lib/gcc_s.ver:197
+  #if defined(__x86_64__) || defined(__aarch64__)
+    __divmodti4;
+  #elif defined(__i386__) || defined(LLVM_LIBGCC_ARM_GNUEABIHF)
----------------
MaskRay wrote:
> This symbol is also in `/usr/powerpc64le-linux-gnu/lib/libgcc_s.so.1`.
> 
> If just arm is weird, exclude it.
Looks like this is a 64-bit global symbol. I've updated the documentation to indicate which platforms are supported at the moment, and how to expand support for platforms like PowerPC.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108416/new/

https://reviews.llvm.org/D108416



More information about the llvm-commits mailing list