Error compiling 3.4.0 agent in FreeBSD

127 views
Skip to first unread message

C. L. Martinez

unread,
Jul 27, 2018, 2:27:01 PM7/27/18
to wa...@googlegroups.com
Hi all,

I am installing new 3.4.0 agents on my FreeBSD systems, but it seems ¿gcc? is needed:

- Running the Makefile

CC external/cJSON/cJSON.o
cc: warning: -Wl,--start-group: 'linker' input unused [-Wunused-command-line-argument]
LINK libcJSON.a
RANLIB libcJSON.a
cd external/zlib/ && ./configure && gmake libz.a
Checking for gcc...
Checking for shared library support...
No shared library support.
Building static library libz.a version 1.2.11 with cc.
Checking for size_t... Yes.
Checking for off64_t... Yes.
Checking for fseeko... Yes.
Checking for strerror... Yes.
Checking for unistd.h... Yes.
Checking for stdarg.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
gmake[1]: Entering directory '/tmp/oo/wazuh-3.4.0/src/external/zlib'
cc -O -D_LARGEFILE64_SOURCE=1 -c -o adler32.o adler32.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o crc32.o crc32.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o deflate.o deflate.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o infback.o infback.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o inffast.o inffast.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o inflate.o inflate.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o inftrees.o inftrees.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o trees.o trees.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o zutil.o zutil.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o compress.o compress.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o uncompr.o uncompr.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o gzclose.o gzclose.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o gzlib.o gzlib.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o gzread.o gzread.c
cc -O -D_LARGEFILE64_SOURCE=1 -c -o gzwrite.o gzwrite.c
ar rc libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
gmake[1]: Leaving directory '/tmp/oo/wazuh-3.4.0/src/external/zlib'
cd external/lua-5.2.3/ && gmake freebsd
gmake[1]: Entering directory '/tmp/oo/wazuh-3.4.0/src/external/lua-5.2.3'
cd src && gmake freebsd
gmake[2]: Entering directory '/tmp/oo/wazuh-3.4.0/src/external/lua-5.2.3/src'
gmake all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline"
gmake[3]: Entering directory '/tmp/oo/wazuh-3.4.0/src/external/lua-5.2.3/src'
gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_LINUX -c -o lapi.o lapi.c
gmake[3]: gcc: Command not found
gmake[3]: *** [<builtin>: lapi.o] Error 127
gmake[3]: Leaving directory '/tmp/oo/wazuh-3.4.0/src/external/lua-5.2.3/src'
gmake[2]: *** [Makefile:103: freebsd] Error 2
gmake[2]: Leaving directory '/tmp/oo/wazuh-3.4.0/src/external/lua-5.2.3/src'
gmake[1]: *** [Makefile:55: freebsd] Error 2
gmake[1]: Leaving directory '/tmp/oo/wazuh-3.4.0/src/external/lua-5.2.3'
gmake: *** [Makefile:569: lua] Error 2

I was report smae problem some time ago https://groups.google.com/forum/#!searchin/wazuh/freebsd|sort:date/wazuh/HZkgAAW9IbM/7GWc140DBwAJ, and for release 3.3.X all was working ok (if I remember well) ... Is this a regression?

Thanks.
--
Greetings,
C. L. Martinez

Victor Fernandez

unread,
Jul 29, 2018, 5:11:41 PM7/29/18
to C. L. Martinez, Wazuh mailing list
Hi CL,

You need GNU Make and a C compiler to run the Wazuh installer since we do not provide packages for FreeBSD at this moment.

As we told in the mail thread you mention, you can use GNU C Compiler (gcc) or Clang.

If you want to use Clang, run Make manually before launching the installer (following the steps in the old thread:

1. Compile Wazuh using Clang and disabling Lua (it's not supported by Clang):
gmake -C src TARGET=agent CC=clang LUA_PLAT=none
2. Set up a binary installation to prevent the installer from running the compiler:

Edit etc/preloaded-vars.conf and set USER_BINARYINSTALL to "y":
# If USER_BINARYINSTALL is set, the installation
# is not going to compile the code, but use the
# binaries from ./bin/
USER_BINARYINSTALL="y"

3. Run the installer:
./install.sh
On the other hand, if you want to use gcc to compile Wazuh, follow these steps:

1. Install gcc:
pkg install gcc

2. Run the installer:
./install.sh
Hope it help.

Best regards,

Victor M Fernandez-Castro 
IT Engineer — Wazuh, Inc.

--
You received this message because you are subscribed to the Google Groups "Wazuh mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+unsubscribe@googlegroups.com.
To post to this group, send email to wa...@googlegroups.com.
Visit this group at https://groups.google.com/group/wazuh.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/20180727182658.hrll6cp6xbkwizmc%40metallica.lab.uxdom.org.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages