[PATCH] lib: use proper linking method to avoid parallel build issue

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] lib: use proper linking method to avoid parallel build issue

Thomas Petazzoni
Using <foo>_LDFLAGS = -l<library> is correct when <library> is an
external library. However, when it is built by the same package, and
especially in the same directory, this is wrong and can cause parallel
build issues. In lib/Makefile.am, there was:

libirrecord_la_LDFLAGS      = -llirc

But the liblirc library is built in the same directory. Or, due to the
using of <foo>_LDFLAGS, make is not aware of the build dependency
between libirrecord and liblirc.

To solve this, <foo>_LIBADD should be used instead, as follows:

libirrecord_la_LIBADD       = liblirc.la

This fixes parallel build issues seen by automated build tests
conducted by the Buildroot project, such as:

  http://autobuild.buildroot.org/results/eb4/eb47d57de8182d25b1dacbf0ac3726ed20063d04/build-end.log

Signed-off-by: Thomas Petazzoni <[hidden email]>
---
 lib/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Makefile.am b/lib/Makefile.am
index ce5c94c..8780f88 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -29,7 +29,7 @@ liblirc_la_SOURCES          = config_file.c \
                               transmit.c \
                               util.c
 
-libirrecord_la_LDFLAGS      = -llirc
+libirrecord_la_LIBADD       = liblirc.la
 libirrecord_la_SOURCES      = irrecord.c
 
 liblirc_client_la_LDFLAGS   = -version-info 4:0:4
--
2.7.4


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] lib: use proper linking method to avoid parallel build issue

Alec Leamas


On 25/05/16 16:34, Thomas Petazzoni wrote:
> Using <foo>_LDFLAGS = -l<library> is correct when <library> is an
> external library. However, when it is built by the same package, and
> especially in the same directory, this is wrong and can cause parallel
> build issues. In lib/Makefile.am, there was:
>
[cut ]


Thanks for patch! Applied to master and release-0_9_4 branch.

Cheers!

-alec

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j