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

Cherry-pick: [builtins] Move cfi start's after the symbol name [NFC] #162

Merged

Conversation

tmandry
Copy link
Member

@tmandry tmandry commented Dec 27, 2023

... in preparation for diagnosing improperly nested .cfi regions.

See https://reviews.llvm.org/D155245


This cherry-pick of 7939ce3 fixes an issue when building compiler-builtins with clang from LLVM main. The check in the linked diff / commit d506aa4 rejects the assembly due to improperly nested CFI regions:

  running: env -u IPHONEOS_DEPLOYMENT_TARGET "/Volumes/Work/s/w/ir/x/w/cipd/bin/clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer" "--target=arm64-apple-darwin" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=arm64-apple-darwin" "--target=aarch64-apple-darwin" "--sysroot=/Volumes/Work/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk" "-mno-outline-atomics" "-I" "/Volumes/Work/s/w/ir/x/w/fuchsia-third_party-rust/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-fomit-frame-pointer" "-ffile-prefix-map=/Volumes/Work/s/w/ir/x/w/fuchsia-third_party-rust/src/llvm-project/compiler-rt=." "-DVISIBILITY_HIDDEN" "-o" "/Volumes/Work/s/w/ir/x/w/staging/build/fuchsia-build/x86_64-apple-darwin/stage2-std/aarch64-apple-darwin/release/build/compiler_builtins-d4c39d93f1fd5499/out/657ee1fe8a0b7177-lse_cas1_relax.o" "-c" "/Volumes/Work/s/w/ir/x/w/staging/build/fuchsia-build/x86_64-apple-darwin/stage2-std/aarch64-apple-darwin/release/build/compiler_builtins-d4c39d93f1fd5499/out/lse_cas1_relax.S"
  cargo:warning=/Volumes/Work/s/w/ir/x/w/fuchsia-third_party-rust/src/llvm-project/compiler-rt/lib/builtins/aarch64/lse.S:145:120: error: non-private labels cannot appear between .cfi_startproc / .cfi_endproc pairs
  cargo:warning= .text %% .balign 16 %% .globl __aarch64_cas1_relax %% %% .private_extern __aarch64_cas1_relax %% %% .cfi_startproc %% __aarch64_cas1_relax: %%
  cargo:warning=                                                                                                                       ^
  cargo:warning=/Volumes/Work/s/w/ir/x/w/fuchsia-third_party-rust/src/llvm-project/compiler-rt/lib/builtins/aarch64/lse.S:145:102: error: previous .cfi_startproc was here
  cargo:warning= .text %% .balign 16 %% .globl __aarch64_cas1_relax %% %% .private_extern __aarch64_cas1_relax %% %% .cfi_startproc %% __aarch64_cas1_relax: %%
  cargo:warning=                                                                                                     ^
  exit status: 1

... in preparation for diagnosing improperly nested .cfi regions.

See https://reviews.llvm.org/D155245
@nikic
Copy link

nikic commented Dec 27, 2023

Do I understand correctly that you are using clang from main, but not building rustc against main?

@tmandry
Copy link
Member Author

tmandry commented Dec 27, 2023

Yes, we update our clang every few weeks from main, but build Rust with its canonical LLVM pin for now.

@nikic nikic merged commit 8238831 into rust-lang:rustc/17.0-2023-12-14 Dec 28, 2023
@tmandry tmandry deleted the fix-improper-nested-cfi branch December 28, 2023 23:59
vext01 added a commit to vext01/llvm-project that referenced this pull request May 20, 2024
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.

3 participants