Skip to content

[AArch64] Fix relative vtable PLT/GOTPCREL specifiers to use MCSpecifierExpr - #184393

Merged
MaskRay merged 1 commit into
llvm:mainfrom
MaskRay:users/MaskRay/a64-gotpcrel-1
Mar 3, 2026
Merged

MaskRay merged 1 commit into
llvm:mainfrom
MaskRay:users/MaskRay/a64-gotpcrel-1

Conversation

@MaskRay

@MaskRay MaskRay commented Mar 3, 2026

Copy link
Copy Markdown
Member

PR #155776 changed S_PLT/S_GOTPCREL printing to %pltpcrel(x)/%gotpcrel(x)
syntax via MCSpecifierExpr, but lowerSymbolDifference and
getIndirectSymViaGOTPCRel still created MCSymbolRefExpr with these
specifiers, which prints via the @-specifier table as @PLT/@GOTPCREL,
leading to incorrect relocation types.

Fixes: bed8997
(AArch64: Replace @plt/%gotpcrel in data directives with %pltpcrel %gotpcrel (#155776))

Add llvm/test/CodeGen/AArch64/dso_local_equivalent.ll

…ierExpr

PR llvm#155776 changed S_PLT/S_GOTPCREL printing to %pltpcrel(x)/%gotpcrel(x)
syntax via MCSpecifierExpr, but lowerSymbolDifference and
getIndirectSymViaGOTPCRel still created MCSymbolRefExpr with these
specifiers, which prints via the @-specifier table as @PLT/@GOTPCREL,
leading to incorrect relocation types.

Fixes: bed8997
(AArch64: Replace @plt/%gotpcrel in data directives with %pltpcrel %gotpcrel (llvm#155776))

Add llvm/test/CodeGen/AArch64/dso_local_equivalent.ll
@MaskRay MaskRay added the skip-precommit-approval PR for CI feedback, not intended for review label Mar 3, 2026
@MaskRay
MaskRay enabled auto-merge (squash) March 3, 2026 17:43
@MaskRay
MaskRay merged commit a34d56d into llvm:main Mar 3, 2026
12 of 13 checks passed
@llvm-ci

llvm-ci commented Mar 3, 2026

Copy link
Copy Markdown

LLVM Buildbot has detected a new failure on builder llvm-clang-aarch64-darwin running on doug-worker-4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/37676

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang-Unit :: ./AllClangUnitTests/19/50' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/tools/clang/unittests/./AllClangUnitTests-Clang-Unit-40863-19-50.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=50 GTEST_SHARD_INDEX=19 /Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/tools/clang/unittests/./AllClangUnitTests
--

Note: This is test shard 20 of 50.
[==========] Running 511 tests from 108 test suites.
[----------] Global test environment set-up.
[----------] 1 test from MinimizeSourceToDependencyDirectivesTest
[ RUN      ] MinimizeSourceToDependencyDirectivesTest.DefineNoWhitespace
[       OK ] MinimizeSourceToDependencyDirectivesTest.DefineNoWhitespace (0 ms)
[----------] 1 test from MinimizeSourceToDependencyDirectivesTest (0 ms total)

[----------] 1 test from HeaderSearchTest
[ RUN      ] HeaderSearchTest.Dots
[       OK ] HeaderSearchTest.Dots (0 ms)
[----------] 1 test from HeaderSearchTest (0 ms total)

[----------] 1 test from ModuleDeclStateTest
[ RUN      ] ModuleDeclStateTest.ModuleWithGMF
[       OK ] ModuleDeclStateTest.ModuleWithGMF (0 ms)
[----------] 1 test from ModuleDeclStateTest (0 ms total)

[----------] 1 test from ParseHLSLRootSignatureTest
[ RUN      ] ParseHLSLRootSignatureTest.InvalidRepeatedMandatoryRCParameterTest
[       OK ] ParseHLSLRootSignatureTest.InvalidRepeatedMandatoryRCParameterTest (0 ms)
[----------] 1 test from ParseHLSLRootSignatureTest (0 ms total)

[----------] 1 test from ToolChainTest
[ RUN      ] ToolChainTest.GetTargetAndMode
/Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/clang/unittests/Driver/ToolChainTest.cpp:447: Skipped


[  SKIPPED ] ToolChainTest.GetTargetAndMode (0 ms)
[----------] 1 test from ToolChainTest (0 ms total)

[----------] 1 test from DependencyScanningFilesystem
[ RUN      ] DependencyScanningFilesystem.OpenFileAndGetBufferRepeatedly
[       OK ] DependencyScanningFilesystem.OpenFileAndGetBufferRepeatedly (0 ms)
[----------] 1 test from DependencyScanningFilesystem (0 ms total)

[----------] 2 tests from ExprMutationAnalyzerTest
[ RUN      ] ExprMutationAnalyzerTest.ByNonConstRefArgument
input.cc:1:23: warning: function 'f()::A::A' has internal linkage but is not defined [-Wundefined-internal]
    1 | void f() { struct A { A(int&); }; int x; A y(x); }
      |                       ^
input.cc:1:44: note: used here
    1 | void f() { struct A { A(int&); }; int x; A y(x); }
      |                                            ^
...

@MaskRay
MaskRay deleted the users/MaskRay/a64-gotpcrel-1 branch March 3, 2026 18:39
@gulfemsavrun

Copy link
Copy Markdown
Contributor

Thanks for the fix, but we started seeing another issue.

[88043/142981](63) ASM obj/src/bringup/lib/restricted-machine/restricted-machine.arm64.S.o
FAILED: [code=1] obj/src/bringup/lib/restricted-machine/restricted-machine.arm64.S.o 
../../prebuilt/third_party/clang/custom/bin/clang -MD -MF obj/src/bringup/lib/restricted-machine/restricted-machine.arm64.S.o.d -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -DNDEBUG=1 -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -I../.. -Igen -I../../src/bringup/lib/restricted-machine/include -I../../sdk -Igen/sdk -I../../sdk/lib/fit-promise/include -I../../sdk/lib/fit/include -I../../sdk/lib/stdcompat/include -I../../zircon/system/ulib/zx/include -I../../src/zircon/lib/zircon/include -I../../sdk/lib/syslog/cpp/include -I../../sdk/lib/async-loop/include -I../../sdk/lib/async/include -Ifidling/gen/sdk/fidl/fuchsia.logger/fuchsia.logger/cpp -Ifidling/gen/sdk/fidl/fuchsia.diagnostics/fuchsia.diagnostics/cpp -Ifidling/gen/sdk/fidl/fuchsia.diagnostics.types/fuchsia.diagnostics.types/cpp -I../../sdk/lib/fidl/cpp/include -I../../sdk/lib/fidl/cpp/wire/include -I../../sdk/lib/fidl_base/include -I../../sdk/lib/fidl/include -I../../zircon/system/ulib/sync/include -Ifidling/gen/sdk/fidl/fuchsia.mem/fuchsia.mem/cpp -I../../src/lib/elfldltl/include -I../../zircon/system/ulib/fbl/include -I../../zircon/system/ulib/region-alloc/include -Ifidling/gen/sdk/fidl/fuchsia.ldsvc/fuchsia.ldsvc/cpp -I../../sdk/lib/fdio/include -I../../src/lib/symbolizer-markup/include -I../../zircon/kernel/lib/arch/arm64/include -I../../zircon/system/ulib/hwreg/include -I../../zircon/system/ulib/mmio-ptr/include -Igen/zircon/kernel/lib/arch/gen-arm64-feature-asm.include -Igen/zircon/kernel/lib/arch/gen-arm64-system-asm.include -Igen/zircon/kernel/lib/arch/gen-riscv64-system-asm.include -Igen/zircon/kernel/lib/arch/gen-x86-msr-asm.include -Igen/zircon/kernel/lib/arch/gen-x86-cpuid-asm.include -I../../zircon/kernel/lib/arch/include -I../../zircon/system/ulib/pretty/include -I../../zircon/system/ulib/zircon-internal/include -fcolor-diagnostics -fcrash-diagnostics-dir=clang-crashreports -fcrash-diagnostics=all -gen-reproducer=error -fstack-size-section -ffp-contract=off --sysroot=gen/zircon/public/sysroot --target=aarch64-unknown-fuchsia -ffuchsia-api-level=4293918720 -march=armv8-a+simd+crc+crypto -mtune=generic -ffile-compilation-dir=. -no-canonical-prefixes -flto -g3 -grecord-gcc-switches -gdwarf-5 -gz=zstd -fvisibility=hidden -Wa,--fatal-warnings -c ../../src/bringup/lib/restricted-machine/arm64.S -o obj/src/bringup/lib/restricted-machine/restricted-machine.arm64.S.o
../../src/bringup/lib/restricted-machine/arm64.S:123:26: error: invalid specifier '@PLT'
  bl zx_restricted_enter@PLT

https://luci-milo.appspot.com/ui/p/fuchsia/builders/global.ci/clang_toolchain.ci.core.arm64-debug/b8688325917586751777/overview

This is the link to the arm64.S file.
https://cs.opensource.google/fuchsia/fuchsia/+/main:src/bringup/lib/restricted-machine/arm64.S;l=123;drc=f9c9426b0c61d9ab6efef306ed1ad35aa5ab73f8

gulfemsavrun added a commit to gulfemsavrun/llvm-project that referenced this pull request Mar 3, 2026
…MCSpecifierExpr (llvm#184393)"

This reverts commit a34d56d.

Revert "AArch64: Replace @plt/%gotpcrel in data directives with %pltpcrel %gotpcrel (llvm#155776)"

This reverts commit bed8997.
@gulfemsavrun

Copy link
Copy Markdown
Contributor

@gulfemsavrun

Copy link
Copy Markdown
Contributor

We’ve confirmed that the issue is on our end, and we need to fix how we're using the @plt suffix in our code.

sahas3 pushed a commit to sahas3/llvm-project that referenced this pull request Mar 4, 2026
…ierExpr (llvm#184393)

PR llvm#155776 changed S_PLT/S_GOTPCREL printing to
%pltpcrel(x)/%gotpcrel(x)
syntax via MCSpecifierExpr, but lowerSymbolDifference and
getIndirectSymViaGOTPCRel still created MCSymbolRefExpr with these
specifiers, which prints via the @-specifier table as @PLT/@GOTPCREL,
leading to incorrect relocation types.

Fixes: bed8997
(AArch64: Replace @plt/%gotpcrel in data directives with %pltpcrel
%gotpcrel (llvm#155776))

Add llvm/test/CodeGen/AArch64/dso_local_equivalent.ll
sujianIBM pushed a commit to sujianIBM/llvm-project that referenced this pull request Mar 5, 2026
…ierExpr (llvm#184393)

PR llvm#155776 changed S_PLT/S_GOTPCREL printing to
%pltpcrel(x)/%gotpcrel(x)
syntax via MCSpecifierExpr, but lowerSymbolDifference and
getIndirectSymViaGOTPCRel still created MCSymbolRefExpr with these
specifiers, which prints via the @-specifier table as @PLT/@GOTPCREL,
leading to incorrect relocation types.

Fixes: bed8997
(AArch64: Replace @plt/%gotpcrel in data directives with %pltpcrel
%gotpcrel (llvm#155776))

Add llvm/test/CodeGen/AArch64/dso_local_equivalent.ll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:AArch64 skip-precommit-approval PR for CI feedback, not intended for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants