Bro 1.5.1 compile error on FreeBSD AMD64

hi guys,

When I try to compile bro 1.5.1 on FreeBSD AMD64 platform, I hit this error -

building ‘_broccoli_intern’ extension
cc -shared -pthread -L/usr/home/cslee/bro-source/bro-1.5.1/aux/broccoli/src/.libs -I/usr/home/cslee/bro-source/bro-1.5.1/aux/broccoli/src /usr/home/cslee/bro-source/bro-1.5.1/aux/broctl/.python-build/temp.freebsd-8.0-RELEASE-amd64-2.6/broccoli_intern_wrap.o -L…/…/src/.libs -lbroccoli -o /usr/home/cslee/bro-source/bro-1.5.1/aux/broctl/.python-build/lib.freebsd-8.0-RELEASE-amd64-2.6/_broccoli_intern.so
/usr/bin/ld: /usr/home/cslee/bro-source/bro-1.5.1/aux/broccoli/src/.libs/libbroccoli.a(bro.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/home/cslee/bro-source/bro-1.5.1/aux/broccoli/src/.libs/libbroccoli.a: could not read symbols: Bad value
error: command ‘cc’ failed with exit status 1
*** Error code 1

Anyway thanks to robin for pointed stuffs on bro log archive stuffs.

CS Lee wrote:

hi guys,

When I try to compile bro 1.5.1 on FreeBSD AMD64 platform, I hit this
error -

building '_broccoli_intern' extension
cc -shared -pthread
-L/usr/home/cslee/bro-source/bro-1.5.1/aux/broccoli/src/.libs
-I/usr/home/cslee/bro-source/bro-1.5.1/aux/broccoli/src /usr/home/cslee/bro-source/bro-1.5.1/aux/broctl/.python-build/temp.freebsd-8.0-RELEASE-amd64-2.6/broccoli_intern_wrap.o -L../../src/.libs -lbroccoli -o /usr/home/cslee/bro-source/bro-1.5.1/aux/broctl/.python-build/lib.freebsd-8.0-RELEASE-amd64-2.6/_broccoli_intern.so
/usr/bin/ld: /usr/home/cslee/bro-source/bro-1.5.1/aux/broccoli/src/.libs/libbroccoli.a(bro.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/home/cslee/bro-source/bro-1.5.1/aux/broccoli/src/.libs/libbroccoli.a: could not read symbols: Bad value
error: command 'cc' failed with exit status 1
*** Error code 1

Anyway thanks to robin for pointed stuffs on bro log archive stuffs.

Could you try attached patch? Thanks!

--
Best Regards,

CS Lee<geek00L[at]gmail.com>

http://geek00l.blogspot.com
http://defcraft.net

Kevin

patch-aux_broctl_Makefile_in (482 Bytes)

hi Kevin,

After patch is applied, same error popped up

broccoli_intern_wrap.c: In function ‘_wrap_bro_event_add_val’:
broccoli_intern_wrap.c:5585: warning: assignment discards qualifiers from pointer target type
broccoli_intern_wrap.c: In function ‘_wrap_bro_event_set_val’:
broccoli_intern_wrap.c:5655: warning: assignment discards qualifiers from pointer target type
broccoli_intern_wrap.c: In function ‘_wrap_bro_record_add_val’:
broccoli_intern_wrap.c:6810: warning: assignment discards qualifiers from pointer target type
broccoli_intern_wrap.c: In function ‘_wrap_bro_record_set_nth_val’:
broccoli_intern_wrap.c:6996: warning: assignment discards qualifiers from pointer target type
broccoli_intern_wrap.c: In function ‘_wrap_bro_record_set_named_val’:
broccoli_intern_wrap.c:7067: warning: assignment discards qualifiers from pointer target type
cc -shared -pthread -L/usr/home/cslee/bro-source/bro-1.5.1/aux/broccoli/src/.libs -I/usr/home/cslee/bro-source/bro-1.5.1/aux/broccoli/src /usr/home/cslee/bro-source/bro-1.5.1/aux/broctl/.python-build/temp.freebsd-8.0-RELEASE-amd64-2.6/broccoli_intern_wrap.o -L…/…/src/.libs -lbroccoli -o /usr/home/cslee/bro-source/bro-1.5.1/aux/broctl/.python-build/lib.freebsd-8.0-RELEASE-amd64-2.6/_broccoli_intern.so
/usr/bin/ld: /usr/home/cslee/bro-source/bro-1.5.1/aux/broccoli/src/.libs/libbroccoli.a(bro.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/home/cslee/bro-source/bro-1.5.1/aux/broccoli/src/.libs/libbroccoli.a: could not read symbols: Bad value
error: command ‘cc’ failed with exit status 1
*** Error code 1

Stop in /usr/home/cslee/bro-source/bro-1.5.1/aux/broctl.
*** Error code 1

Stop in /usr/home/cslee/bro-source/bro-1.5.1/aux.
*** Error code 1

Stop in /usr/home/cslee/bro-source/bro-1.5.1/aux.
*** Error code 1

Stop in /usr/home/cslee/bro-source/bro-1.5.1.
*** Error code 1

Stop in /usr/home/cslee/bro-source/bro-1.5.1.

The patch just make it compile with -fPIC flag and and it doesn’t work.

Thanks