util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libmount/buildsys: move SELINUX_LIBS to LDFLAGS
@ 2014-08-02 20:11 Andreas Henriksson
  2014-08-03 13:34 ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Henriksson @ 2014-08-02 20:11 UTC (permalink / raw)
  To: util-linux; +Cc: Andreas Henriksson

According to a bug report filed in the Debian bug tracking system
an unknown version of the package failed to cross-build because of
the -lfoo flags for SELinux being placed in LIBADD rather then LDFLAGS.
The build system still looks similar in this regard so it's possible
the problem still remains and hopefully this change should make things
more correct even if I still don't know if it solves the entire problem.

Reported-by: YunQiang Su <wzssyqa@gmail.com>
Addresses-Debian-Bug: #721431
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
 libmount/src/Makemodule.am | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libmount/src/Makemodule.am b/libmount/src/Makemodule.am
index 54ab51d..afe5cfa 100644
--- a/libmount/src/Makemodule.am
+++ b/libmount/src/Makemodule.am
@@ -30,7 +30,7 @@ libmount_la_SOURCES = \
 
 nodist_libmount_la_SOURCES = libmount/src/mountP.h
 
-libmount_la_LIBADD = libcommon.la libblkid.la $(SELINUX_LIBS)
+libmount_la_LIBADD = libcommon.la libblkid.la
 
 libmount_la_CFLAGS = \
 	$(SOLIB_CFLAGS) \
@@ -46,6 +46,7 @@ libmount_la_DEPENDENCIES = \
 
 libmount_la_LDFLAGS = \
 	$(SOLIB_LDFLAGS) \
+	$(SELINUX_LIBS) \
 	-Wl,--version-script=$(top_srcdir)/libmount/src/libmount.sym \
 	-version-info $(LIBMOUNT_VERSION_INFO)
 
-- 
2.0.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] libmount/buildsys: move SELINUX_LIBS to LDFLAGS
  2014-08-02 20:11 [PATCH] libmount/buildsys: move SELINUX_LIBS to LDFLAGS Andreas Henriksson
@ 2014-08-03 13:34 ` Mike Frysinger
  2014-08-03 20:23   ` Andreas Henriksson
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2014-08-03 13:34 UTC (permalink / raw)
  To: Andreas Henriksson; +Cc: util-linux

[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

On Sat 02 Aug 2014 22:11:01 Andreas Henriksson wrote:
> According to a bug report filed in the Debian bug tracking system
> an unknown version of the package failed to cross-build because of
> the -lfoo flags for SELinux being placed in LIBADD rather then LDFLAGS.
> The build system still looks similar in this regard so it's possible
> the problem still remains and hopefully this change should make things
> more correct even if I still don't know if it solves the entire problem.

please post the full details here.  linkage (like -lselinux) are not ldflags.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] libmount/buildsys: move SELINUX_LIBS to LDFLAGS
  2014-08-03 13:34 ` Mike Frysinger
@ 2014-08-03 20:23   ` Andreas Henriksson
  2014-08-04  7:40     ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Henriksson @ 2014-08-03 20:23 UTC (permalink / raw)
  To: Mike Frysinger, YunQiang Su; +Cc: util-linux

Hello Mike Frysinger!

On Sun, Aug 03, 2014 at 09:34:25AM -0400, Mike Frysinger wrote:
[...]
> please post the full details here. 

I have no more details then those found in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=721431

Maybe YunQiang Su can help out and provide some additional information
here....

> linkage (like -lselinux) are not ldflags.

Works for me, but likely I got LIBADD/LDFLAGS/LDADD wrong (again).

Regards,
Andreas Henriksson

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] libmount/buildsys: move SELINUX_LIBS to LDFLAGS
  2014-08-03 20:23   ` Andreas Henriksson
@ 2014-08-04  7:40     ` Mike Frysinger
  2014-08-04  9:49       ` Andreas Henriksson
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2014-08-04  7:40 UTC (permalink / raw)
  To: Andreas Henriksson; +Cc: YunQiang Su, util-linux

[-- Attachment #1: Type: text/plain, Size: 1640 bytes --]

On Sun 03 Aug 2014 22:23:09 Andreas Henriksson wrote:
> Hello Mike Frysinger!
> 
> On Sun, Aug 03, 2014 at 09:34:25AM -0400, Mike Frysinger wrote:
> [...]
> 
> > please post the full details here.
> 
> I have no more details then those found in
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=721431

well, that thing has barely 6 lines (and even then requires some esoteric 
knowledge from the reader), so you could have just pasted it here :p
------
In libmount/src/Makefile.am

libmount_la_LIBADD = $(ul_libblkid_la) $(SELINUX_LIBS)

libmount_la_DEPENDENCIES = $(libmount_la_LIBADD) libmount.sym libmount.h.in

While $(SELINUX_LIBS) is '-lselinux -lsepol'

They are not files or makefile tag, so cannot build-depends on.
------

the problem is that libmount_la_DEPENDENCIES shows up in the Makefile like:
libmount.la: ... $(libmount_la_DEPENDENCIES) ...

which means make evaluates it like so:
libmount.la: ... -lselinux -lsepol ...

which triggers the builtin library path searching of make itself:
https://www.gnu.org/software/make/manual/make.html#Libraries_002fSearch

which means it'll rewrite -lselinux into /usr/lib/libselinux.so (if it can 
find it) which is bad for multilib and cross-compiling.

the easy answer is to not add LIBADD to DEPENDENCIES.  which has been done 
already -- see dbf7043ea1d090d283cfd36280bb14189d8e35b1.

> > linkage (like -lselinux) are not ldflags.
> 
> Works for me, but likely I got LIBADD/LDFLAGS/LDADD wrong (again).

it often works in the common case, but the edges break down.  we know putting 
-lflags into LDFLAGS is such a scenario :).
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] libmount/buildsys: move SELINUX_LIBS to LDFLAGS
  2014-08-04  7:40     ` Mike Frysinger
@ 2014-08-04  9:49       ` Andreas Henriksson
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Henriksson @ 2014-08-04  9:49 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: YunQiang Su, util-linux

Version: 2.25-1

Hello Mike!

Thank you very much for the followup and for identifying the relevant
commit for me!
(BCCing the debian bug tracking system to close the bug report...)

On Mon, Aug 04, 2014 at 03:40:56AM -0400, Mike Frysinger wrote:
[...]
> the problem is that libmount_la_DEPENDENCIES shows up in the Makefile like:
> libmount.la: ... $(libmount_la_DEPENDENCIES) ...
> 
> which means make evaluates it like so:
> libmount.la: ... -lselinux -lsepol ...
> 
> which triggers the builtin library path searching of make itself:
> https://www.gnu.org/software/make/manual/make.html#Libraries_002fSearch
> 
> which means it'll rewrite -lselinux into /usr/lib/libselinux.so (if it can 
> find it) which is bad for multilib and cross-compiling.
> 
> the easy answer is to not add LIBADD to DEPENDENCIES.  which has been done 
> already -- see dbf7043ea1d090d283cfd36280bb14189d8e35b1.
> 
[...]


Regards,
Andreas Henriksson

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-04  9:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-02 20:11 [PATCH] libmount/buildsys: move SELINUX_LIBS to LDFLAGS Andreas Henriksson
2014-08-03 13:34 ` Mike Frysinger
2014-08-03 20:23   ` Andreas Henriksson
2014-08-04  7:40     ` Mike Frysinger
2014-08-04  9:49       ` Andreas Henriksson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).