Change in re2[master]: Uses straightforward SO install name on Darwin.

25 views
Skip to first unread message

Paul Wankadia (Gerrit)

unread,
May 18, 2017, 1:03:10 AM5/18/17
to Kyle Gorman, Paul Wankadia, Jason Woods, re2...@googlegroups.com

Paul Wankadia uploaded patch set #2 to the change originally created by Kyle Gorman.

View Change

Uses straightforward SO install name on Darwin.

When building for Darwin, the SO generated is given the install_name
"@rpath/libre2". Other SOs will as a result be unable to dlopen this.
(I haven't figured out exactly which circumstances this occurs, though
it appears to be a widespread problem---see below.) The obvious thing
to do is to give it traditional install_name, which is $(libdir)/libre2.

Homebrew, the package manager for Mac OS X, in fact incorporates a patch
of sorts to fix exactly this problem: after running "make install" with
the provided Makefile, it uses the obscure "install_name_tool" to repair
the install_name to exactly this. I have confirmed this is necessary to
dlopen libre2 on El Capitan.

(NB: This commit makes the Homebrew patch otiose.)

Change-Id: Ia5835dbaa591a66a4698a64b0b8b02c64e145de0
---
0 files changed, 0 insertions(+), 0 deletions(-)

To view, visit change 4250. To unsubscribe, visit settings.

Gerrit-Project: re2
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia5835dbaa591a66a4698a64b0b8b02c64e145de0
Gerrit-Change-Number: 4250
Gerrit-PatchSet: 2
Gerrit-Owner: Kyle Gorman <k...@google.com>
Gerrit-Reviewer: Jason Woods <ma...@jasonwoods.me.uk>
Gerrit-Reviewer: Kyle Gorman <k...@google.com>

Paul Wankadia (Gerrit)

unread,
May 18, 2017, 1:04:22 AM5/18/17
to Kyle Gorman, Paul Wankadia, Jason Woods, re2...@googlegroups.com

Paul Wankadia uploaded patch set #4 to the change originally created by Kyle Gorman.

View Change

Uses straightforward SO install name on Darwin.

When building for Darwin, the SO generated is given the install_name
"@rpath/libre2". Other SOs will as a result be unable to dlopen this.
(I haven't figured out exactly which circumstances this occurs, though
it appears to be a widespread problem---see below.) The obvious thing
to do is to give it traditional install_name, which is $(libdir)/libre2.

Homebrew, the package manager for Mac OS X, in fact incorporates a patch
of sorts to fix exactly this problem: after running "make install" with
the provided Makefile, it uses the obscure "install_name_tool" to repair
the install_name to exactly this. I have confirmed this is necessary to
dlopen libre2 on El Capitan.

(NB: This commit makes the Homebrew patch otiose.)

Change-Id: Ia5835dbaa591a66a4698a64b0b8b02c64e145de0
---
M Makefile
1 file changed, 1 insertion(+), 1 deletion(-)

To view, visit change 4250. To unsubscribe, visit settings.

Gerrit-Project: re2
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia5835dbaa591a66a4698a64b0b8b02c64e145de0
Gerrit-Change-Number: 4250
Gerrit-PatchSet: 4

Paul Wankadia (Gerrit)

unread,
May 18, 2017, 1:20:02 AM5/18/17
to Kyle Gorman, Paul Wankadia, Jason Woods, re2...@googlegroups.com

Paul Wankadia posted comments on this change.

View Change

Patch set 4:Code-Review +2

Currently, Homebrew's RE2 formula (https://github.com/Homebrew/homebrew-core/blob/master/Formula/re2.rb) is doing this:

    MachO::Tools.change_dylib_id("#{lib}/libre2.0.0.0.dylib", "#{lib}/libre2.0.dylib")

Under the assumption that doing that will keep Homebrew working (i.e. Cellar and all) regardless of the install name that the RE2 build assigns, I'm going to change said install name. I honestly don't understand why the install name has a directory when the soname (on other platforms) does not, but this is apparently not working for all macOS users, so if the RE2 build does something that works out of the box and Homebrew does something further and everyone is happy, then that's great. (But if this does break someone, then we really do need to understand *why*...)

    To view, visit change 4250. To unsubscribe, visit settings.

    Gerrit-Project: re2
    Gerrit-Branch: master
    Gerrit-MessageType: comment
    Gerrit-Change-Id: Ia5835dbaa591a66a4698a64b0b8b02c64e145de0
    Gerrit-Change-Number: 4250
    Gerrit-PatchSet: 4
    Gerrit-Owner: Kyle Gorman <k...@google.com>
    Gerrit-Reviewer: Jason Woods <ma...@jasonwoods.me.uk>
    Gerrit-Reviewer: Kyle Gorman <k...@google.com>
    Gerrit-Reviewer: Paul Wankadia <jun...@google.com>
    Gerrit-Comment-Date: Thu, 18 May 2017 05:19:58 +0000
    Gerrit-HasComments: No
    Gerrit-HasLabels: Yes

    Paul Wankadia (Gerrit)

    unread,
    May 18, 2017, 1:20:07 AM5/18/17
    to Kyle Gorman, Paul Wankadia, Jason Woods, re2...@googlegroups.com

    Paul Wankadia merged this change.

    View Change

    Approvals: Paul Wankadia: Looks good to me, approved
    Uses straightforward SO install name on Darwin.

    When building for Darwin, the SO generated is given the install_name
    "@rpath/libre2". Other SOs will as a result be unable to dlopen this.
    (I haven't figured out exactly which circumstances this occurs, though
    it appears to be a widespread problem---see below.) The obvious thing
    to do is to give it traditional install_name, which is $(libdir)/libre2.

    Homebrew, the package manager for Mac OS X, in fact incorporates a patch
    of sorts to fix exactly this problem: after running "make install" with
    the provided Makefile, it uses the obscure "install_name_tool" to repair
    the install_name to exactly this. I have confirmed this is necessary to
    dlopen libre2 on El Capitan.

    (NB: This commit makes the Homebrew patch otiose.)

    Change-Id: Ia5835dbaa591a66a4698a64b0b8b02c64e145de0
    Reviewed-on: https://code-review.googlesource.com/4250
    Reviewed-by: Paul Wankadia <jun...@google.com>

    ---
    M Makefile
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/Makefile b/Makefile
    index 645b364..1c04cb9 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -55,7 +55,7 @@
    SOEXT=dylib
    SOEXTVER=$(SONAME).$(SOEXT)
    SOEXTVER00=$(SONAME).0.0.$(SOEXT)
    -MAKE_SHARED_LIBRARY=$(CXX) -dynamiclib -Wl,-install_name,@rpath/libre2.$(SOEXTVER),-exported_symbols_list,libre2.symbols.darwin $(RE2_LDFLAGS) $(LDFLAGS)
    +MAKE_SHARED_LIBRARY=$(CXX) -dynamiclib -Wl,-install_name,$(libdir)/libre2.$(SOEXTVER),-exported_symbols_list,libre2.symbols.darwin $(RE2_LDFLAGS) $(LDFLAGS)
    else ifeq ($(shell uname),SunOS)
    SOEXT=so
    SOEXTVER=$(SOEXT).$(SONAME)

    To view, visit change 4250. To unsubscribe, visit settings.

    Gerrit-Project: re2
    Gerrit-Branch: master
    Gerrit-MessageType: merged
    Gerrit-Change-Id: Ia5835dbaa591a66a4698a64b0b8b02c64e145de0
    Gerrit-Change-Number: 4250
    Gerrit-PatchSet: 5
    Reply all
    Reply to author
    Forward
    0 new messages