Skip to content

Rebase to upstream #67

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

Merged
merged 81 commits into from
Oct 18, 2023
Merged

Rebase to upstream #67

merged 81 commits into from
Oct 18, 2023

Conversation

dmakarov
Copy link

No description provided.

jackcmay and others added 30 commits September 9, 2023 14:38
* [BPF] Make rust allocation builtins unavailable for BPF target

- the calls to rust alloc/dealloc routines need to be preserved and
not replaced by compiler generated builtin inlined code
* [SOL][BPF] Adjust BPF tests

* [SOL][BPF] Improve reporting of stack size is too large

- issue only one warning for each function
- report the function location if debug information is available
Co-authored-by: Jack May <jack@solana.com>
* [SOL] Make lld thread-safe with llvm when used in-process

Every time Solang tries to link a web-assembly file in-process, the linker
re-inits llvm which is not thread-safe with the rest of solang.

Signed-off-by: Sean Young <sean@mess.org>

* [SOL][BPF] Enable the _ExtInt extension on the BPF Target for Solana

Signed-off-by: Sean Young <sean@mess.org>
Solana extends BPF so that structs type information is not fully
supported in BTF.  This leads to ICE crashes and some unsupported
relocations being emitted in binary files that linker errors on.
For, now the debug information is simply disabled when compiling
for Solana to avoid the errors in Debug builds.
Richard Patel and others added 26 commits September 10, 2023 12:03
This adds a wrapper around the LLDB executable that resides in the same directory. Once we start to distribute LLDB in sbf-tools, the wrapper + scripts can be put into the same directory as the LLDB executable. Invoking ./solana-lldb will pre-load helper functions to print rust as well as solana types (e.g. pubkeys in base58 or auto deref of accounts) and then start the LLDB executable.
- New SBF back-end subdirectory and corresponding test directories.
- Corresponding changes in ADT, Support, MC, Object, BinaryFormat for
  new SBF architecture and EM_SBF ELF object.
- Corresponding changes in clang to instantiate SBF for Triple::sbf
  rather than the old BPF back-end, etc.
- Corresponding changes in lld to add SBF arch recognition, etc.
- Corresponding changes in llvm-readelf to and opt.
…e syntax. (#54)

- Update the syntax of every instruction in SBFInstrInfo.td (currently
  using the asm variants feature to temporarily support both).
- Update AsmParser for the new syntax (add new operand, memory,
  instruction, and directive parse routines).
- Add error checking for unresolved 16-bit branch relocations and
  emit error message for graceful exit (the old BPF back-end crashes)
  and corresponding lit unit test.
- Add new lit unit tests in MC/SBF and MC/Disassembler/SBF to cover
  disassembly, object emission, and parsing of every single instruction.
  This is more extensive coverage than existed previously.
- Remaster all CodeGen/SBF unit tests accordingly.
- A minor TableGen patch was needed to support asm strings containing
  '|' within variant strings ('|' happens to be the variant separator).

The patch is a bit more complex than it otherwise might be in that we
currently support both syntaxes to ease the verification (e.g., being
able to see and compare each instruction and object code side-by-side
within each unit test). After some 'soak time' for the new functionality,
I intend to remove the old syntax altogether and otherwise clean-up. We'll
also remove the TableGen patch at that time.
Signed-off-by: Lucas Steuernagel <lucas.tnagel@gmail.com>
BTF/CO-RE has been disabled for Solana since:
#37

This patch updates related code (and all applicable unit tests) from roughly
a year of bitrot. This is in preparation for its possible use in the Move
project.

Additionally, a few other 14.0.2022-03-02 -> 15.0-2022-08-09 BPF patches
were reflected in the SBF back-end (e.g., bugfixes).
EM_SBF files are only accepted by new ELF parser of the RBPF.
Because of a bug in BPF backend ABS64 relocations are incorrectly
generated as 64_64 relocations in BPF object files. This temporary
works around this for relocations in .debug section to generate debug
information addresses correctly.
@dmakarov dmakarov requested a review from nvjle September 15, 2023 19:45
This change rust-lang@ab4fc87
breaks compilation of compiler-rt library for BPF and SBF targets.
For now disabling it.
@dmakarov dmakarov merged commit 038d472 into anza-xyz:solana-rustc/16.0-2023-06-05 Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants