<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Aug 10, 2024, 14:39 Alan Modra <<a href="mailto:amodra@gmail.com">amodra@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, Aug 10, 2024 at 01:45:57PM +0530, Navin P wrote:<br>
> Hi,<br>
>    I ran multiple instances of ar during a parallel build and they<br>
> were updating different object files using ar rv sometimes the same<br>
> object file again.<br>
> <br>
> When i run make -j1 i find all the object files  libx.a but when i do<br>
> make -j8 i find some missing object files inside libx.a.<br>
> <br>
> Then i looked at ar.c and found that there is no synchronization<br>
> between 2 instances of ar on same library. Am i missing something?<br>
> <br>
> What tool can i use instead of ar for such scenarios?<br>
<br>
This is really a "make" question.  See<br>
<a href="https://www.gnu.org/software/make/manual/html_node/Archive-Pitfalls.html" rel="noreferrer noreferrer" target="_blank">https://www.gnu.org/software/make/manual/html_node/Archive-Pitfalls.html</a></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Thanks Alan. I can't update the makefile in the coming days because it is generated and lot of bash scripts are used. Hence was thinking of a solution based on ar . I just saw a libtool answer on stackoverflow but not sure if it suffers from the same problem.</div><div dir="auto"><br></div><div dir="auto">Any more ideas are welcome.</div><div dir="auto"><br></div><div dir="auto">I'll try asking in the gnu make list for ideas.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
</blockquote></div></div></div>