diff --git a/CMakeLists.txt b/CMakeLists.txt index 772e726b..a561a046 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,6 +67,7 @@ endif() if(MUSL_OPTIMIZED_BUILD) set(MUSL_FLAGS "-static -Os -fPIE -pie") + add_definitions(-DMUSL_OPTIMIZED) endif() # explicitly set hardening flags diff --git a/userspace/falco/falco.cpp b/userspace/falco/falco.cpp index 54410d53..61e59c8b 100644 --- a/userspace/falco/falco.cpp +++ b/userspace/falco/falco.cpp @@ -137,8 +137,12 @@ static void usage() " -l Show the name and description of the rule with name and exit.\n" " --list [] List all defined fields. If is provided, only list those fields for\n" " the source . Current values for are \"syscall\", \"k8s_audit\"\n" -#ifndef MUSL_OPTIMIZED_BUILD + " --list-fields-markdown []\n" + " List fields in md\n" +#ifndef MUSL_OPTIMIZED " --list-plugins Print info on all loaded plugins and exit.\n" +#endif +#ifndef MINIMAL_BUILD " -m , --mesos-api \n" " Enable Mesos support by connecting to the API server\n" " specified as argument. E.g. \"http://admin:password@127.0.0.1:5050\".\n" @@ -574,9 +578,7 @@ int falco_init(int argc, char **argv) {"k8s-api", required_argument, 0, 'k'}, {"k8s-node", required_argument, 0}, {"list", optional_argument, 0}, -#ifndef MUSL_OPTIMIZED_BUILD {"list-plugins", no_argument, 0}, -#endif {"mesos-api", required_argument, 0, 'm'}, {"option", required_argument, 0, 'o'}, {"pidfile", required_argument, 0, 'P'}, @@ -769,7 +771,7 @@ int falco_init(int argc, char **argv) list_flds_source = optarg; } } -#ifndef MUSL_OPTIMIZED_BUILD +#ifndef MUSL_OPTIMIZED else if (string(long_options[long_index].name) == "list-plugins") { list_plugins = true; @@ -965,7 +967,7 @@ int falco_init(int argc, char **argv) for(auto &p : config.m_plugins) { std::shared_ptr plugin; -#ifdef MUSL_OPTIMIZED_BUILD +#ifdef MUSL_OPTIMIZED throw std::invalid_argument(string("Can not load/use plugins with musl optimized build")); #else falco_logger::log(LOG_INFO, "Loading plugin (" + p.m_name + ") from file " + p.m_library_path + "\n");