Page MenuHomeFreeBSD

libgcc_s: Add libm dependencies from div* functions
ClosedPublic

Authored by emaste on Oct 7 2016, 9:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 8, 5:29 AM
Unknown Object (File)
Mon, Apr 8, 5:29 AM
Unknown Object (File)
Mon, Mar 25, 9:13 PM
Unknown Object (File)
Mon, Mar 25, 8:14 PM
Unknown Object (File)
Mar 11 2024, 6:05 PM
Unknown Object (File)
Mar 11 2024, 6:05 PM
Unknown Object (File)
Mar 11 2024, 6:05 PM
Unknown Object (File)
Mar 11 2024, 5:53 PM
Subscribers

Details

Summary

div{d,s,x}c3.c contain calls to builtins such as` __builtin_scalbnl`, which Clang turns back into a call to scalbnl.

For now link libm's C version of the required support routines.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to libgcc_s: Add libm dependencies from div* functions.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added reviewers: theraven, ed, dim.
emaste added a subscriber: bapt.

This is for the shared library used for unwinding, etc., right? Would there be any harm in just linking against libm dynamically?

In D8190#170144, @ed wrote:

This is for the shared library used for unwinding, etc., right? Would there be any harm in just linking against libm dynamically?

For unwinding as well as compiler runtime support. I don't really like introducing a nearly universal dependency on libm.

ed edited edge metadata.
In D8190#170144, @ed wrote:

This is for the shared library used for unwinding, etc., right? Would there be any harm in just linking against libm dynamically?

For unwinding as well as compiler runtime support. I don't really like introducing a nearly universal dependency on libm.

Makes sense. I was under the impression that libgcc_s was only used for stack unwinding, but it looks it's also linked in when building simple C apps. :-)

This revision is now accepted and ready to land.Oct 13 2016, 6:29 PM
In D8190#171242, @ed wrote:

Makes sense. I was under the impression that libgcc_s was only used for stack unwinding, but it looks it's also linked in when building simple C apps. :-)

Yes, these libraries are confusing. In summary:

  • libgcc.a contains compiler runtime support (e.g. 64-bit division on 32-bit processors)
  • libgcc_eh.a contains the exception handling stack unwinding code
  • libgcc_s.so contains both of the above for dynamically linked binaries
This revision was automatically updated to reflect the committed changes.