The attached packaging for wireshark-1.6.5-2 allows clang to build wireshark under 10.7 fink. The wireshark.patch to Makefile.in causes the problematic wiresharek-filters.o object file to be compiled at -Os (which avoids the clang inlining bug http://llvm.org/bugs/show_bug.cgi?id=12228\). Tested with 'fink -m --build-as-nobody'.
Hm, the crucial part (the patch file) is missing, instead there is a wxmaxima.patch (and I checked, it really is for wxmaxima).
I'll upload the wireshark.patch file tonight as those files are on my home machine.
wireshark 1.6.5-2 info file
wireshark 1.6.5-2 patch file
Updated both wireshark.info and wireshark.patch (due to the different MD5 on the regenerated patch).
OK, that patch looks simple enough (though I've rewritten it to work without a .patch file). But I wonder: How much did you test the resulting binary overall? Perhaps there are more files clang miscompiles but they simply didn't trigger an immediate crash...
MacPorts saw basically the sane issue but no one ever bothered to discover which file in wireshark was being miscompiled....
http://trac.macports.org/ticket/31615
The file problematic file was easy to identify from a wireshark run under lgdb...
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x00007fff923054f0 in strlen ()
(gdb) bt
#0 0x00007fff923054f0 in strlen ()
#1 0x000000010420bef3 in g_strdup ()
warning: Could not open object file:
"/sw/src/fink.build/wireshark-1.6.5-2/wireshark-1.6.5/wireshark-filters.o":
Permission denied
warning: Couldn't open object file
'/sw/src/fink.build/wireshark-1.6.5-2/wireshark-1.6.5/wireshark-filters.o'
#2 0x0000000100014bda in copy_filter_list ()
#3 0x0000000100050e67 in read_configuration_files (gdp_path=0x7fff5fbff700,
dp_path=0x7fff5fbff6f8)
at main.c:1906
#4 0x000000010004edca in main (argc=1, argv=0x7fff5fbff7a8) at main.c:2418
Considering that wireshark doesn't have a testsuite to run as the INSTALL doc only says...
8. Run './wireshark' or './tshark' or ./dumpcap, and make sure things are
working. You must have root privileges in order to capture live data.
I just tried simple runs of wireshark, I find it rather unlikely that more files are being miscompiled by clang (as codegen errors from clang are rare these days). Note that I do have http://llvm.org/bugs/show_bug.cgi?id=12228
and radr://11025519 open to have the miscompilation of filter.c addressed upstream.
Also note that all of the upstream traffic on wireshark with clang seems to be focused on using the static-analyzer to look for coding problems. I could also open a PR with wireshark to try to have filters.c recoded to not tickle the clang codegen bug but I would rather see the compiler fixed instead.
I added a modified version of this to CVS.