With such a beautiful commit message, who needs to see the patch?
Here it is. (Yes, I just forgot to include it).
Thanks,
-michael
On 01/23/2014 09:29 AM, Michael Ferguson wrote:
Fix RE2 builds and tests on Mac OS X Mavericks
Even after upgrading RE2 to the latest version which addresses
some issues with Mac OS X, I was having trouble linking the C++
test programs with RE2 - and I believe that .chpl programs
using RE2 would not compile either. The source of the problem
was three-fold:
1) Mac OS X does not support static linking of executables
(although it can link with a static library), so using the
--static flag in the tests is not an option.
2) The RE2 build/install process leaves a partial pathname
to the .so encoded in the .so; so that when you link with
that binary it would look for the re2.so in an obj/ directory.
Because of this partial pathname, the usual rpath linker
flag was not enabling the loader to find the required library.
3) When dynamically linking, the list of exported symbols
did not include some that earlier patches to RE2 (to make
it work on channels) added.
To fix these problems, this patch:
1) Adjusts the C++ language Regexp tests to not use
--static on Mac OS X
2) Fixes the RE2 Makefile to update the pathname
in the .so to the absolute destination pathname using
the tool install_name_tool if it exists
3) Adds the missing symbols to libre2.symbols and
libre2.symbols.darwin.
This version passes test/regexp on Linux and has minimal
changes from the one that worked for me with Mac OS X Mavericks.
Index: test/regexp/ferguson/ctests/sub_test
===================================================================
--- test/regexp/ferguson/ctests/sub_test (revision 22575)
+++ test/regexp/ferguson/ctests/sub_test (working copy)
@@ -36,18 +36,30 @@
# If we had an easy way to get the names of the C/C++ compilers
# we could support non-gnu
COMP=`$CHPL_HOME/util/chplenv/compiler`
+PLAT=`$CHPL_HOME/util/chplenv/platform`
if [ "$COMP" = "gnu" ]
then
echo C tests will run using gnu compiler
+elif [ "$COMP" == "clang" ]
+then
+ echo C tests will run using clang compiler
+ CC=clang
+ CXX=clang++
else
echo Skipping C Regexp tests without gnu compilers
exit
fi
+if [ "$PLAT" = "darwin" ]
+then
+ # Don't use --static with because it doesn't work on Mac OS X
+ OPTS=
+else
+ OPTS="-static"
+fi
+DEPS="$OPTS -Wall -DSIMPLE_TEST $DEFS $RSRC/qio.c $RSRC/sys.c
$RSRC/sys_xsi_strerror_r.c $RSRC/qbuffer.c $RSRC/deque.c
$RSRC/regexp/re2/re2-interface.cc $RE2INCLS $RE2LIB -lpthread"
-DEPS="--static -Wall -DSIMPLE_TEST $DEFS $RSRC/qio.c $RSRC/sys.c
$RSRC/sys_xsi_strerror_r.c $RSRC/qbuffer.c $RSRC/deque.c
$RSRC/regexp/re2/re2-interface.cc $RE2INCLS $RE2LIB -lpthread"
-
T1="$CXX $DEPS -g regexp_test.cc -o regexp_test"
T2="$CXX $DEPS -g regexp_channel_test.cc -o regexp_channel_test"
Index: third-party/re2/hg_diff_g.patch
===================================================================
--- third-party/re2/hg_diff_g.patch (revision 22575)
+++ third-party/re2/hg_diff_g.patch (working copy)
@@ -51,6 +51,40 @@
obj/libre2.a: $(OFILES)
@mkdir -p obj
+@@ -250,6 +254,7 @@
+ $(INSTALL_DATA) $(INSTALL_HFILES) $(DESTDIR)$(includedir)/re2
+ $(INSTALL) obj/libre2.a $(DESTDIR)$(libdir)/libre2.a
+ $(INSTALL) obj/so/libre2.so $(DESTDIR)$(libdir)/libre2.so.$(SONAME).0.0
++ if [ -n `command -v install_name_tool` ]; then install_name_tool -id
$(DESTDIR)$(libdir)/libre2.so.$(SONAME).0.0
$(DESTDIR)$(libdir)/libre2.so.$(SONAME).0.0; fi
+ ln -sf libre2.so.$(SONAME).0.0 $(DESTDIR)$(libdir)/libre2.so.$(SONAME)
+ ln -sf libre2.so.$(SONAME).0.0 $(DESTDIR)$(libdir)/libre2.so
+
+diff --git a/libre2.symbols b/libre2.symbols
+--- a/libre2.symbols
++++ b/libre2.symbols
+@@ -6,6 +6,9 @@
+ # re2::StringPiece*
+ _ZN3re211StringPiece*;
+ _ZNK3re211StringPiece*;
++ # re2::FilePiece*
++ _ZN3re211FilePiece*;
++ _ZNK3re211FilePiece*;
+ # operator<<(std::ostream&, re2::StringPiece const&)
+ _ZlsRSoRKN3re211StringPieceE;
+ # re2::FilteredRE2*
+diff --git a/libre2.symbols.darwin b/libre2.symbols.darwin
+--- a/libre2.symbols.darwin
++++ b/libre2.symbols.darwin
+@@ -5,6 +5,9 @@
+ # re2::StringPiece*
+ __ZN3re211StringPiece*
+ __ZNK3re211StringPiece*
++# re2::FilePiece*
++__ZN3re29FilePiece*
++__ZNK3re29FilePiece*
+ # operator<<(std::ostream&, re2::StringPiece const&)
+ __ZlsRNSt3__113basic_ostreamIcNS_11char_traitsIcEEEERKN3re211StringPieceE
+ # re2::FilteredRE2*
diff --git a/re2/nfa.cc b/re2/nfa.cc
--- a/re2/nfa.cc
+++ b/re2/nfa.cc
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers