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

Use clang for the UEFI targets #104622

Merged
merged 4 commits into from
Nov 22, 2022
Merged

Commits on Nov 19, 2022

  1. Configuration menu
    Copy the full SHA
    cdb6907 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2022

  1. dist-various-2: Use clang for the UEFI targets

    This fixes an issue where the C and asm sources built by
    compiler_builtins were being compiled as ELF objects instead of PE
    objects. This wasn't noticed before because it doesn't cause
    compiler_builtins or rustc to fail to build. You only see a failure when
    a program is built that references one of the symbols in an ELF object.
    
    Compiling with clang fixes this because the `cc` crate converts the UEFI
    targets into Windows targets that clang understands, causing it to
    produce PE objects.
    
    Note that this requires compiler_builtins >= 0.1.84.
    
    Fixes rust-lang#104326
    nicholasbishop committed Nov 20, 2022
    Configuration menu
    Copy the full SHA
    eafe61d View commit details
    Browse the repository at this point in the history
  2. test-various: Use clang for the UEFI test

    This syncs it with how the UEFI targets are built in dist-various-2.
    nicholasbishop committed Nov 20, 2022
    Configuration menu
    Copy the full SHA
    01a2a54 View commit details
    Browse the repository at this point in the history
  3. dist: Ensure UEFI rlibs are all COFF

    If clang isn't the C compiler used for the UEFI targets, or if the wrong
    `--target` is passed to clang, we will get ELF objects in some
    rlibs. This will cause problems at link time when trying to compile a
    UEFI program that uses any of those objects. Add a check to the dist
    step for UEFI targets that reads each rlib with the `object` crate and
    fails with an error if any non-COFF objects are found.
    nicholasbishop committed Nov 20, 2022
    Configuration menu
    Copy the full SHA
    6054608 View commit details
    Browse the repository at this point in the history