This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Update struct_kernel_stat_sz for mips32 and mipsn32
ClosedPublic

Authored by wzssyqa on Oct 9 2022, 10:22 PM.

Details

Summary

On mips32 _LARGEFILE_SOURCE and _FILE_OFFSET_BITS == 64 is used (compiler-rt/cmake/base-config-ix.cmake),
thus the correct struct_kernel_stat_sz should be 160 instead of 144.

This value is also updated for N32, since we will use
_LARGEFILE_SOURCE and _FILE_OFFSET_BITS == 64 in future.

Fix https://github.com/llvm/llvm-project/issues/55499

Diff Detail

Event Timeline

wzssyqa created this revision.Oct 9 2022, 10:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2022, 10:22 PM
Herald added a subscriber: Enna1. · View Herald Transcript
wzssyqa requested review of this revision.Oct 9 2022, 10:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2022, 10:22 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
wzssyqa updated this revision to Diff 466496.Oct 10 2022, 7:33 AM
sylvestre.ledru edited the summary of this revision. (Show Details)Oct 22 2022, 11:24 AM

@wzssyqa https://github.com/llvm/llvm-project/issues/55499#issuecomment-1128802462 links to a gcc change that seems to fix the same issue.

Yes, you are correct. We can hardcode it, since we always build it with

_FILE_OFFSET_BITS=64

Sure. Build machine is working ....

MaskRay requested changes to this revision.Oct 24 2022, 10:44 PM
This revision now requires changes to proceed.Oct 24 2022, 10:44 PM
wzssyqa updated this revision to Diff 470562.Oct 25 2022, 10:54 AM
wzssyqa retitled this revision from compiler_rt: sanitizer, disable check on 32bit env with largefile support to compiler_rt: update struct_kernel_stat_sz for mips32 and mipsn32.
wzssyqa edited the summary of this revision. (Show Details)

Is _FILE_OFFSET_BITS == 32 supported? Does this change drop support for any configuration?

Is your description updated?

The link should be changed to https://github.com/llvm/llvm-project/issues/55499

Is _FILE_OFFSET_BITS == 32 supported? Does this change drop support for any configuration?

With this change _FILE_OFFSET_BITS == 32 is not supported anymore for mips32 and mipsn32.
I don't think that we should support it, since 2019

https://github.com/llvm/llvm-project/commit/7684d05d95b9369fa0454b525093ed04ee91b1e1

wzssyqa edited the summary of this revision. (Show Details)Oct 25 2022, 5:55 PM

Is your description updated?

The link should be changed to https://github.com/llvm/llvm-project/issues/55499

updated.

MaskRay accepted this revision.Oct 25 2022, 6:57 PM

LGTM.

This revision is now accepted and ready to land.Oct 25 2022, 6:57 PM
MaskRay edited the summary of this revision. (Show Details)Oct 25 2022, 6:58 PM
MaskRay retitled this revision from compiler_rt: update struct_kernel_stat_sz for mips32 and mipsn32 to [sanitizer] Update struct_kernel_stat_sz for mips32 and mipsn32.
This revision was automatically updated to reflect the committed changes.