Hey experts,
i'm trying to cross-compile snort for a arm-linux architecture.
i already downloaded a toolchain and tested it with a smal hello-world.c .. the compiling successed and it worked on the arm-arch.
so cross-compiling snort is a way hard, of course.
i tried something stupid, like change the Makefile-entries from gcc to arm-linux-gcc and stuff .. and of course i didnt worked.
so i tried to use the configure script and configure it with the --host-command.
>> ./configure --prefix/.. --host=arm-linux
this works for using the right compiler.
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for arm-linux-strip... arm-linux-strip
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for arm-linux-gcc... arm-linux-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
.
.
and so on.
but if the configure-script checks for the libs and includes of libpcap and pcrep it fails:
checking for sizeof(unsigned long)... configure: error: cannot run test program while cross compiling
See `config.log' for more details.
32 bits
checking for __FUNCTION__... yes
checking for floor in -lm... yes
checking for pcap_datalink in -lpcap... no
checking pfring.h usability... no
checking pfring.h presence... no
checking for pfring.h... no
checking for pfring_open in -lpfring... no
checking for pfring_open in -lpcap... no
ERROR! Libpcap library/headers (libpcap.a (or .so)/pcap.h)
not found, go get it from
http://www.tcpdump.org
or use the --with-libpcap-* options, if you have it installed
in unusual place. Also check if your libpcap depends on another
shared library that may be installed in an unusual place
checking for libpcap version >= 0.9... configure: error: cannot run test program while cross compiling
See `config.log' for more details.
checking pcre.h usability... yes
checking pcre.h presence... yes
checking for pcre.h... yes
checking for pcre_compile in -lpcre... no
ERROR! Libpcre library not found.
Get it from
http://www.pcre.org
no
ERROR! Libpcre library version >= 6.0 not found.
Get it from
http://www.pcre.org
checking for dlsym in -ldl... yes
checking for u_int8_t... yes
checking for u_int16_t... yes
.
.
the configure-statement was the following:
sudo ./configure --prefix=/tmp/snort/ --host=arm-linux --with-libpcap-libraries=/usr/local/lib/ --with-libpcre-includes=/usr/include/ --with-libpcre-libraries=/usr/lib/ --with-libpcap-includes=/usr/local/include/
i changed some entries in the configure-script to dont exit at this errors.
doing this it will finish. after that i tried to "make".
and of course it doesnt worked.
..
include/ -I/usr/include/ -g -O2 -Wall -DDYNAMIC_PLUGIN -DDETECTION_OPTION_TREE -c ipobj.c
/tmp/ccxGleZM.s: Assembler messages:
/tmp/ccxGleZM.s:2054: Error: bad instruction `rorw $8,r3'
/tmp/ccxGleZM.s:2054: Error: bad instruction `rorl $16,r3'
/tmp/ccxGleZM.s:2054: Error: bad instruction `rorw $8,r3'
/tmp/ccxGleZM.s:2060: Error: bad instruction `rorw $8,r2'
/tmp/ccxGleZM.s:2060: Error: bad instruction `rorl $16,r2'
/tmp/ccxGleZM.s:2060: Error: bad instruction `rorw $8,r2'
/tmp/ccxGleZM.s:2103: Error: bad instruction `rorw $8,r0'
/tmp/ccxGleZM.s:2103: Error: bad instruction `rorl $16,r0'
/tmp/ccxGleZM.s:2103: Error: bad instruction `rorw $8,r0'
/tmp/ccxGleZM.s:2186: Error: bad instruction `rorw $8,r0'
/tmp/ccxGleZM.s:2186: Error: bad instruction `rorl $16,r0'
/tmp/ccxGleZM.s:2186: Error: bad instruction `rorw $8,r0'
make[3]: *** [ipobj.o] Error 1
make[3]: Leaving directory `/home/snortsensor/Desktop/setups/snortixp/src/sfutil'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/snortsensor/Desktop/setups/snortixp/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/snortsensor/Desktop/setups/snortixp'
make: *** [all] Error 2
..
im sure i have the right libpcap and pcre libs installed, because it works fine, if i compile snort without the --host-command.
honestly im not very familiar with linux, yet. so if i did some stupid mistakes it depends on my dumbness with linux.
im using ubuntu 8.10
so is there anybody who could help? this would be grateful.
thx a lot
topf