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

Emmake make errors when used for Modsecurity #14221

Closed
giantcroc opened this issue May 19, 2021 · 3 comments
Closed

Emmake make errors when used for Modsecurity #14221

giantcroc opened this issue May 19, 2021 · 3 comments

Comments

@giantcroc
Copy link

Hi! When I use emmake make Modsecurity, I get the following errors.

/bin/bash ../libtool  --tag=CXX   --mode=compile /home/changran/emsdk/upstream/emscripten/em++ -DHAVE_CONFIG_H -I.  -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include          -I/usr/include/libxml2 -DWITH_LIBXML2   -g -O2 -MT parser/libmodsecurity_la-seclang-parser.lo -MD -MP -MF parser/.deps/libmodsecurity_la-seclang-parser.Tpo -c -o parser/libmodsecurity_la-seclang-parser.lo `test -f 'parser/seclang-parser.cc' || echo './'`parser/seclang-parser.cc
libtool: compile:  /home/changran/emsdk/upstream/emscripten/em++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT parser/libmodsecurity_la-seclang-parser.lo -MD -MP -MF parser/.deps/libmodsecurity_la-seclang-parser.Tpo -c parser/seclang-parser.cc  -fPIC -DPIC -o parser/.libs/libmodsecurity_la-seclang-parser.o
In file included from parser/seclang-parser.cc:41:
In file included from seclang-parser.yy:11:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/string:504:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/string_view:175:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__string:57:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/algorithm:643:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/memory:653:
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/typeinfo:221:16: error: reinterpret_cast from 'std::__type_info_implementations::__non_unique_arm_rtti_bit_impl::__type_name_t' (aka 'unsigned int') to 'size_t' (aka 'unsigned long') is not allowed
        return reinterpret_cast<size_t>(__v);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from parser/seclang-parser.cc:41:
In file included from seclang-parser.yy:20:
In file included from ../headers/modsecurity/rule_unconditional.h:28:
In file included from ../headers/modsecurity/modsecurity.h:175:
In file included from ../headers/modsecurity/transaction.h:25:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/unordered_map:409:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__hash_table:18:
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:317:9: error: no member named 'signbit' in the global namespace; did you mean '__signbit'?
using ::signbit;
      ~~^
/usr/include/bits/mathcalls-helper-functions.h:25:20: note: '__signbit' declared here
__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
                   ^
In file included from parser/seclang-parser.cc:41:
In file included from seclang-parser.yy:20:
In file included from ../headers/modsecurity/rule_unconditional.h:28:
In file included from ../headers/modsecurity/modsecurity.h:175:
In file included from ../headers/modsecurity/transaction.h:25:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/unordered_map:409:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__hash_table:18:
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:318:9: error: no member named 'fpclassify' in the global namespace; did you mean '__fpclassify'?
using ::fpclassify;
      ~~^
/usr/include/bits/mathcalls-helper-functions.h:21:20: note: '__fpclassify' declared here
__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value))
                   ^
In file included from parser/seclang-parser.cc:41:
In file included from seclang-parser.yy:20:
In file included from ../headers/modsecurity/rule_unconditional.h:28:
In file included from ../headers/modsecurity/modsecurity.h:175:
In file included from ../headers/modsecurity/transaction.h:25:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/unordered_map:409:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__hash_table:18:
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:319:9: error: no member named 'isfinite' in the global namespace
using ::isfinite;
      ~~^
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:320:9: error: no member named 'isinf' in the global namespace
using ::isinf;
      ~~^
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:321:9: error: no member named 'isnan' in the global namespace
using ::isnan;
      ~~^
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:322:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
      ~~^
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:323:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
using ::isgreater;
      ^~
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/functional:738:29: note: '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
                            ^
In file included from parser/seclang-parser.cc:41:
In file included from seclang-parser.yy:20:
In file included from ../headers/modsecurity/rule_unconditional.h:28:
In file included from ../headers/modsecurity/modsecurity.h:175:
In file included from ../headers/modsecurity/transaction.h:25:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/unordered_map:409:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__hash_table:18:
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:324:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
using ::isgreaterequal;
      ^~
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/functional:767:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
                            ^
In file included from parser/seclang-parser.cc:41:
In file included from seclang-parser.yy:20:
In file included from ../headers/modsecurity/rule_unconditional.h:28:
In file included from ../headers/modsecurity/modsecurity.h:175:
In file included from ../headers/modsecurity/transaction.h:25:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/unordered_map:409:
In file included from /home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__hash_table:18:
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:325:9: error: no member named 'isless' in the global namespace
using ::isless;
      ~~^
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:326:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:327:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:328:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/home/changran/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:329:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
14 errors generated.
em++: error: '/home/changran/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -DEMSCRIPTEN -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=21 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/home/changran/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT parser/libmodsecurity_la-seclang-parser.lo -MD -MP -MF parser/.deps/libmodsecurity_la-seclang-parser.Tpo -c -fPIC -DPIC parser/seclang-parser.cc -o parser/.libs/libmodsecurity_la-seclang-parser.o' failed (1)
make[3]: *** [Makefile:2072:parser/libmodsecurity_la-seclang-parser.lo] 错误 1

Please help me with it. Thanks.

@sbc100
Copy link
Collaborator

sbc100 commented May 19, 2021

The first and biggest problem is see there is -I/usr/include -I/usr/include/libxml2 on the command line. Including those paths to your system headers is recipe for trouble. Emscripten builds should never use include files of libraries from the host OS and that is causing the C++ and C standard headers to get rather muddled.

@giantcroc
Copy link
Author

The first and biggest problem is see there is -I/usr/include -I/usr/include/libxml2 on the command line. Including those paths to your system headers is recipe for trouble. Emscripten builds should never use include files of libraries from the host OS and that is causing the C++ and C standard headers to get rather muddled.

ok,it works.thanks.:)

@M4tteoP
Copy link

M4tteoP commented Jul 7, 2021

@giantcroc I'm facing the same issue building Modsecurity, and I don't get where should I remove the inclusion of these paths. Could you please give me any details on how you made it work? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants