You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by jaaju <gi...@git.apache.org> on 2015/11/06 07:30:18 UTC

[GitHub] trafficserver pull request: fix rpath flags when multiple "--with-...

GitHub user jaaju opened a pull request:

    https://github.com/apache/trafficserver/pull/324

    fix rpath flags when multiple "--with-*" arguments are given.

    @bgaff 
      Using TS_ADDTO to add the custom locations of libraries results in incorrect "-rpath" directive to the linker. This is because TS_ADDTO creates a unique list of tokens that it adds to its target. E.g.,
    
        ./configure --with-openssl=/usr/local/openssl --with-zlib=/usr/local/zlib
    
    the above should result in
    
        LIBTOOL_LINK_FLAGS: -rpath /usr/local/openssl/lib /usr/local/zlib/lib
    
    The absence of "-rpath" in front of the second path causes an error in the linker!
    
    This is fixed by introducing a new macro TS_ADD_RPATH_TO that takes a path and adds it with the "-rpath " prefix.
    
    Also added influential environmental variable RPATH that can be used to give a base value for the rpath. So, the following
    
        ./configure --with-openssl=/usr/local/openssl --with-zlib=/usr/local/zlib RPATH=/foo
    
    will result in
    
        LIBTOOL_LINK_FLAGS: -rpath /foo -rpath /usr/local/zlib/lib -rpath /usr/local/openssl/lib

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jaaju/trafficserver master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafficserver/pull/324.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #324
    
----
commit 3a9fc2235f889eeac452b3bf16c40b34d8194e72
Author: Jay Ramamurthi <jr...@jramamur-ld.linkedin.biz>
Date:   2015-10-15T22:06:30Z

    fix rpath flags when multiple "--with-*" arguments are given.
      Using TS_ADDTO to add the custom locations of libraries results in incorrect "-rpath" directive to the linker. This is because TS_ADDTO creates a unique list of tokens that it adds to its target. E.g.,
    
        ./configure --with-openssl=/usr/local/openssl --with-zlib=/usr/local/zlib
    
    the above should result in
    
        LIBTOOL_LINK_FLAGS: -rpath /usr/local/openssl/lib /usr/local/zlib/lib
    
    The absence of "-rpath" in front of the second path causes an error in the linker!
    
    This is fixed by introducing a new macro TS_ADD_RPATH_TO that takes a path and adds it with the "-rpath " prefix.
    
    Also added influential environmental variable RPATH that can be used to give a base value for the rpath. So, the following
    
        ./configure --with-openssl=/usr/local/openssl --with-zlib=/usr/local/zlib RPATH=/foo
    
    will result in
    
        LIBTOOL_LINK_FLAGS: -rpath /foo -rpath /usr/local/zlib/lib -rpath /usr/local/openssl/lib

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: fix rpath flags when multiple "--with-...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the pull request:

    https://github.com/apache/trafficserver/pull/324#issuecomment-161188083
  
    This is getting closer. Please rebase your changes onto latest master and force push the branch to refresh.
    
    There are a number of places that still need to be updated to use ```TS_ADDTO_RPATH```:
    
        $ grep LIBTOOL_LINK_FLAGS build./
        common.m4:  TS_ADDTO(LIBTOOL_LINK_FLAGS, [-Wl,-rpath -Wl,$1])
        jemalloc.m4:    TS_ADDTO(LIBTOOL_LINK_FLAGS, [-R${jemalloc_ldflags}])
        lzma.m4:    TS_ADDTO(LIBTOOL_LINK_FLAGS, [-R${lzma_ldflags}])
        pcre.m4:    TS_ADDTO(LIBTOOL_LINK_FLAGS, [-R${pcre_ldflags}])
        xml.m4:        TS_ADDTO(LIBTOOL_LINK_FLAGS, [-R${libxml2_ldflags}])
        xml.m4:    TS_ADDTO(LIBTOOL_LINK_FLAGS, [-R${expat_ldflags}])
    
    Notice that these all use the ```-R/path``` syntax. This is because the portable syntax for specifying the RPATH is ```-Wl,-rpath -Wl,/path```. The ```-Wl,-rpath=/path``` syntax appears to be specific to the GNU linker (at least it is not supported by the OS X linker). When I tried the portable syntax, ```TS_ADDTO``` doesn't do the right thing (it splits on whitespace). You end up with something like this:
    
            LIBTOOL_LINK_FLAGS: -Wl,-rpath -Wl,/usr/local/lib -Wl,/opt/jpeach/lib
    
    Finally, you need to append ```$RPATH``` in the main ```configure.ac``` since it is possible for ```TS_ADDTO_RPATH``` to never get called.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: fix rpath flags when multiple "--with-...

Posted by bgaff <gi...@git.apache.org>.
Github user bgaff commented on the pull request:

    https://github.com/apache/trafficserver/pull/324#issuecomment-154329941
  
    This has proven to be very useful for us. I've reviewed the patch and obviously am comfortable with it, it'd be great to get the autoconf expert @SolidWallOfCode to take a look. (cc. @zwoop, @jpeach)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: fix rpath flags when multiple "--with-...

Posted by jaaju <gi...@git.apache.org>.
Github user jaaju commented on the pull request:

    https://github.com/apache/trafficserver/pull/324#issuecomment-162135109
  
    @jpeach - I have pulled in the latest from upstream and addressed your feedback. Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: fix rpath flags when multiple "--with-...

Posted by bgaff <gi...@git.apache.org>.
Github user bgaff commented on the pull request:

    https://github.com/apache/trafficserver/pull/324#issuecomment-161184930
  
    @jpeach , if you're good, I'll land this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: fix rpath flags when multiple "--with-...

Posted by bgaff <gi...@git.apache.org>.
Github user bgaff commented on the pull request:

    https://github.com/apache/trafficserver/pull/324#issuecomment-162476486
  
    Hey @jpeach I'm gonna land this within the next day (rebased into a single commit), unless you have any other questions or concerns? But after my review it appears that @jaaju has addressed all open concerns.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: fix rpath flags when multiple "--with-...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the pull request:

    https://github.com/apache/trafficserver/pull/324#issuecomment-154492445
  
    I think that if you just pass ```-R/path/to/foo``` to ```TS_ADDTO()``` it will do the right thing. I like the addition of the RPATH option. You don't need to ```AC_SUBST(RPATH)``` since ```RPATH``` is never present in  and generated files.
    
    Here's how I think this should work:
    
    - Rename ```TS_ADD_RPATH_TO``` to ```TS_ADDTO_RPATH```
    - ```TS_ADDTO_RPATH``` should start with ```$RPATH``` then append paths
    - The argument to ```TS_ADDTO_RPATH``` should be a path, so that the macro can still uniquify



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: fix rpath flags when multiple "--with-...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the pull request:

    https://github.com/apache/trafficserver/pull/324#issuecomment-161183921
  
    I filed this as [TS-4047](https://issues.apache.org/jira/browse/TS-4047).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: fix rpath flags when multiple "--with-...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/trafficserver/pull/324


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: fix rpath flags when multiple "--with-...

Posted by jaaju <gi...@git.apache.org>.
Github user jaaju commented on the pull request:

    https://github.com/apache/trafficserver/pull/324#issuecomment-161077650
  
    @bgaff, @jpeach 
    I have incorporated James' feedback and resolved conflicts by merging changes from upstream. Let me know if this is good. Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---