Skip to content

Commit

Permalink
Uses straightforward SO install name on Darwin.
Browse files Browse the repository at this point in the history
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 <junyer@google.com>
  • Loading branch information
kylebgorman authored and junyer committed May 18, 2017
1 parent 7b88dbe commit b2c9765
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ifeq ($(shell uname),Darwin)
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)
Expand Down

0 comments on commit b2c9765

Please sign in to comment.