This is an archive of the discontinued LLVM Phabricator instance.

Avoid ar_to_bc.sh script in symbolizer build; add -ignore-non-bitcode flag to llvm-link
ClosedPublic

Authored by MatzeB on Jun 28 2022, 7:02 AM.

Details

Summary

Remove the ar_to_bc.sh helper script in the compiler-rt symbolizer
build. Instead use llvm-link directly as D81109 introduced the
capability to read archives. I just needed to add a new flag
-ignore-non-bitcode to avoid llvm-link aborting when it found a
non-bitcode file in the archive.

Removing ar_to_bc.sh avoids build problems I had with inconsistent output between different versions of the file utility.

Diff Detail

Event Timeline

MatzeB created this revision.Jun 28 2022, 7:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2022, 7:02 AM
MatzeB requested review of this revision.Jun 28 2022, 7:02 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 28 2022, 7:02 AM
MatzeB updated this revision to Diff 440616.Jun 28 2022, 7:16 AM

Do we need a test for llvm-link?

Do we need a test for llvm-link?

I guess. So much trouble to keep these strange build scripts working...

MatzeB updated this revision to Diff 440663.Jun 28 2022, 9:44 AM

Added test for new llvm-link option.

vitalybuka accepted this revision.Jun 28 2022, 9:56 AM

Do we need a test for llvm-link?

I guess. So much trouble to keep these strange build scripts working...

It's not clear from description that it's done to fix those scripts.

Scripts probably can be converted into CMake, which will simplify reproducing build errors, but i guess a step like this will be needed anyway.

This revision is now accepted and ready to land.Jun 28 2022, 9:56 AM
MatzeB edited the summary of this revision. (Show Details)Jun 28 2022, 10:10 AM
MaskRay accepted this revision.EditedJun 28 2022, 10:10 AM

build_symbolizer.sh is used by our internal Bazel build system. (It will be needed when sb contributes utils/bazel/llvm-project-overlay/compiler-rt) In llvm-project it seems not referenced. Curious how you noticed this script...

MatzeB added a subscriber: sugak.EditedJun 28 2022, 10:11 AM

It's not clear from description that it's done to fix those scripts.

I originally added a note to D126728. I added a sentence to the summary now.

build_symbolizer.sh is used by our internal Bazel build system. In llvm-project it seems not referenced. Curious how you noticed this script...

Our internal build system is somehow using it too... CC @sugak

Judging from reaction from folks to older diffs, I have a feeling the script may also be running within apple internal builds...

Curious how you noticed this script...

I stumbled on this while exploring the compiler-rt codebase. We've being using it for for over 5 years now! This way we didn't have to teach people how to switch from add2line to llvm-symbolizer and didn't need to deploy llvm-symbolizer anywhere.

This revision was landed with ongoing or failed builds.Jun 28 2022, 2:50 PM
This revision was automatically updated to reflect the committed changes.