Open amrahmades opened 3 years ago
Looks like it's my bad, I broke the BSD compile in some commit. It might solves the problem, if you change this line in makefile
:
freebsd:git_version
${cc_local} -o ${NAME}_$@ -I. ${SOURCES} ${PCAP} ${FLAGS} -lrt -ggdb -static -O2
to
freebsd:git_version
${cc_local} -o ${NAME}_$@ -I. ${SOURCES} ${PCAP} ${FLAGS} -lrt -ggdb -static -O2 ${MP}
At the moment I do not have a BSD machine in hand to test the change. Could you plz try if it works?
thanks ,
the previous error gone , but it's seems we have a link or reference issue
gmake freebsd echo "const char gitversion = \"b8e9095135ec898cc5826f0c216dd3c120b5cafc\";" > git_version.h g++ -o udp2raw_freebsd -I. main.cpp lib/md5.cpp lib/pbkdf2-sha1.cpp lib/pbkdf2-sha256.cpp encrypt.cpp log.cpp network.cpp common.cpp connection.cpp misc.cpp fd_manager.cpp client.cpp server.cpp -lpthread lib/aes_faster_c/aes.cpp lib/aes_faster_c/wrapper.cpp my_ev.cpp -isystem libev "-lpcap" -std=c++11 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -lrt -ggdb -static -O2 "-DUDP2RAW_MP" In file included from /usr/include/machine/endian.h:6, from /usr/include/sys/types.h:46, from /usr/include/unistd.h:39, from common.h:18, from network.cpp:7: network.cpp: In function 'int send_raw_ip(raw_info_t&, const char, int)': network.cpp:1357:36: warning: operation on 'g_ip_id_counter' may be undefined [-Wsequence-point] 1357 | iph->id = htons (g_ip_id_counter++); //Id of this packet | ^ network.cpp:1357:36: warning: operation on 'g_ip_id_counter' may be undefined [-Wsequence-point] network.cpp:1361:36: warning: operation on 'g_ip_id_counter' may be undefined [-Wsequence-point] 1361 | iph->id = htons (g_ip_id_counter++); //Id of this packet | ^ network.cpp:1361:36: warning: operation on 'g_ip_id_counter' may be undefined [-Wsequence-point] common.cpp: In function 'std::vector<std::cxx11::basic_string
> parse_conf_line(const string&)': common.cpp:1183:8: warning: 'char strcpy(char, const char)' source argument is the same as destination [-Wrestrict] 1183 | strcpy(buf,(char )s.c_str()); | ibv_query_port': /usr/obj/usr/src/amd64.amd64/tmp/usr/include/infiniband/verbs.h:1662: undefined reference to~~^~~~~~~ /usr/local/bin/ld: /usr/lib/libpcap.a(pcap-rdmasniff.o): in functionrdmasniff_create': /usr/src/contrib/libpcap/pcap-rdmasniff.c:370: undefined reference to
ibv_get_device_list' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:405: undefined reference toibv_free_device_list' /usr/local/bin/ld: /usr/lib/libpcap.a(pcap-rdmasniff.o): in function
rdmasniff_activate': /usr/src/contrib/libpcap/pcap-rdmasniff.c:198: undefined reference toibv_open_device' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:205: undefined reference to
ibv_alloc_pd' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:212: undefined reference toibv_create_comp_channel' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:219: undefined reference to
ibv_create_cq' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:234: undefined reference toibv_create_qp' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:244: undefined reference to
ibv_modify_qp' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:252: undefined reference toibv_modify_qp' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:284: undefined reference to
ibv_regmr' /usr/local/bin/ld: /usr/lib/libpcap.a(pcap-rdmasniff.o): in function `ibv_query_port' /usr/local/bin/ld: /usr/lib/libpcap.a(pcap-rdmasniff.o): in function
rdmasniff_activate': /usr/src/contrib/libpcap/pcap-rdmasniff.c:322: undefined reference toibv_dereg_mr' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:330: undefined reference to
ibv_destroy_qp' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:334: undefined reference toibv_destroy_cq' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:338: undefined reference to
ibv_destroy_comp_channel' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:342: undefined reference toibv_dealloc_pd' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:346: undefined reference to
ibv_close_device' /usr/local/bin/ld: /usr/lib/libpcap.a(pcap-rdmasniff.o): in functionrdmasniff_findalldevs': /usr/src/contrib/libpcap/pcap-rdmasniff.c:417: undefined reference to
ibv_get_device_list' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:434: undefined reference toibv_free_device_list' /usr/local/bin/ld: /usr/lib/libpcap.a(pcap-rdmasniff.o): in function
rdmasniff_read': /usr/src/contrib/libpcap/pcap-rdmasniff.c:148: undefined reference toibv_wc_status_str' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:125: undefined reference to
ibv_get_cq_event' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:134: undefined reference toibv_ack_cq_events' /usr/local/bin/ld: /usr/lib/libpcap.a(pcap-rdmasniff.o): in function
rdmasniff_cleanup': /usr/src/contrib/libpcap/pcap-rdmasniff.c:82: undefined reference toibv_dereg_mr' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:84: undefined reference to
ibv_destroy_qp' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:85: undefined reference toibv_destroy_cq' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:86: undefined reference to
ibv_dealloc_pd' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:87: undefined reference toibv_destroy_comp_channel' /usr/local/bin/ld: /usr/src/contrib/libpcap/pcap-rdmasniff.c:88: undefined reference to
ibv_close_device' collect2: error: ld returned 1 exit status gmake: *** [makefile:109: freebsd] Error 1
try to remove -static
:
freebsd:git_version
${cc_local} -o ${NAME}_$@ -I. ${SOURCES} ${PCAP} ${FLAGS} -lrt -ggdb -O2 ${MP}
Thanks, I have an executable file now !!
I'm going to test and give you feedback.
Do not remove -static, without it you won't have a static binary. Add -libverbs and then it will compile ok. Then you could use static binary on older systems without libraries (sometimes it's very important with older pfsense installs).
${cc_local} -o ${NAME}_$@ -I. ${SOURCES} ${PCAP} ${FLAGS} -lrt -ggdb -static -libverbs -O2 ${MP}
Do not remove -static, without it you won't have a static binary. Add -libverbs and then it will compile ok. Then you could use static binary on older systems without libraries (sometimes it's very important with older pfsense installs).
${cc_local} -o ${NAME}_$@ -I. ${SOURCES} ${PCAP} ${FLAGS} -lrt -ggdb -static -libverbs -O2 ${MP}
Thank you very much for this. Can somebod please modify the makefile for freebsd to include this? I was searching a lot to find this very useful post.
I can confirm that the compile works OK with this modification on 13.2-RELEASE-p1 FreeBSD 64bit.
English Only (except for bug reporting).
Hello, i am trying to build it on FreeBSD 12.2, i had the following error
i spent too much time looking for linux/filter with no luck .