This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Don't use __libc_stack_end on ARM
ClosedPublic

Authored by iii on Apr 3 2020, 8:02 AM.

Details

Summary

Commit b684c1a50f70 ("Add a Symbolizer::GetEnvP() method that allows
symbolizer implementations to customise the environment of the
symbolizer binary.") exposed a latent ARM issue, and that broke

http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-full-sh

This coincided with breakage caused by my commit 5f5fb56c68e4
("[compiler-rt] Intercept the uname() function"), so I had to
investigate.

The issue is that GetArgsAndEnv does not work on ARM: there glibc's
_start overwrites argc value stored at __libc_start_end, breaking the
existing argv/envp parsing logic.

Fix by inferring argc from argv.

Diff Detail

Event Timeline

iii created this revision.Apr 3 2020, 8:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2020, 8:02 AM
Herald added subscribers: Restricted Project, danielkiss, kristof.beyls, dberris. · View Herald Transcript
eugenis accepted this revision.Apr 3 2020, 4:43 PM

LGTM

This revision is now accepted and ready to land.Apr 3 2020, 4:43 PM
iii updated this revision to Diff 255082.Apr 4 2020, 1:56 PM

Applied the formatting fix, got rid of bogus D76358 dependency.

iii edited the summary of this revision. (Show Details)Apr 4 2020, 1:57 PM
This revision was automatically updated to reflect the committed changes.