Patchwork Help with redundant RPATH /usr/lib

login
register
mail settings
Submitter Lewis, Nick
Date April 23, 2013, 11:10 a.m.
Message ID <AAE0766F5AF36B46BAB7E0EFB927320630E4A540BF@GBTWK10E001.Technology.local>
Download mbox | patch
Permalink /patch/48687/
State Not Applicable
Delegated to: Otavio Salvador
Headers show

Comments

Lewis, Nick - April 23, 2013, 11:10 a.m.
>If that isn't the reason, its likely you're doing something custom to the linking command in configure.ac or Makefile.am and breaking it.

Richard

I have added a patch to the recipe that appears to fix the problem. Is this a reasonable approach to the issue?

$ cat sources/meta-nick/recipes-nick/xar/xar-1.5.2/xar-rpath.patch


--
Nick

The details of this company are as follows:
G4S Technology Limited, Registered Office: Challenge House, International Drive, Tewkesbury, Gloucestershire GL20 8UQ, Registered in England No. 2382338.

This communication may contain information which is confidential, personal and/or privileged.

It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s), please note that any distribution, forwarding, copying or use of this communication or the information in it is strictly prohibited.

Any personal views expressed in this e-mail are those of the individual sender and the company does not endorse or accept responsibility for them.

Prior to taking any action based upon this e-mail message, you should seek appropriate confirmation of its authenticity.

This e-mail has been scanned for all viruses by MessageLabs.
Richard Purdie - April 23, 2013, 11:46 a.m.
On Tue, 2013-04-23 at 12:10 +0100, Lewis, Nick wrote:
> >If that isn't the reason, its likely you're doing something custom to the linking command in configure.ac or Makefile.am and breaking it.
> 
> Richard
> 
> I have added a patch to the recipe that appears to fix the problem. Is this a reasonable approach to the issue?
> 
> $ cat sources/meta-nick/recipes-nick/xar/xar-1.5.2/xar-rpath.patch
> --- a/src/Makefile.inc.in       2013-04-17 18:03:12.704735379 -0700
> +++ b/src/Makefile.inc.in       2013-04-17 17:52:41.684668367 -0700
> @@ -54,7 +54,11 @@
>  @objroot@src/i% : @objroot@src/%.o $(LIBXAR)
>         @mkdir -p $(@D)
>  ifneq ($(words "" @RPATH@), 1)
> + ifeq (/usr/lib, $(LIBDIR))
> +       $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBXAR) @LIBS@
> + else
>         $(CC) $(CFLAGS) -o $@ $< @RPATH@$(LIBDIR) $(LDFLAGS) $(LIBXAR) @LIBS@
> + endif
>  else
>         $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBXAR) @LIBS@
>  endif

Its certainly better, yes. libdir might not always equal /usr/lib of
course, in libtool it compared against the system search path list but I
think you've at least tracked down the cause of your problem.

Cheers,

Richard
Lewis, Nick - April 23, 2013, 1:13 p.m.
>Its certainly better, yes. libdir might not always equal /usr/lib of course, in libtool it compared against the system search path list

So @RPATH@$(LIBDIR) is always wrong because if it is in libdir then it need not be on rpath?

Should it unconditionally be just:
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBXAR) @LIBS@

@RPATH@ is set for bsd and solaris in addition to linux. Do different rpath rules apply for these or can I look to upstream the removal of @RPATH@$(LIBDIR)

--
Nick


The details of this company are as follows:
G4S Technology Limited, Registered Office: Challenge House, International Drive, Tewkesbury, Gloucestershire GL20 8UQ, Registered in England No. 2382338.

This communication may contain information which is confidential, personal and/or privileged.

It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s), please note that any distribution, forwarding, copying or use of this communication or the information in it is strictly prohibited.

Any personal views expressed in this e-mail are those of the individual sender and the company does not endorse or accept responsibility for them.

Prior to taking any action based upon this e-mail message, you should seek appropriate confirmation of its authenticity.

This e-mail has been scanned for all viruses by MessageLabs.

Patch

--- a/src/Makefile.inc.in       2013-04-17 18:03:12.704735379 -0700
+++ b/src/Makefile.inc.in       2013-04-17 17:52:41.684668367 -0700
@@ -54,7 +54,11 @@ 
 @objroot@src/i% : @objroot@src/%.o $(LIBXAR)
        @mkdir -p $(@D)
 ifneq ($(words "" @RPATH@), 1)
+ ifeq (/usr/lib, $(LIBDIR))
+       $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBXAR) @LIBS@
+ else
        $(CC) $(CFLAGS) -o $@ $< @RPATH@$(LIBDIR) $(LDFLAGS) $(LIBXAR) @LIBS@
+ endif
 else
        $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBXAR) @LIBS@
 endif