[PATCH] D100651: [AIX] Support of Big archive (read)
Guesnet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 23 02:18:12 PDT 2021
EGuesnet added a comment.
First, sorry for the noise, I do not master arc yet.
I have updated the test file according comments.
> Looks like the Windows pre-merge check is failing: https://reviews.llvm.org/harbormaster/unit/view/554528/. I can reproduce locally with ninja check-llvm-object. It looks like the archive is empty? Maybe try regenerating it and uploading the patch again.
I have updated it correctly. Thanks.
> While building this, there's a warning about an unhandled switch:
It occurs on ArchiveWriter.cpp. I implement a way to write Big Archive. If you think it is better, I can add come code to remove warning, but my goal is to implement read and write for Big Archive, so it well be corrected in a future commit / PR.
> There doesn't seem to be as much testing as I'd expect given the amount of new code.
Read archive has list (t), extract (x) and print (p) operation. x and p are the same code behind. I test t and p. What do you want to add?
> Using a prebuilt binary should generally be avoided. You should create the archive at test run time, by using llvm-ar or some other tool (e.g. expanding yaml2obj to support this file format).
I agree it should be avoided. Unfortunately, we cannot create the archive at run time, as the write operation is not implemented yet (I work on it). Moreover, yaml2obj has not be ported on AIX, or XCOFF format. In future, when write operation will be implement, it should be delete.
> I'm not a fan of the complication of the existing archive header code by converting it into a virtual hierarchy. That being said, I haven't looked at the rest of the code properly to give any thought as to whether there's a better approach.
We must deal with two struct with different size (ArMemHd). I have not found another clean way to deal with. Moreover, Big Archive are quite a lot different than other archive. Terminator is cosmetic, Fix Header size is different than Object Header, way to deal with object name is totally different and so on...
> Finally, what's the use-case? Why do you need this functionality?
I want to port Rust on AIX. Rust needs archive and it uses llvm library to deal with it. It is not possible (or really hard) to use an external tool, like system ar. So, I must implement read and write support of Big Archive (AIX archive). It is the first part: read Big archive.
As far as I know, it will also be useful to port Clang on AIX, as it will permits to port the `CreateExportLists` tool. This tool is used to export symbol, a required step to produce correctly binaries on AIX.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100651/new/
https://reviews.llvm.org/D100651
More information about the llvm-commits
mailing list