Skip to content

Orc global constructor order test fails on 32 bit ARM #95911

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

Closed
DavidSpickett opened this issue Jun 18, 2024 · 4 comments · Fixed by #97030
Closed

Orc global constructor order test fails on 32 bit ARM #95911

DavidSpickett opened this issue Jun 18, 2024 · 4 comments · Fixed by #97030

Comments

@DavidSpickett
Copy link
Collaborator

The test added by #95532 has exposed a pre-existing issue on Arm 32 bit.

https://lab.llvm.org/buildbot/#/builders/154/builds/170

The test expects to see each constructor print a string, but this is what we get:

$ /home/david.spickett/build-llvm-arm/bin/lli -jit-kind=orc /home/david.spickett/llvm-project/llvm/test/ExecutionEngine/Orc/global-ctor-order.ll
H1

H3

M2

1
2
3
4
5
6
7
8
9
10

12

14

16

We know it isn't because of the added stable sort because the output order changes when I remove it but the gaps remain:

$ /home/david.spickett/build-llvm-arm/bin/lli -jit-kind=orc /home/david.spickett/llvm-project/llvm/test/ExecutionEngine/Orc/global-ctor-order.ll
H3
H1

M2



1
2

16

14

12
5
10
9
3
8
7
6
4

This may be due to relocations to the strings for those constructors not being resolved. Potentially it is the same problem as #94994.

@llvmbot
Copy link
Member

llvmbot commented Jun 18, 2024

@llvm/issue-subscribers-orcjit

Author: David Spickett (DavidSpickett)

The test added by https://github.com//pull/95532 has exposed a pre-existing issue on Arm 32 bit.

https://lab.llvm.org/buildbot/#/builders/154/builds/170

The test expects to see each constructor print a string, but this is what we get:

$ /home/david.spickett/build-llvm-arm/bin/lli -jit-kind=orc /home/david.spickett/llvm-project/llvm/test/ExecutionEngine/Orc/global-ctor-order.ll
H1

H3

M2

1
2
3
4
5
6
7
8
9
10

12

14

16

We know it isn't because of the added stable sort because the output order changes when I remove it but the gaps remain:

$ /home/david.spickett/build-llvm-arm/bin/lli -jit-kind=orc /home/david.spickett/llvm-project/llvm/test/ExecutionEngine/Orc/global-ctor-order.ll
H3
H1

M2



1
2

16

14

12
5
10
9
3
8
7
6
4

This may be due to relocations to the strings for those constructors not being resolved. Potentially it is the same problem as #94994.

@llvmbot
Copy link
Member

llvmbot commented Jun 18, 2024

@llvm/issue-subscribers-backend-arm

Author: David Spickett (DavidSpickett)

The test added by https://github.com//pull/95532 has exposed a pre-existing issue on Arm 32 bit.

https://lab.llvm.org/buildbot/#/builders/154/builds/170

The test expects to see each constructor print a string, but this is what we get:

$ /home/david.spickett/build-llvm-arm/bin/lli -jit-kind=orc /home/david.spickett/llvm-project/llvm/test/ExecutionEngine/Orc/global-ctor-order.ll
H1

H3

M2

1
2
3
4
5
6
7
8
9
10

12

14

16

We know it isn't because of the added stable sort because the output order changes when I remove it but the gaps remain:

$ /home/david.spickett/build-llvm-arm/bin/lli -jit-kind=orc /home/david.spickett/llvm-project/llvm/test/ExecutionEngine/Orc/global-ctor-order.ll
H3
H1

M2



1
2

16

14

12
5
10
9
3
8
7
6
4

This may be due to relocations to the strings for those constructors not being resolved. Potentially it is the same problem as #94994.

@DavidSpickett
Copy link
Collaborator Author

Reland and disable the test for ARM: d97951e

@llvmbot
Copy link
Member

llvmbot commented Jun 29, 2024

@llvm/issue-subscribers-jitlink

Author: David Spickett (DavidSpickett)

The test added by https://github.com//pull/95532 has exposed a pre-existing issue on Arm 32 bit.

https://lab.llvm.org/buildbot/#/builders/154/builds/170

The test expects to see each constructor print a string, but this is what we get:

$ /home/david.spickett/build-llvm-arm/bin/lli -jit-kind=orc /home/david.spickett/llvm-project/llvm/test/ExecutionEngine/Orc/global-ctor-order.ll
H1

H3

M2

1
2
3
4
5
6
7
8
9
10

12

14

16

We know it isn't because of the added stable sort because the output order changes when I remove it but the gaps remain:

$ /home/david.spickett/build-llvm-arm/bin/lli -jit-kind=orc /home/david.spickett/llvm-project/llvm/test/ExecutionEngine/Orc/global-ctor-order.ll
H3
H1

M2



1
2

16

14

12
5
10
9
3
8
7
6
4

This may be due to relocations to the strings for those constructors not being resolved. Potentially it is the same problem as #94994.

lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this issue Jul 3, 2024
…#97030)

The ARM architecture uses the LSB bit for ARM/Thumb mode switch
flagging. This is true for alignments of 2 and 4 but in data
relocations the alignment is 1 allowing the LSB bit to be set.
Now only `ELF::STT_FUNC` typed symbols are used in the 
TargetFlag mechanism.

The test is a minimal example of the issue mentioned below.

Fixes llvm#95911 "Orc global constructor order test fails on 32
bit ARM".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants