[Pacemaker] Proposing patch for ld --as-needed

Simon Horman horms at verge.net.au
Thu Jul 22 08:05:07 UTC 2010


> # This patch sets the build processs 'ld --as-needed' compliant
> #
> # First chunck corrects the linking order so that libpe_status is linked
> # after libpengine. This is needed because the linker evaluates statements
> # sequentially starting from the inner most lib and libpengine uses functions
> # that are defined in libpe_status.
> #
> # Second chunck explicitly adds CURSESLIBS dependency to libpe_status.
> # This is requested from the configure.ac upon ncurses detection so we
> # need to provide 'printw' or any linking with libpe_status will fail.

This looks good to me.

> --- pengine/Makefile.am
> +++ pengine/Makefile.am
> @@ -58,6 +58,7 @@
>  # -L$(top_builddir)/lib/pils -lpils -export-dynamic -module -avoid-version
>  libpengine_la_SOURCES	= pengine.c allocate.c utils.c constraints.c \
>  			native.c group.c clone.c master.c graph.c
> +libpengine_la_LIBADD    = $(top_builddir)/lib/pengine/libpe_status.la
> 
>  pengine_SOURCES	= main.c
>  pengine_LDADD	= $(COMMONLIBS)	$(top_builddir)/lib/cib/libcib.la
> --- lib/pengine/Makefile.am
> +++ lib/pengine/Makefile.am
> @@ -34,7 +34,7 @@
> 
>  libpe_status_la_LDFLAGS	= -version-info 2:0:0
>  libpe_status_la_SOURCES	=  $(rule_files) $(status_files)
> -libpe_status_la_LIBADD	= -llrm
> +libpe_status_la_LIBADD	= -llrm @CURSESLIBS@
> 
>  clean-generic:
>  	rm -f *.log *.debug *~






More information about the Pacemaker mailing list