[erlang-bugs] Patch to build with --as-needed in LDFLAGS

Sverker Eriksson <>
Mon May 5 16:31:53 CEST 2008


Christian Faulhammer wrote:
> Hi,
>
> as I wrote some weeks ago, Erlang is badly broken if a system is built
> with --as-neede in LDFLAGS.  Attached patch corrects this.
> --- erts/configure.in.orig	2008-04-24 23:16:09.000000000 +0400
> +++ erts/configure.in	2008-04-24 23:17:05.000000000 +0400
> @@ -2874,8 +2874,10 @@
>  				else
>  					saveCFLAGS="$CFLAGS"
>   					saveLDFLAGS="$LDFLAGS"
> +					saveLIBS="$LIBS"
>   					CFLAGS="$CFLAGS $SSL_INCLUDE"
> - 					LDFLAGS="$LDFLAGS -L$SSL_LIBDIR -lcrypto"
> + 					LDFLAGS="$LDFLAGS -L$SSL_LIBDIR"
> +					LIBS="-lcrypto"
>   					AC_TRY_LINK([
>  					#include <stdio.h>
>   					#include <openssl/hmac.h>],
> @@ -2887,6 +2889,7 @@
>   					[ssl_linkable=no])
>   					CFLAGS="$saveCFLAGS"
>   					LDFLAGS="$saveLDFLAGS"
> +					LIBS="$saveLIBS"
>  				fi
>   			fi

I've incorporated this patch. Planned to be released in R12B-3.
Seems like the right way to do it anyway, regardless of --as-needed or 
any other linker flags.

/Sverker, Erlang/OTP, Ericsson




More information about the erlang-bugs mailing list