THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

Anybody building Wireshark 3.1 under Cygwin using gcc 7.4.0 ?

I'm in fact in the work of it, but some errors appeared. Some of them I was able to get around with ad hoc modification of souces, but finally I stacked on:

[ 91%] Linking CXX executable run/wireshark.exe
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/ld: final link failed: File truncated
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/wireshark.dir/build.make:604: run/wireshark.exe] Błąd 1
make[1]: *** [CMakeFiles/Makefile2:914: CMakeFiles/wireshark.dir/all] Błąd 2
wborkowsk's avatar
1
wborkowsk
asked 2019-09-16 10:53:28 +0000
grahamb's avatar
23.8k
grahamb
updated 2019-09-16 12:01:09 +0000
edit flag offensive 0 remove flag close merge delete

Comments

These are the changes:

In "file_util.h":

#ifndef O_BINARY        /* WB TMP MODIF */
#define O_BINARY   0    /* Win32 needs the O_BINARY flag for open() */
#endif

"editcap.c", "ftype-time.c" (for strptime):

#ifdef      __CYGWIN__          /* WB TMP MODIF */
#define _XOPEN_SOURCE        700
#undef      __STRICT_ANSI__ /* Maybe also neded for strptime? */
#endif

"…/dissectors/packet-s1ap.c": warning error: argument ‘offset’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered].

So, in file "epan/dissectors/CMakeList.txt":

set_source_files_properties(
    ${CLEAN_FILES}
    PROPERTIES
    COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
)

#WB TMP MODIF
set_source_files_properties(
    ${CMAKE_CURRENT_SOURCE_DIR}/packet-s1ap.c
    PROPERTIES
    COMPILE_FLAGS "-O2 ${WERROR_COMMON_FLAGS} -Wno-error=clobbered" 
)

In file "interface_toolbar_reader.cpp":

/* WB TMP MODIF */
#include <sys/time.h>
#include <sys/select.h>
wborkowsk's avatar wborkowsk (2019-09-16 11:00:04 +0000) edit

Building Wireshark using Cywin isn't a supported option, so you're on your own.

There is a buildable Windows version using Visual Studio Community editions, so what are you trying to achieve building under Cygwin?

grahamb's avatar grahamb (2019-09-16 11:31:50 +0000) edit

Grahamb - It'a simply :-) Because my boss doesn't like Microsoft license restrictions.

wborkowsk's avatar wborkowsk (2019-09-16 11:40:02 +0000) edit

I hope you're being paid well to try to achieve this, good luck.

What are the perceived licence restrictions as regards to Wireshark on Windows built using VC? I ask as I'm not aware of any.

grahamb's avatar grahamb (2019-09-16 11:59:17 +0000) edit

Using for "commercial use" is not perfectly precised :-/ My firm made only linux software, but we need Windows Wireshark with our plugins for internal testing.

By the way, why there is no suport for Cygwin? It looks like not to much left to do.

wborkowsk's avatar wborkowsk (2019-09-16 12:07:29 +0000) edit
add a comment see more comments

1 Answer

0

Looks like it is impossible in current Wireshark version. When I had deleted the linking of Wireshark.exe, the linking of next "exe" was more communicative. It's more - cmake even not detect that this is on-Windows-compilation :-D , so probably many things are missing at the stage of linking.

Thanks grahamb for all suggestions. I will go to MSVC++ :-)

wborkowsk's avatar
1
wborkowsk
answered 2019-09-18 12:06:30 +0000, updated 2019-09-18 12:09:17 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer