<div dir="auto">The only tweak I’d propose is adding  <span style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre-wrap;color:rgb(36,41,46)">-Wl,-</span><span class="text-bold hx_keyword-hl rounded-1 d-inline-block" style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre-wrap;border-top-left-radius:6px!important;border-top-right-radius:6px!important;border-bottom-right-radius:6px!important;border-bottom-left-radius:6px!important;font-weight:600!important;display:inline-block!important;color:rgb(36,41,46)">headerpad</span><span style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre-wrap;color:rgb(36,41,46)">_max_install_names</span></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div style="border-color:rgb(0,0,0);color:rgb(0,0,0)" dir="auto"><div dir="auto" style="border-color:rgb(0,0,0)"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">index 426336e4536..0a72e6fbe49 100644</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">--- a/tools/winegcc/winegcc.c</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">+++ b/tools/winegcc/winegcc.c</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">@@ -492,6 +492,13 @@ static strarray *get_link_args( struct options *opts, const char *output_name )</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">             strarray_add( flags, opts->image_base );</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">         }</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">         if (opts->strip) strarray_add( flags, "-Wl,-x" );</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">+        if (opts->unix_lib)</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">+        {</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">+            strarray_add( flags, "-install_name" );</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">+            strarray_add( flags, strmake( "@rpath/%s.so", output_name ) );</span></div></div><div style="border-color:rgb(0,0,0);color:rgb(0,0,0)" dir="auto"><div dir="auto" style="border-color:rgb(255,255,255)"><font style="border-color:rgb(49,49,49);color:rgb(49,49,49)"><span style="word-spacing:1px;border-color:rgb(49,49,49)">+            strarray_add( flags, "-Wl,-headerpad_max_install_names</span></font><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">" );</span></div><div dir="auto" style="border-color:rgb(32,33,36)"></div></div><div style="border-color:rgb(0,0,0);color:rgb(0,0,0)" dir="auto"><div dir="auto" style="border-color:rgb(32,33,36)"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">+            strarray_add( flags, "-Wl,-rpath,@loader_path/" );</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">+        }</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">         strarray_addall( link_args, flags );</span><br style="color:rgb(212,212,213);word-spacing:1px"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)">         return link_args;</span></div><div dir="auto" style="border-color:rgb(32,33,36)"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)"><br></span></div><div dir="auto" style="border-color:rgb(32,33,36)"><span style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)"><br></span></div></div></div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 20, 2021 at 3:36 PM Huw Davies <<a href="mailto:huw@codeweavers.com">huw@codeweavers.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">On Fri, Aug 20, 2021 at 11:45:24AM -0400, Dean Greer wrote:<br>
> That’s strange as this should work maybe only dylibs do this correctly.. this<br>
> is Apple.<br>
> <br>
> Could you instead implement adding this in the manner I explain above instead<br>
> so I can be used in a more general way?, aka UNIX_LDFLAGS that by default add<br>
> this needed -rpath,@loader_path/ but also allows adding additional flags as<br>
> needed.<br>
<br>
I'm not sure what your issue is with using LDFLAGS - they do only affect<br>
unix libraries.  There shouldn't be an issue with passing an rpath in<br>
that.<br>
<br>
Huw.<br>
</blockquote></div></div>