[Ur] -static not linking in some libraries

Adam Chlipala adamc at csail.mit.edu
Tue Mar 19 19:12:22 EDT 2013


On 03/18/2013 07:23 PM, Daniel Patterson wrote:
> The gcc command that urweb used was:
>
> gcc -Werror  -pthread   /usr/local/lib/liburweb_cgi.a
> /usr/local/lib/liburweb.a /tmp/webapp.o -lm -lcrypto -lssl  -o
> /path/to/binary.exe -g
>
>
> And what I needed to get it to be linked statically is:
>
>   gcc -static -Werror  -pthread   /usr/local/lib/liburweb_cgi.a
> /usr/local/lib/liburweb.a /tmp/webapp.o -lm -lcrypto -lssl  -ldl -lz
> -o /path/to/binary.exe -g
>    

OK, I've pushed a patch that should choose this command line when the 
'-static' flag is passed to 'urweb'.  Does it work?

I'm a little nervous about my change, which hardcodes "-ldl -lz".  I 
hope all platforms' OpenSSL libraries have the same dependencies!  The 
Autoconf macro for OpenSSL that I pulled from somewhere doesn't seem to 
be setting environment variables that I could use to do this "right."



More information about the Ur mailing list