iOS Build Environment Help Center

llvm-ar.exe permission denied error

append delete Graeme Love

Windows 10
Builder 3.41
iOS SDK 15.0

I'm trying to integrate the toolchain into our pre-existing build set up which is based around https://ninja-build.org/, and I'm hitting issues when trying to create a library archive file.

Initially I tried using ar.exe to create the library but quickly hit an error with the command line length being too long. Unfortunately it doesn't appear that ar.exe supports response files.

Next I tried using llvm-ar.exe as that does support response files. Unfortunately this generates a "permission denied" error. A temporary file is generated in the output directory but no final archive. I suspect that the issue is related to https://groups.google.com/g/llvm-dev/c/2xlT2fbGpd0.

Would it be possible to get a fix for this?

Thanks!

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello Graeme,

There's already an undocumented feature in the standard archiver that I added some time ago. If you pass a command-line option beginning with '@' it is treated like a names file. E.g:

% ar.exe call example
ar.exe qsv mylib.a @path\to\objlist.txt
%

As for fixing the problem in the LLVM version, I'll look at that. The LLVM devs seem to push towards dropping Win7 support, that would be a shame if they eventually did.

:: @Pierre-Marie Baty added on 15 Dec ’21 · 14:56

Addendum: that @ trick is valid for some options of ar only (essentially the ones that create archives). If you need it elsewhere please say so.

append delete #2. Graeme Love

Cool, that seems to work! FYI I had originally been trying to run `ar rc mylib.a @mylip.rsp`, as that's the command line we specify when running on OSX, but that complained about not liking the response file.

Thanks,
Graeme

append delete #3. Pierre-Marie Baty

Glad to hear your problem is solved.

Happy linking !

:: @Pierre-Marie Baty added on 21 Dec ’21 · 17:30

Also, about llvm-ar, I have applied the fix in my codebase. The next version will have it.

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty