clehene / protobuf-wireshark

Automatically exported from code.google.com/p/protobuf-wireshark
Apache License 2.0
0 stars 0 forks source link

Cannot compile protobuf-wireshark in Mac Lion 10.7 #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I want to use the protobuf-wireshark under Mac OS 10.7 to debug our program. 
However, the protobuf-wireshark cannot build in it.

I downloaded the "protobuf-wireshark-runtime-0.1" and run the 
"./make_wireshark_plugin.py". It complained:
==================================================
/bin/sh ../../libtool  --tag=CC   --mode=link gcc  -DINET6 -no-cpp-precomp 
-D_U_="__attribute__((unused))" -g -O2 -Wall -W -Wextra 
-Wdeclaration-after-statement -Wendif-labels -Wpointer-arith -Wno-pointer-sign 
-Wcast-align -Wformat-security -I/usr/local/include -D_REENTRANT 
-I/opt/local/include/gtk-2.0 -I/opt/local/lib/gtk-2.0/include 
-I/opt/local/include/atk-1.0 -I/opt/local/include/cairo 
-I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/pango-1.0 
-I/opt/local/include/gio-unix-2.0/ -I/opt/local/include 
-I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include 
-I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 
-I/opt/local/include/libpng14     -module -avoid-version -shared 
-Wl,-soname,protobuf.so -o protobuf.so -Wl,-search_paths_first  
-L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib 
-L/usr/local/lib -o protobuf.la -rpath 
/Users/wangqi/disk/projects/snsgames/babywar/thirdparty/wireshark/bin/lib/wiresh
ark/plugins/1.6.3 packet-protobuf.lo  wireshark-glue-protobuf.o -lprotobuf

*** Warning: Linking the shared library protobuf.la against the non-libtool
*** objects  wireshark-glue-protobuf.o is not portable!
libtool: link: rm -fr  .libs/protobuf.la .libs/protobuf.lai
libtool: link: gcc -Wl,-undefined -Wl,dynamic_lookup -o .libs/protobuf.so 
-bundle  .libs/packet-protobuf.o  wireshark-glue-protobuf.o   -L/usr/local/lib 
/usr/local/lib/libprotobuf.dylib -lz  -O2 -Wl,-soname -Wl,protobuf.so 
-Wl,-search_paths_first  
ld: unknown option: -soname
collect2: ld returned 1 exit status
make: *** [protobuf.la] Error 1
Unable to compile wireshark plugin in 
/Users/wangqi/disk/projects/snsgames/babywar/thirdparty/wireshark/src/plugins/pr
otobuf

======================================================

Then I modified the Makefile.am.template, change the line:
|PLUGIN_NAME|_la_LDFLAGS = -module -avoid-version -shared 
-Wl,-soname,|PLUGIN_NAME|.so -o |PLUGIN_NAME|.so
to 
|PLUGIN_NAME|_la_LDFLAGS = -module -avoid-version -shared -o |PLUGIN_NAME|.so

This time it can compile but throw a warning:

======================================================
/bin/sh ../../libtool  --tag=CC   --mode=link gcc  -DINET6 -no-cpp-precomp 
-D_U_="__attribute__((unused))" -g -O2 -Wall -W -Wextra 
-Wdeclaration-after-statement -Wendif-labels -Wpointer-arith -Wno-pointer-sign 
-Wcast-align -Wformat-security -I/usr/local/include -D_REENTRANT 
-I/opt/local/include/gtk-2.0 -I/opt/local/lib/gtk-2.0/include 
-I/opt/local/include/atk-1.0 -I/opt/local/include/cairo 
-I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/pango-1.0 
-I/opt/local/include/gio-unix-2.0/ -I/opt/local/include 
-I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include 
-I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 
-I/opt/local/include/libpng14     -module -avoid-version -shared -o protobuf.so 
-Wl,-search_paths_first  -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib 
-L/usr/local/lib -L/usr/local/lib -o protobuf.la -rpath 
/Users/wangqi/disk/projects/snsgames/babywar/thirdparty/wireshark/bin/lib/wiresh
ark/plugins/1.6.3 packet-protobuf.lo  wireshark-glue-protobuf.o -lprotobuf

*** Warning: Linking the shared library protobuf.la against the non-libtool
*** objects  wireshark-glue-protobuf.o is not portable!
libtool: link: gcc -Wl,-undefined -Wl,dynamic_lookup -o .libs/protobuf.so 
-bundle  .libs/packet-protobuf.o  wireshark-glue-protobuf.o   -L/usr/local/lib 
/usr/local/lib/libprotobuf.dylib -lz  -O2 -Wl,-search_paths_first  
libtool: link: ( cd ".libs" && rm -f "protobuf.la" && ln -s "../protobuf.la" 
"protobuf.la" )
======================================================

However, the wireshark 1.6.3 cannot start now.

======================================================
$ ./wireshark 
wireshark(32924,0x7fff7b9de960) malloc: *** error for object 
0xffffffffaaa2f5f0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
======================================================

How can I run this problem in Mac. It's really important for me to develop. 
Thanks a lot!

Original issue reported on code.google.com by to.wan...@gmail.com on 18 Nov 2011 at 6:54

GoogleCodeExporter commented 8 years ago
I also have a project where it is vitally important to be able to develop on 
Mac OS 10.8 Mountain Lion.  Is there any plan to further develop this plug-in 
to work on a Mac?  Thank You

Original comment by rhl...@comcast.net on 10 Sep 2012 at 5:02

GoogleCodeExporter commented 8 years ago
Can you try install_name instead of soname for e.g

|PLUGIN_NAME|_la_LDFLAGS = -module -avoid-version -shared 
-Wl,-install_name,|PLUGIN_NAME|.so -o |PLUGIN_NAME|.so

Original comment by dear.c...@gmail.com on 9 Oct 2012 at 3:56