This is an archive of the discontinued LLVM Phabricator instance.

[clang-repl] Fix dynamic library test to avoid cstdio and linker
ClosedPublic

Authored by argentite on Apr 22 2023, 6:51 AM.

Details

Summary

Some platforms do not have a working linker present. The goal is to
only test the loading of a shared library in clang-repl. A precompiled
library is used instead.

The cstdio header may also not be present. We only need printf.

Related discussion in D141824

Diff Detail

Event Timeline

argentite created this revision.Apr 22 2023, 6:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2023, 6:51 AM
argentite published this revision for review.Apr 22 2023, 7:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2023, 7:01 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
zhuhan0 accepted this revision.Apr 24 2023, 2:24 PM

LGTM. Thanks!

This revision is now accepted and ready to land.Apr 24 2023, 2:24 PM
sgraenitz added inline comments.Apr 25 2023, 1:59 AM
clang/test/Interpreter/dynamic-library.cpp
11

Should we wrap this in a extern "C" block? Otherwise, the shared library has a C++ interface, which is not stable. It won't matter in this simple case, but the test might become a pattern.

argentite updated this revision to Diff 516715.Apr 25 2023, 2:27 AM
argentite marked an inline comment as done.

extern "C" and enable PS4/5

sgraenitz accepted this revision.Apr 25 2023, 3:48 AM

Thanks. LGTM