On 2015-03-18 23:09, Michael Rash wrote:
> On Wed, Mar 18, 2015 at 12:21 PM, Peter Smith
> <[email protected]> wrote:
> 
>> I'm trying to cross compile fwknop 2.6.5 on Debian Wheezy:
>> 
>> aic0azee@localhost:~$ make ./configure --host=arm-linux-musleabihf
>> --prefix=/home/aic0azee/fwknop --enable-udp-server --disable-client
>> --with-iptables=/sbin/iptables
>> 
>> ...
>> fwknop-2.6.5 configuration.
>> ==========================================================
>> Client build: no
>> Server build: yes
>> GPG encryption support: no
>> 
>> Installation prefix: /home/aic0azee/fwknop
>> 
>> Server support:
>> firewall type: iptables
>> firewall program path: /sbin/iptables
>> 
>> UDP server mode enabled, no libpcap dependency
>> 
>> aic0azee@localhost:~$ make
>> 
>> ...
>> arm-linux-musleabihf-gcc -DHAVE_CONFIG_H -I. -I.. -I ../lib -I
>> ../common -DSYSCONFDIR="/home/aic0azee/fwknop/etc"
>> -DSYSRUNDIR="/home/aic0azee/fwknop/var" -g -O2 -Wall -Wformat
>> -Wformat-security -fstack-protector-all -fstack-protector -fPIE
>> -D_FORTIFY_SOURCE=2 -MT fwknopd-pcap_capture.o -MD -MP -MF
>> .deps/fwknopd-pcap_capture.Tpo -c -o fwknopd-pcap_capture.o `test
>> -f
>> 'pcap_capture.c' || echo './'`pcap_capture.c
>> pcap_capture.c:33:18: fatal error: pcap.h: No such file or
>> directory
>> compilation terminated.
>> make[2]: *** [fwknopd-pcap_capture.o] Error 1
>> make[2]: Leaving directory `/home/aic0azee/fwknop-2.6.5/server'
>> make[1]: *** [all-recursive] Error 1
>> make[1]: Leaving directory `/home/aic0azee/fwknop-2.6.5'
>> make: *** [all] Error 2
>> 
>> Any ideas why this is happening?
> 
> Hi Peter,
> 
> This bug has been fixed in git in preparation for the 2.6.6 release:
> 
> https://github.com/mrash/fwknop/commit/bf251034e3ac16a92fa2df59ce05c9cde2c13cc8
> [1]
> 
> If you clone the git repo, this commit is checked into master.
> 
> Thanks,
> 
> --Mike
> 
> 
> Links:
> ------
> [1]
> https://github.com/mrash/fwknop/commit/bf251034e3ac16a92fa2df59ce05c9cde2c13cc8
> 

Hi Mike,

I don't know why I didn't think of trying to clone the git repo before 
consulting the mailing list. However, I have choosen to create a patch 
for pcap_capture.c and process_packet.c, as my build system use 
tarballs. After applying the patch fwknop compiles fine, but an error 
occurs while linking:
...
libtool: link: arm-linux-musleabihf-gcc -g -O2 -Wall -Wformat 
-Wformat-security -fstack-protector-all -fstack-protector -fPIE 
-D_FORTIFY_SOURCE=2 -Wall -Wformat -Wformat-security 
-fstack-protector-all -fstack-protector -fPIE -pie -D_FORTIFY_SOURCE=2 
-Wl,-z -Wl,relro -Wl,-z -Wl,now -o .libs/fwknopd fwknopd-fwknopd.o 
fwknopd-config_init.o fwknopd-incoming_spa.o fwknopd-pcap_capture.o 
fwknopd-process_packet.o fwknopd-log_msg.o fwknopd-utils.o 
fwknopd-sig_handler.o fwknopd-replay_cache.o fwknopd-access.o 
fwknopd-fwknopd_errors.o fwknopd-tcp_server.o fwknopd-udp_server.o 
fwknopd-fw_util.o fwknopd-fw_util_ipf.o fwknopd-fw_util_firewalld.o 
fwknopd-fw_util_iptables.o fwknopd-fw_util_ipfw.o fwknopd-fw_util_pf.o 
fwknopd-extcmd.o  ../lib/.libs/libfko.so ../common/libfko_util.a 
-Wl,-rpath -Wl,/home/aic0azee/fwknop/lib
../lib/.libs/libfko.so: undefined reference to `rpl_realloc'
collect2: error: ld returned 1 exit status
make[2]: *** [fwknopd] Error 1
make[2]: Leaving directory `/home/aic0azee/fwknop-2.6.5/server'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/aic0azee/fwknop-2.6.5'
make: *** [all] Error 2

I have been told the error is related to how the autoconf tool checks if 
the libc supports malloc features. A workaround is to export the 
variable "ac_cv_func_realloc_0_nonnull=yes":

aic0azee@localhost:~$ ac_cv_func_realloc_0_nonnull=yes ./configure 
--host=arm-linux-musleabihf --prefix=/home/aic0azee/fwknop 
--enable-udp-server --disable-client --with-iptables=/sbin/iptables

I can confirm that fwknop builds cleanly after exporting the variable.

Is it fine to use fwknop with the workaround described, or is it 
possible that adverse effects could arise?


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Fwknop-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fwknop-discuss

Reply via email to