Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation issue for local installation #3339

Merged
merged 1 commit into from
May 28, 2019
Merged

Conversation

vikman90
Copy link
Member

Related issue
#3336

Description

The TARGET=local definition conflicts with a parameter in the libffi's Makefile. That makes libffi compile the sources into src/external/libffi/server. However, in local mode, it tries to compile into src/external/libffi/local, this prevents the Wazuh's Makefile from finding the library while assembling libwazuhext.so.

Solution

The most simple fix is let the Wazuh's Makefile find libffi.a in a location that depends on the TARGET variable.

If we undefined TARGET, we would need to find the default target directory for libffi, that depends on the architecture.

Output

make TARGET=local
General settings:
    TARGET:             local
    V:
    DEBUG:              yes
    DEBUGAD
    PREFIX:             /var/ossec
    MAXAGENTS:          14000
    DATABASE:
    ONEWAY:             no
    CLEANFULL:          no
    RESOURCES_URL:      https://packages.wazuh.com/deps/3.9
User settings:
    OSSEC_GROUP:        ossec
    OSSEC_USER:         ossec
    OSSEC_USER_MAIL:    ossecm
    OSSEC_USER_REM:     ossecr
USE settings:
    USE_ZEROMQ:         no
    USE_GEOIP:          no
    USE_PRELUDE:        no
    USE_INOTIFY:        no
    USE_BIG_ENDIAN:     no
    USE_SELINUX:        no
    USE_AUDIT:          yes
    USE_FRAMEWORK_LIB:  no
Mysql settings:
    includes:
    libs:
Pgsql settings:
    includes:
    libs:
Defines:
    -DMAX_AGENTS=14000 -DOSSECHIDS -DDEFAULTDIR="/var/ossec" -DUSER="ossec" -DREMUSER="ossecr" -DGROUPGLOBAL="ossec" -DMAILUSER="ossecm" -DLinux -DINOTIFY_ENABLED -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -DENABLE_SYSC -DENABLE_CISCAT -DENABLE_SHARED -DENABLE_AUDIT -DLOCAL
Compiler:
    CFLAGS            -Wl,--start-group -Iexternal/audit-userspace/lib -pthread -Iexternal/libdb/build_unix/ -g  -DMAX_AGENTS=14000 -DOSSECHIDS -DDEFAULTDIR="/var/ossec" -DUSER="ossec" -DREMUSER="ossecr" -DGROUPGLOBAL="ossec" -DMAILUSER="ossecm" -DLinux -DINOTIFY_ENABLED -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -DENABLE_SYSC -DENABLE_CISCAT -DENABLE_SHARED -DENABLE_AUDIT -DLOCAL -pipe -Wall -Wextra -I./ -I./headers/ -Iexternal/openssl/include -Iexternal/cJSON/ -Iexternal/libyaml/include -Iexternal/curl/include -Iexternal/msgpack/include
    LDFLAGS            '-Wl,-rpath,/../lib' -pthread -lrt -ldl
    CC                cc
    MAKE              make
make[1]: Leaving directory `/root/wazuh/src'

Done building local
  • Compilation without warnings in every supported platform.
  • Source installation.
  • Package installation. It applies neither to manager nor agents.

The `TARGET=local` definition conflicts with a parameter in the libffi's Makefile.
@vikman90 vikman90 added the type/bug Something isn't working label May 17, 2019
@vikman90 vikman90 requested review from snaow and BraulioV May 17, 2019 10:54
@vikman90 vikman90 self-assigned this May 17, 2019
@vikman90 vikman90 added this to the 20th week milestone May 17, 2019
@vikman90 vikman90 modified the milestones: 20th week, 22nd week May 28, 2019
@vikman90 vikman90 changed the base branch from 3.9 to 3.10 May 28, 2019 11:19
@vikman90 vikman90 merged commit b9beafb into 3.10 May 28, 2019
@vikman90 vikman90 deleted the 3.9-makefile-3336 branch May 28, 2019 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants