Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consolidate libc and libssp into compiler-rt #7265

Closed
andrewrk opened this issue Dec 1, 2020 · 0 comments · Fixed by #17962
Closed

consolidate libc and libssp into compiler-rt #7265

andrewrk opened this issue Dec 1, 2020 · 0 comments · Fixed by #17962
Labels
accepted This proposal is planned. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Dec 1, 2020

Right now, zig generates a "c" library that has functions such as memcpy and sqrt because LLVM generates code that on those symbols. I propose to make zig's compiler-rt have all the symbols that codegen depends on, regardless of what library will typically provide them. Then our existing trick of using weak exports (which can be overridden by e.g. linking against libc) will make sure we don't provide too many functions. We already use function-sections to omit unused symbols.

The benefits of this are simplicity, which will become even more clear when we have 2 competing backends: the LLVM one and the self-hosted zig one, which will each require a different set of compiler-rt symbols. We may even want to expose a build option to compiler-rt.zig (or maybe a different entry point?) so that compiler-rt source can know which backend it needs to provide symbols for.

The simplicity is not only for zig compiler developers, but for users as well. For example, this would simplify the usage of #7264 - we would not need equivalent CLI flags for these other 2 libs, and users would not need to deal with all 3 things.

@andrewrk andrewrk added the proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. label Dec 1, 2020
@andrewrk andrewrk added this to the 0.8.0 milestone Dec 1, 2020
@andrewrk andrewrk added the accepted This proposal is planned. label Dec 1, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 May 19, 2021
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 Nov 20, 2021
@andrewrk andrewrk modified the milestones: 0.10.0, 0.11.0 Apr 16, 2022
andrewrk added a commit that referenced this issue Apr 26, 2022
 * unify the logic for exporting math functions from compiler-rt,
   with the appropriate suffixes and prefixes.
   - add all missing f128 and f80 exports. Functions with missing
     implementations call other functions and have TODO comments.
 * move math functions from freestanding libc to compiler-rt (#7265)
 * enable all the f128 and f80 code in the stage2 compiler and behavior
   tests (#11161).
andrewrk added a commit that referenced this issue Apr 26, 2022
 * unify the logic for exporting math functions from compiler-rt,
   with the appropriate suffixes and prefixes.
   - add all missing f128 and f80 exports. Functions with missing
     implementations call other functions and have TODO comments.
   - also add f16 functions
 * move math functions from freestanding libc to compiler-rt (#7265)
 * enable all the f128 and f80 code in the stage2 compiler and behavior
   tests (#11161).
 * update std lib to use builtins rather than `std.math`.
andrewrk added a commit that referenced this issue Apr 27, 2022
 * unify the logic for exporting math functions from compiler-rt,
   with the appropriate suffixes and prefixes.
   - add all missing f128 and f80 exports. Functions with missing
     implementations call other functions and have TODO comments.
   - also add f16 functions
 * move math functions from freestanding libc to compiler-rt (#7265)
 * enable all the f128 and f80 code in the stage2 compiler and behavior
   tests (#11161).
 * update std lib to use builtins rather than `std.math`.
kubkon pushed a commit that referenced this issue May 2, 2022
 * unify the logic for exporting math functions from compiler-rt,
   with the appropriate suffixes and prefixes.
   - add all missing f128 and f80 exports. Functions with missing
     implementations call other functions and have TODO comments.
   - also add f16 functions
 * move math functions from freestanding libc to compiler-rt (#7265)
 * enable all the f128 and f80 code in the stage2 compiler and behavior
   tests (#11161).
 * update std lib to use builtins rather than `std.math`.
andrewrk added a commit that referenced this issue Aug 17, 2022
This was disabled when self-hosted was less capable; now it is time to
enable it.

See related issue #7265
andrewrk added a commit that referenced this issue Aug 18, 2022
This was disabled when self-hosted was less capable; now it is time to
enable it.

See related issue #7265
andrewrk added a commit that referenced this issue Aug 18, 2022
This was disabled when self-hosted was less capable; now it is time to
enable it.

See related issue #7265
andrewrk added a commit that referenced this issue Aug 18, 2022
This was disabled when self-hosted was less capable; now it is time to
enable it.

See related issue #7265
@andrewrk andrewrk modified the milestones: 0.11.0, 0.12.0 Jun 19, 2023
andrewrk added a commit that referenced this issue Nov 7, 2023
andrewrk added a commit that referenced this issue Nov 9, 2023
andrewrk added a commit that referenced this issue Nov 10, 2023
@andrewrk andrewrk modified the milestones: 0.13.0, 0.12.0 Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This proposal is planned. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant