Issue 88053
Summary macos profile runtime test failures due to new ld warning on overaligned sections
Labels new issue
Assignees
Reporter aeubanks
    With a new Apple `ld`, we're seeing these two tests fail on both x86-64 and arm64:

```
 Failed Tests (2):
 Profile-x86_64 :: ContinuousSyncMode/darwin-proof-of-concept.c
 Profile-x86_64 :: instrprof-darwin-exports.c
```

e.g.

```
 FAIL: Profile-x86_64 :: ContinuousSyncMode/darwin-proof-of-concept.c (71302 of 74416)
 ******************** TEST 'Profile-x86_64 :: ContinuousSyncMode/darwin-proof-of-concept.c' FAILED ********************
 Exit Code: 1
 
 Command Output (stderr):
 --
 RUN: at line 10: /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/./bin/clang -arch x86_64  -mmacosx-version-min=10.13 -isysroot /Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -mlinker-version=1053.12  -g -o /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-x86_64/ContinuousSyncMode/Output/darwin-proof-of-concept.c.tmp /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/profile/ContinuousSyncMode/darwin-proof-of-concept.c -Wl,-sectalign,__DATA,__pcnts,0x4000 -Wl,-sectalign,__DATA,__pdata,0x4000
 + /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/./bin/clang -arch x86_64 -mmacosx-version-min=10.13 -isysroot /Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -mlinker-version=1053.12 -g -o /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-x86_64/ContinuousSyncMode/Output/darwin-proof-of-concept.c.tmp /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/profile/ContinuousSyncMode/darwin-proof-of-concept.c -Wl,-sectalign,__DATA,__pcnts,0x4000 -Wl,-sectalign,__DATA,__pdata,0x4000
 ld: warning: reducing alignment of section __DATA,__pcnts from 0x4000 to 0x1000 because it exceeds segment maximum alignment
 ld: warning: reducing alignment of section __DATA,__pdata from 0x4000 to 0x1000 because it exceeds segment maximum alignment
 RUN: at line 15: /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-x86_64/ContinuousSyncMode/Output/darwin-proof-of-concept.c.tmp create /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-x86_64/ContinuousSyncMode/Output/darwin-proof-of-concept.c.tmp.tmpfile
 + /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-x86_64/ContinuousSyncMode/Output/darwin-proof-of-concept.c.tmp create /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-x86_64/ContinuousSyncMode/Output/darwin-proof-of-concept.c.tmp.tmpfile
 __pdata not ordered after __pcnts.
 
 --

 FAIL: Profile-x86_64 :: instrprof-darwin-exports.c (71383 of 74416)
 ******************** TEST 'Profile-x86_64 :: instrprof-darwin-exports.c' FAILED ********************
 Exit Code: 1
 
 Command Output (stdout):
 --
 ld: warning: reducing alignment of section __DATA,__llvm_prf_cnts from 0x4000 to 0x1000 because it exceeds segment maximum alignment
 ld: warning: reducing alignment of section __DATA,__llvm_prf_data from 0x4000 to 0x1000 because it exceeds segment maximum alignment
 ld: warning: reducing alignment of section __DATA,__llvm_prf_bits from 0x4000 to 0x1000 because it exceeds segment maximum alignment
 ld: warning: reducing alignment of section __DATA,__llvm_prf_cnts from 0x4000 to 0x1000 because it exceeds segment maximum alignment
 ld: warning: reducing alignment of section __DATA,__llvm_prf_data from 0x4000 to 0x1000 because it exceeds segment maximum alignment
 ld: warning: reducing alignment of section __DATA,__llvm_prf_bits from 0x4000 to 0x1000 because it exceeds segment maximum alignment
 
 --
```

I believe both these test failures are due to some page size/alignment changes.

clang tells ld to set alignment [here](https://github.com/llvm/llvm-project/blob/50a6738636d1b1dda0c5887cf0623ee084854272/clang/lib/Driver/ToolChains/Darwin.cpp#L1397)

@vedantk 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to