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

make error - execinfo_testfunc1.c - implicit declaration of function random #83

Open
solarmon opened this issue Apr 5, 2019 · 22 comments

Comments

@solarmon
Copy link

solarmon commented Apr 5, 2019

Hi,

I'm trying to build rtpproxy on a CentOS 7.6.1810 machine.

The make step is failing with:

Making all in libexecinfo
make[1]: Entering directory `/usr/local/src/rtpproxy/libexecinfo'
gcc -DHAVE_CONFIG_H -I. -I../src  -Werror=implicit-function-declaration -Wall -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_check-execinfo_testfunc1.o -MD -MP -MF .deps/execinfo_check-execinfo_testfunc1.Tpo -c -o execinfo_check-execinfo_testfunc1.o `test -f 'execinfo_testfunc1.c' || echo './'`execinfo_testfunc1.c
execinfo_testfunc1.c: In function âtestfunc1â:
execinfo_testfunc1.c:38:3: error: implicit declaration of function ârandomâ [-Werror=implicit-function-declaration]
   rnd = random() % 1024;
   ^
cc1: some warnings being treated as errors
make[1]: *** [execinfo_check-execinfo_testfunc1.o] Error 1
make[1]: Leaving directory `/usr/local/src/rtpproxy/libexecinfo'
make: *** [all-recursive] Error 1

I have tried upgrading git from 1.8.3 to 1.9 and also gcc from 4.8.5 to 4.9.2 but that did not make any difference.

Any suggestions on how to resolve this?

@solarmon
Copy link
Author

Hi,

Any solution for this build error?

I can install rtpproxy from yum, but it seems to be a beta version:

# rtpproxy -V
2.0.beta.20150106

I'd rather get a latest stable build from github.

@JerryGwd
Copy link

just delete option "implicit-function-declaration " in Makefile

@solarmon
Copy link
Author

just delete option "implicit-function-declaration " in Makefile

Thanks for the suggestion.

However, and please excuse my ignorance, but I cannot find "implicit-function-declaration" in any of these files:

Makefile
Makefile.am
Makefile.in

@k3nz0
Copy link

k3nz0 commented May 21, 2019

I'm having the same issue.
Check the Makefile under libexecinfo/ and remove -Werror=implicit-function-declaration

However after running make again I'm getting this fatal error :

libucl_test.c:10:17: fatal error: ucl.h : No such file or directory
 #include "ucl.h"

@solarmon
Copy link
Author

Thank you k3nz0, I didn't realise that there was a Makefile in that location.

I removed -Werror=implicit-function-declaration from this Makefile, but I still get the following warnings and fatal error (stdatomic.h: No such file or directory):

Making all in libexecinfo
make[1]: Entering directory `/usr/local/src/rtpproxy/libexecinfo'
gcc -DHAVE_CONFIG_H -I. -I../src  -Wall -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_check-execinfo_testfunc1.o -MD -MP -MF .deps/execinfo_check-execinfo_testfunc1.Tpo -c -o execinfo_check-execinfo_testfunc1.o `test -f 'execinfo_testfunc1.c' || echo './'`execinfo_testfunc1.c
execinfo_testfunc1.c: In function âtestfunc1â:
execinfo_testfunc1.c:38:3: warning: implicit declaration of function ârandomâ [-Wimplicit-function-declaration]
   rnd = random() % 1024;
   ^
mv -f .deps/execinfo_check-execinfo_testfunc1.Tpo .deps/execinfo_check-execinfo_testfunc1.Po
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libexecinfo_a-execinfo.o -MD -MP -MF .deps/libexecinfo_a-execinfo.Tpo -c -o libexecinfo_a-execinfo.o `test -f 'execinfo.c' || echo './'`execinfo.c
mv -f .deps/libexecinfo_a-execinfo.Tpo .deps/libexecinfo_a-execinfo.Po
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libexecinfo_a-stacktraverse.o -MD -MP -MF .deps/libexecinfo_a-stacktraverse.Tpo -c -o libexecinfo_a-stacktraverse.o `test -f 'stacktraverse.c' || echo './'`stacktraverse.c
stacktraverse.c:6:9: warning: unknown option after â#pragma GCC diagnosticâ kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wframe-address"
         ^
mv -f .deps/libexecinfo_a-stacktraverse.Tpo .deps/libexecinfo_a-stacktraverse.Po
rm -f libexecinfo.a
ar cru libexecinfo.a libexecinfo_a-execinfo.o libexecinfo_a-stacktraverse.o
ranlib libexecinfo.a
/bin/sh ../libtool  --tag=CC   --mode=link gcc -g3 -O0 -fno-omit-frame-pointer -g -O2   -o execinfo_check execinfo_check-execinfo_check.o execinfo_check-execinfo_testfunc.o execinfo_check-execinfo_testfunc1.o libexecinfo.a -ldl -lpthread -lrt
libtool: link: gcc -g3 -O0 -fno-omit-frame-pointer -g -O2 -o execinfo_check execinfo_check-execinfo_check.o execinfo_check-execinfo_testfunc.o execinfo_check-execinfo_testfunc1.o  libexecinfo.a -ldl -lpthread -lrt
gcc -DHAVE_CONFIG_H -I. -I../src  -Wall -Dexecinfo_TEST=main -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_TEST-execinfo.o -MD -MP -MF .deps/execinfo_TEST-execinfo.Tpo -c -o execinfo_TEST-execinfo.o `test -f 'execinfo.c' || echo './'`execinfo.c
execinfo.c: In function âmainâ:
execinfo.c:225:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
mv -f .deps/execinfo_TEST-execinfo.Tpo .deps/execinfo_TEST-execinfo.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -Wall -Dexecinfo_TEST=main -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_TEST-stacktraverse.o -MD -MP -MF .deps/execinfo_TEST-stacktraverse.Tpo -c -o execinfo_TEST-stacktraverse.o `test -f 'stacktraverse.c' || echo './'`stacktraverse.c
stacktraverse.c:6:9: warning: unknown option after â#pragma GCC diagnosticâ kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wframe-address"
         ^
mv -f .deps/execinfo_TEST-stacktraverse.Tpo .deps/execinfo_TEST-stacktraverse.Po
/bin/sh ../libtool  --tag=CC   --mode=link gcc -g3 -O0 -fno-omit-frame-pointer -g -O2   -o execinfo_TEST execinfo_TEST-execinfo.o execinfo_TEST-stacktraverse.o -ldl -lrt
libtool: link: gcc -g3 -O0 -fno-omit-frame-pointer -g -O2 -o execinfo_TEST execinfo_TEST-execinfo.o execinfo_TEST-stacktraverse.o  -ldl -lrt
make[1]: Leaving directory `/usr/local/src/rtpproxy/libexecinfo'
Making all in libucl
make[1]: Entering directory `/usr/local/src/rtpproxy/libucl'
gcc -DHAVE_CONFIG_H -I. -I../src  -DMODULE_IF_CODE -Dmod_strdup=strdup -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=libucl_test -I../external/libucl/include -I../hepconnector -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_test-libucl_test.o -MD -MP -MF .deps/libucl_test-libucl_test.Tpo -c -o libucl_test-libucl_test.o `test -f 'libucl_test.c' || echo './'`libucl_test.c
mv -f .deps/libucl_test-libucl_test.Tpo .deps/libucl_test-libucl_test.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DMODULE_IF_CODE -Dmod_strdup=strdup -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=libucl_test -I../external/libucl/include -I../hepconnector -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_test-rtpp_arh_conf.o -MD -MP -MF .deps/libucl_test-rtpp_arh_conf.Tpo -c -o libucl_test-rtpp_arh_conf.o `test -f '../modules/acct_rtcp_hep/rtpp_arh_conf.c' || echo './'`../modules/acct_rtcp_hep/rtpp_arh_conf.c
mv -f .deps/libucl_test-rtpp_arh_conf.Tpo .deps/libucl_test-rtpp_arh_conf.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DMODULE_IF_CODE -Dmod_strdup=strdup -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=libucl_test -I../external/libucl/include -I../hepconnector -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_test-rtpp_ucl.o -MD -MP -MF .deps/libucl_test-rtpp_ucl.Tpo -c -o libucl_test-rtpp_ucl.o `test -f '../src/rtpp_ucl.c' || echo './'`../src/rtpp_ucl.c
mv -f .deps/libucl_test-rtpp_ucl.Tpo .deps/libucl_test-rtpp_ucl.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DMODULE_IF_CODE -Dmod_strdup=strdup -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=libucl_test -I../external/libucl/include -I../hepconnector -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_test-rtpp_memdeb.o -MD -MP -MF .deps/libucl_test-rtpp_memdeb.Tpo -c -o libucl_test-rtpp_memdeb.o `test -f '../src/rtpp_memdeb.c' || echo './'`../src/rtpp_memdeb.c
../src/rtpp_memdeb.c:42:23: fatal error: stdatomic.h: No such file or directory
 #include <stdatomic.h>
                       ^
compilation terminated.
make[1]: *** [libucl_test-rtpp_memdeb.o] Error 1
make[1]: Leaving directory `/usr/local/src/rtpproxy/libucl'
make: *** [all-recursive] Error 1

I then realised that my sessionhad reverted back to gcc version 4.8.5, so I changed to 4.9.2 (by using scl enable devtoolset-3 bash [I already had gcc 4.9.2 installed as per https://stackoverflow.com/questions/47175706/how-to-install-gcc-4-9-2-on-rhel-7-4]).

However, I still get the following error (#error "BYTE_ORDER needs to be defined"):

Making all in libexecinfo
make[1]: Entering directory `/usr/local/src/rtpproxy/libexecinfo'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/local/src/rtpproxy/libexecinfo'
Making all in libucl
make[1]: Entering directory `/usr/local/src/rtpproxy/libucl'
gcc -DHAVE_CONFIG_H -I. -I../src  -DMODULE_IF_CODE -Dmod_strdup=strdup -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=libucl_test -I../external/libucl/include -I../hepconnector -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_test-rtpp_memdeb.o -MD -MP -MF .deps/libucl_test-rtpp_memdeb.Tpo -c -o libucl_test-rtpp_memdeb.o `test -f '../src/rtpp_memdeb.c' || echo './'`../src/rtpp_memdeb.c
mv -f .deps/libucl_test-rtpp_memdeb.Tpo .deps/libucl_test-rtpp_memdeb.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DMODULE_IF_CODE -Dmod_strdup=strdup -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=libucl_test -I../external/libucl/include -I../hepconnector -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_test-rtpp_memdeb_glitch.o -MD -MP -MF .deps/libucl_test-rtpp_memdeb_glitch.Tpo -c -o libucl_test-rtpp_memdeb_glitch.o `test -f '../src/rtpp_memdeb_glitch.c' || echo './'`../src/rtpp_memdeb_glitch.c
mv -f .deps/libucl_test-rtpp_memdeb_glitch.Tpo .deps/libucl_test-rtpp_memdeb_glitch.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DRTPP_MEMDEB_FREE_NULL -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=rtpproxy -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_debug_a-ucl_emitter_streamline.o -MD -MP -MF .deps/libucl_debug_a-ucl_emitter_streamline.Tpo -c -o libucl_debug_a-ucl_emitter_streamline.o `test -f '../external/libucl/src/ucl_emitter_streamline.c' || echo './'`../external/libucl/src/ucl_emitter_streamline.c
mv -f .deps/libucl_debug_a-ucl_emitter_streamline.Tpo .deps/libucl_debug_a-ucl_emitter_streamline.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DRTPP_MEMDEB_FREE_NULL -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=rtpproxy -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_debug_a-ucl_emitter_utils.o -MD -MP -MF .deps/libucl_debug_a-ucl_emitter_utils.Tpo -c -o libucl_debug_a-ucl_emitter_utils.o `test -f '../external/libucl/src/ucl_emitter_utils.c' || echo './'`../external/libucl/src/ucl_emitter_utils.c
mv -f .deps/libucl_debug_a-ucl_emitter_utils.Tpo .deps/libucl_debug_a-ucl_emitter_utils.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DRTPP_MEMDEB_FREE_NULL -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=rtpproxy -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_debug_a-ucl_emitter.o -MD -MP -MF .deps/libucl_debug_a-ucl_emitter.Tpo -c -o libucl_debug_a-ucl_emitter.o `test -f '../external/libucl/src/ucl_emitter.c' || echo './'`../external/libucl/src/ucl_emitter.c
mv -f .deps/libucl_debug_a-ucl_emitter.Tpo .deps/libucl_debug_a-ucl_emitter.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DRTPP_MEMDEB_FREE_NULL -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=rtpproxy -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_debug_a-ucl_hash.o -MD -MP -MF .deps/libucl_debug_a-ucl_hash.Tpo -c -o libucl_debug_a-ucl_hash.o `test -f '../external/libucl/src/ucl_hash.c' || echo './'`../external/libucl/src/ucl_hash.c
mv -f .deps/libucl_debug_a-ucl_hash.Tpo .deps/libucl_debug_a-ucl_hash.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DRTPP_MEMDEB_FREE_NULL -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=rtpproxy -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_debug_a-ucl_msgpack.o -MD -MP -MF .deps/libucl_debug_a-ucl_msgpack.Tpo -c -o libucl_debug_a-ucl_msgpack.o `test -f '../external/libucl/src/ucl_msgpack.c' || echo './'`../external/libucl/src/ucl_msgpack.c
mv -f .deps/libucl_debug_a-ucl_msgpack.Tpo .deps/libucl_debug_a-ucl_msgpack.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DRTPP_MEMDEB_FREE_NULL -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=rtpproxy -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_debug_a-ucl_parser.o -MD -MP -MF .deps/libucl_debug_a-ucl_parser.Tpo -c -o libucl_debug_a-ucl_parser.o `test -f '../external/libucl/src/ucl_parser.c' || echo './'`../external/libucl/src/ucl_parser.c
mv -f .deps/libucl_debug_a-ucl_parser.Tpo .deps/libucl_debug_a-ucl_parser.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DRTPP_MEMDEB_FREE_NULL -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=rtpproxy -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_debug_a-ucl_schema.o -MD -MP -MF .deps/libucl_debug_a-ucl_schema.Tpo -c -o libucl_debug_a-ucl_schema.o `test -f '../external/libucl/src/ucl_schema.c' || echo './'`../external/libucl/src/ucl_schema.c
mv -f .deps/libucl_debug_a-ucl_schema.Tpo .deps/libucl_debug_a-ucl_schema.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DRTPP_MEMDEB_FREE_NULL -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=rtpproxy -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_debug_a-ucl_sexp.o -MD -MP -MF .deps/libucl_debug_a-ucl_sexp.Tpo -c -o libucl_debug_a-ucl_sexp.o `test -f '../external/libucl/src/ucl_sexp.c' || echo './'`../external/libucl/src/ucl_sexp.c
mv -f .deps/libucl_debug_a-ucl_sexp.Tpo .deps/libucl_debug_a-ucl_sexp.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -DRTPP_MEMDEB_FREE_NULL -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=rtpproxy -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_debug_a-ucl_util.o -MD -MP -MF .deps/libucl_debug_a-ucl_util.Tpo -c -o libucl_debug_a-ucl_util.o `test -f '../external/libucl/src/ucl_util.c' || echo './'`../external/libucl/src/ucl_util.c
mv -f .deps/libucl_debug_a-ucl_util.Tpo .deps/libucl_debug_a-ucl_util.Po
rm -f libucl_debug.a
ar cru libucl_debug.a libucl_debug_a-ucl_emitter_streamline.o libucl_debug_a-ucl_emitter_utils.o libucl_debug_a-ucl_emitter.o libucl_debug_a-ucl_hash.o libucl_debug_a-ucl_msgpack.o libucl_debug_a-ucl_parser.o libucl_debug_a-ucl_schema.o libucl_debug_a-ucl_sexp.o libucl_debug_a-ucl_util.o
ranlib libucl_debug.a
/bin/sh ../libtool  --tag=CC   --mode=link gcc -g3 -O0 -fno-omit-frame-pointer -g -O2   -o libucl_test libucl_test-libucl_test.o libucl_test-rtpp_arh_conf.o libucl_test-rtpp_ucl.o libucl_test-rtpp_memdeb.o libucl_test-rtpp_memdeb_glitch.o libucl_debug.a ../libexecinfo/libexecinfo.a -ldl -lrt
libtool: link: gcc -g3 -O0 -fno-omit-frame-pointer -g -O2 -o libucl_test libucl_test-libucl_test.o libucl_test-rtpp_arh_conf.o libucl_test-rtpp_ucl.o libucl_test-rtpp_memdeb.o libucl_test-rtpp_memdeb_glitch.o  libucl_debug.a ../libexecinfo/libexecinfo.a -ldl -lrt
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g -O2 -MT libucl_a-ucl_emitter_streamline.o -MD -MP -MF .deps/libucl_a-ucl_emitter_streamline.Tpo -c -o libucl_a-ucl_emitter_streamline.o `test -f '../external/libucl/src/ucl_emitter_streamline.c' || echo './'`../external/libucl/src/ucl_emitter_streamline.c
mv -f .deps/libucl_a-ucl_emitter_streamline.Tpo .deps/libucl_a-ucl_emitter_streamline.Po
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g -O2 -MT libucl_a-ucl_emitter_utils.o -MD -MP -MF .deps/libucl_a-ucl_emitter_utils.Tpo -c -o libucl_a-ucl_emitter_utils.o `test -f '../external/libucl/src/ucl_emitter_utils.c' || echo './'`../external/libucl/src/ucl_emitter_utils.c
mv -f .deps/libucl_a-ucl_emitter_utils.Tpo .deps/libucl_a-ucl_emitter_utils.Po
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g -O2 -MT libucl_a-ucl_emitter.o -MD -MP -MF .deps/libucl_a-ucl_emitter.Tpo -c -o libucl_a-ucl_emitter.o `test -f '../external/libucl/src/ucl_emitter.c' || echo './'`../external/libucl/src/ucl_emitter.c
mv -f .deps/libucl_a-ucl_emitter.Tpo .deps/libucl_a-ucl_emitter.Po
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g -O2 -MT libucl_a-ucl_hash.o -MD -MP -MF .deps/libucl_a-ucl_hash.Tpo -c -o libucl_a-ucl_hash.o `test -f '../external/libucl/src/ucl_hash.c' || echo './'`../external/libucl/src/ucl_hash.c
mv -f .deps/libucl_a-ucl_hash.Tpo .deps/libucl_a-ucl_hash.Po
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g -O2 -MT libucl_a-ucl_msgpack.o -MD -MP -MF .deps/libucl_a-ucl_msgpack.Tpo -c -o libucl_a-ucl_msgpack.o `test -f '../external/libucl/src/ucl_msgpack.c' || echo './'`../external/libucl/src/ucl_msgpack.c
mv -f .deps/libucl_a-ucl_msgpack.Tpo .deps/libucl_a-ucl_msgpack.Po
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g -O2 -MT libucl_a-ucl_parser.o -MD -MP -MF .deps/libucl_a-ucl_parser.Tpo -c -o libucl_a-ucl_parser.o `test -f '../external/libucl/src/ucl_parser.c' || echo './'`../external/libucl/src/ucl_parser.c
../external/libucl/src/ucl_parser.c: In function âucl_parser_register_macroâ:
../external/libucl/src/ucl_parser.c:2572:2: warning: implicit declaration of function âstrdupâ [-Wimplicit-function-declaration]
  new->name = strdup (macro);
  ^
../external/libucl/src/ucl_parser.c:2572:12: warning: assignment makes pointer from integer without a cast
  new->name = strdup (macro);
            ^
../external/libucl/src/ucl_parser.c: In function âucl_parser_register_context_macroâ:
../external/libucl/src/ucl_parser.c:2599:12: warning: assignment makes pointer from integer without a cast
  new->name = strdup (macro);
            ^
../external/libucl/src/ucl_parser.c: In function âucl_parser_register_variableâ:
../external/libucl/src/ucl_parser.c:2649:13: warning: assignment makes pointer from integer without a cast
    new->var = strdup (var);
             ^
../external/libucl/src/ucl_parser.c:2651:15: warning: assignment makes pointer from integer without a cast
    new->value = strdup (value);
               ^
../external/libucl/src/ucl_parser.c:2658:15: warning: assignment makes pointer from integer without a cast
    new->value = strdup (value);
               ^
mv -f .deps/libucl_a-ucl_parser.Tpo .deps/libucl_a-ucl_parser.Po
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g -O2 -MT libucl_a-ucl_schema.o -MD -MP -MF .deps/libucl_a-ucl_schema.Tpo -c -o libucl_a-ucl_schema.o `test -f '../external/libucl/src/ucl_schema.c' || echo './'`../external/libucl/src/ucl_schema.c
mv -f .deps/libucl_a-ucl_schema.Tpo .deps/libucl_a-ucl_schema.Po
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g -O2 -MT libucl_a-ucl_sexp.o -MD -MP -MF .deps/libucl_a-ucl_sexp.Tpo -c -o libucl_a-ucl_sexp.o `test -f '../external/libucl/src/ucl_sexp.c' || echo './'`../external/libucl/src/ucl_sexp.c
mv -f .deps/libucl_a-ucl_sexp.Tpo .deps/libucl_a-ucl_sexp.Po
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -Wno-pointer-sign -std=c99 -DHAVE_CONFIG_H -I../external/libucl/include -I../external/libucl/uthash -I../external/libucl/klib -I../external/libucl/src/ -Wno-unused-parameter -g -O2 -MT libucl_a-ucl_util.o -MD -MP -MF .deps/libucl_a-ucl_util.Tpo -c -o libucl_a-ucl_util.o `test -f '../external/libucl/src/ucl_util.c' || echo './'`../external/libucl/src/ucl_util.c
../external/libucl/src/ucl_util.c: In function âucl_include_file_singleâ:
../external/libucl/src/ucl_util.c:996:2: warning: implicit declaration of function ârealpathâ [-Wimplicit-function-declaration]
  if (ucl_realpath (filebuf, realbuf) == NULL) {
  ^
../external/libucl/src/ucl_util.c:996:38: warning: comparison between pointer and integer
  if (ucl_realpath (filebuf, realbuf) == NULL) {
                                      ^
../external/libucl/src/ucl_util.c:1059:2: warning: implicit declaration of function âstrdupâ [-Wimplicit-function-declaration]
  parser->cur_file = strdup (realbuf);
  ^
../external/libucl/src/ucl_util.c:1059:19: warning: assignment makes pointer from integer without a cast
  parser->cur_file = strdup (realbuf);
                   ^
../external/libucl/src/ucl_util.c: In function âucl_parser_set_filevarsâ:
../external/libucl/src/ucl_util.c:1837:41: warning: comparison between pointer and integer
    if (ucl_realpath (filename, realbuf) == NULL) {
                                         ^
../external/libucl/src/ucl_util.c: In function âucl_parser_add_file_fullâ:
../external/libucl/src/ucl_util.c:1870:39: warning: comparison between pointer and integer
  if (ucl_realpath (filename, realbuf) == NULL) {
                                       ^
../external/libucl/src/ucl_util.c:1884:19: warning: assignment makes pointer from integer without a cast
  parser->cur_file = strdup (realbuf);
                   ^
../external/libucl/src/ucl_util.c: In function âucl_object_copy_internalâ:
../external/libucl/src/ucl_util.c:3459:36: warning: assignment makes pointer from integer without a cast
    new->trash_stack[UCL_TRASH_KEY] =
                                    ^
../external/libucl/src/ucl_util.c:3466:38: warning: assignment makes pointer from integer without a cast
    new->trash_stack[UCL_TRASH_VALUE] =
                                      ^
mv -f .deps/libucl_a-ucl_util.Tpo .deps/libucl_a-ucl_util.Po
rm -f libucl.a
ar cru libucl.a libucl_a-ucl_emitter_streamline.o libucl_a-ucl_emitter_utils.o libucl_a-ucl_emitter.o libucl_a-ucl_hash.o libucl_a-ucl_msgpack.o libucl_a-ucl_parser.o libucl_a-ucl_schema.o libucl_a-ucl_sexp.o libucl_a-ucl_util.o
ranlib libucl.a
make[1]: Leaving directory `/usr/local/src/rtpproxy/libucl'
Making all in makeann
make[1]: Entering directory `/usr/local/src/rtpproxy/makeann'
gcc -Wall -DHAVE_CONFIG_H -I. -I../src  -I../extractaudio -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -std=gnu99 -Wall -Wno-uninitialized -g -O2 -MT makeann-makeann.o -MD -MP -MF .deps/makeann-makeann.Tpo -c -o makeann-makeann.o `test -f 'makeann.c' || echo './'`makeann.c
In file included from makeann.c:69:0:
../src/rtp.h:74:3: error: #error "BYTE_ORDER needs to be defined"
 # error "BYTE_ORDER needs to be defined"
   ^
makeann.c: In function âmainâ:
makeann.c:99:9: warning: variable âvad_enableâ set but not used [-Wunused-but-set-variable]
     int vad_enable;
         ^
make[1]: *** [makeann-makeann.o] Error 1
make[1]: Leaving directory `/usr/local/src/rtpproxy/makeann'
make: *** [all-recursive] Error 1

That is as far as I got, and can't figure out how to resolve this last error (assuming this the correct troubleshooting path to take!)

@sobomax
Copy link
Member

sobomax commented Jun 11, 2019

@solarmon this looks like a really weird one. Are you sure the system you are building on is not impaired in any way? random() is an integral part of C/Posix, if your system cannot compile it there must be something wrong with it. I mean WRONG BIG WAY. 👎 Check this link, it mandates stdlib.h, and that's exactly what that file does.

@sobomax
Copy link
Member

sobomax commented Jun 11, 2019

Oh, folks, also I did not realize but you cannot compile with gcc 4.9 anymore as of few months ago. We fell in love C++11 atomics. Seriously, it's 2019 for god's sake! Get a real compiler. :)

@sobomax
Copy link
Member

sobomax commented Jun 11, 2019

On a more serious note, we'll add documentation and autoconf check for a compiler version (gcc 5+ is a must these days with master/2.2), thanks for a reminder! Frankly I resisted dropping old gcc compilers, but it's just too much pain for virtually zero gain.

@solarmon
Copy link
Author

@solarmon this looks like a really weird one. Are you sure the system you are building on is not impaired in any way? random() is an integral part of C/Posix, if your system cannot compile it there must be something wrong with it. I mean WRONG BIG WAY. 👎 Check this link, it mandates stdlib.h, and that's exactly what that file does.

@sobomax

I also use this same machine to build opensips from git source, using gcc 4.9 - so I don't think there is anything majorly wrong/impaired with it, not from understanding anyways.

@sobomax
Copy link
Member

sobomax commented Jun 11, 2019

@solarmon this looks like a really weird one. Are you sure the system you are building on is not impaired in any way? random() is an integral part of C/Posix, if your system cannot compile it there must be something wrong with it. I mean WRONG BIG WAY. 👎 Check this link, it mandates stdlib.h, and that's exactly what that file does.

@sobomax

I also use this same machine to build opensips from git source, using gcc 4.9 - so I don't think there is anything majorly wrong/impaired with it, not from understanding anyways.

@solarmon see my later comment. We've dropped gcc 4.9 support few months ago (with great reluctance, but it's pretty much final and not coming back), so please try upgrading your suite to 5+, retry and report. 4.9 actually almost made it, stdatomics were kinda supported at that point, but not really.

sobomax added a commit that referenced this issue Jun 11, 2019
@solarmon
Copy link
Author

solarmon commented Jun 11, 2019

@sobomax

I updated gcc to 7.3 - as per https://stackoverflow.com/questions/36327805/how-to-install-gcc-5-3-with-yum-on-centos-7-2:

# gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I deleted and redownloaded the rtpproxy git repository.

However, make is still failing with same error:

# make
Making all in libexecinfo
make[1]: Entering directory `/usr/local/src/rtpproxy/libexecinfo'
gcc -DHAVE_CONFIG_H -I. -I../src  -Werror=implicit-function-declaration -Wall -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_check-execinfo_check.o -MD -MP -MF .deps/execinfo_check-execinfo_check.Tpo -c -o execinfo_check-execinfo_check.o `test -f 'execinfo_check.c' || echo './'`execinfo_check.c
mv -f .deps/execinfo_check-execinfo_check.Tpo .deps/execinfo_check-execinfo_check.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -Werror=implicit-function-declaration -Wall -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_check-execinfo_testfunc.o -MD -MP -MF .deps/execinfo_check-execinfo_testfunc.Tpo -c -o execinfo_check-execinfo_testfunc.o `test -f 'execinfo_testfunc.c' || echo './'`execinfo_testfunc.c
mv -f .deps/execinfo_check-execinfo_testfunc.Tpo .deps/execinfo_check-execinfo_testfunc.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -Werror=implicit-function-declaration -Wall -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_check-execinfo_testfunc1.o -MD -MP -MF .deps/execinfo_check-execinfo_testfunc1.Tpo -c -o execinfo_check-execinfo_testfunc1.o `test -f 'execinfo_testfunc1.c' || echo './'`execinfo_testfunc1.c
execinfo_testfunc1.c: In function âtestfunc1â:
execinfo_testfunc1.c:38:9: error: implicit declaration of function ârandomâ; did you mean ârand_râ? [-Werror=implicit-function-declaration]
   rnd = random() % 1024;
         ^~~~~~
         rand_r
cc1: some warnings being treated as errors
make[1]: *** [execinfo_check-execinfo_testfunc1.o] Error 1
make[1]: Leaving directory `/usr/local/src/rtpproxy/libexecinfo'
make: *** [all-recursive] Error 1

How do I verify my environment is OK? configure did not seem to pick up any issues?:

# ./configure
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld
checking if the linker (/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /opt/rh/devtoolset-7/root/usr/bin/nm -B
checking the name lister (/opt/rh/devtoolset-7/root/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /opt/rh/devtoolset-7/root/usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking size of time_t... 8
checking for dlfcn.h... (cached) yes
checking for dladdr in -ldl... yes
checking gsm.h usability... no
checking gsm.h presence... no
checking for gsm.h... no
checking g729_encoder.h usability... no
checking g729_encoder.h presence... no
checking for g729_encoder.h... no
checking bcg729/encoder.h usability... no
checking bcg729/encoder.h presence... no
checking for bcg729/encoder.h... no
checking g722.h usability... no
checking g722.h presence... no
checking for g722.h... no
checking sndfile.h usability... yes
checking sndfile.h presence... yes
checking for sndfile.h... yes
checking for sf_open in -lsndfile... yes
checking srtp/srtp.h usability... no
checking srtp/srtp.h presence... no
checking for srtp/srtp.h... no
checking srtp2/srtp.h usability... no
checking srtp2/srtp.h presence... no
checking for srtp2/srtp.h... no
checking elperiodic.h usability... no
checking elperiodic.h presence... no
checking for elperiodic.h... no
checking siplog.h usability... no
checking siplog.h presence... no
checking for siplog.h... no
checking stdatomic.h usability... yes
checking stdatomic.h presence... yes
checking for stdatomic.h... yes
checking for ANSI C header files... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking endian.h usability... yes
checking endian.h presence... yes
checking for endian.h... yes
checking sys/endian.h usability... no
checking sys/endian.h presence... no
checking for sys/endian.h... no
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
checking for struct sockaddr_un.sun_len... no
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking return type of signal handlers... void
checking for atexit... yes
checking for gettimeofday... yes
checking for memset... yes
checking for mkdir... yes
checking for socket... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strlcpy... no
checking for clock_gettime... yes
checking for rdtsc... yes
checking for __sync_fetch_and_add... yes
checking for xsltproc... /bin/xsltproc
checking for Docbook DTD version 4.5... yes
checking for fop... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating makeann/Makefile
config.status: creating tests/Makefile
config.status: creating extractaudio/Makefile
config.status: creating libexecinfo/Makefile
config.status: creating modules/Makefile
config.status: creating modules/acct_csv/Makefile
config.status: creating modules/acct_rtcp_hep/Makefile
config.status: creating pertools/Makefile
config.status: creating pertools/udp_contention/Makefile
config.status: creating libucl/Makefile
config.status: creating python/sippy_lite/sippy/Time/clock_dtime.py
config.status: creating doc/Makefile
config.status: creating src/config.h
config.status: src/config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
=== configuring in libelperiodic (/usr/local/src/rtpproxy/libelperiodic)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld
checking if the linker (/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /opt/rh/devtoolset-7/root/usr/bin/nm -B
checking the name lister (/opt/rh/devtoolset-7/root/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /opt/rh/devtoolset-7/root/usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for ranlib... (cached) ranlib
checking for clock_gettime... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: executing depfiles commands
config.status: executing libtool commands

@kurtyan
Copy link

kurtyan commented Jun 12, 2019

I have same problem with @solarmon here: upgraded gcc but still getting an error when running make.

GCC version:

gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Error when running make, mostly same with @solarmon 's:

make
Making all in libexecinfo
make[1]: Entering directory `/home/admin/rtp_workspace/rtpproxy/libexecinfo'
gcc -DHAVE_CONFIG_H -I. -I../src  -Werror=implicit-function-declaration -Wall -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_check-execinfo_testfunc1.o -MD -MP -MF .deps/execinfo_check-execinfo_testfunc1.Tpo -c -o execinfo_check-execinfo_testfunc1.o `test -f 'execinfo_testfunc1.c' || echo './'`execinfo_testfunc1.c
execinfo_testfunc1.c: In function ‘testfunc1’:
execinfo_testfunc1.c:38:9: error: implicit declaration of function ‘random’; did you mean ‘rand_r’? [-Werror=implicit-function-declaration]
   rnd = random() % 1024;
         ^~~~~~
         rand_r
cc1: some warnings being treated as errors
make[1]: *** [execinfo_check-execinfo_testfunc1.o] Error 1
make[1]: Leaving directory `/home/admin/rtp_workspace/rtpproxy/libexecinfo'
make: *** [all-recursive] Error 1

To check if it's due to lacking of stdlib.h, I tried to write and compile following code, which passed the gcc compilation and got to run properly.

#include<stdlib.h>
#include<stdio.h>

int main() {
  printf("Random is: %i\n", random());
}

Any ideas?

@sobomax
Copy link
Member

sobomax commented Jun 12, 2019 via email

@solarmon
Copy link
Author

@sobomax Hi, did you have any luck with trying to figure out what the issue is?

@sobomax
Copy link
Member

sobomax commented Jul 3, 2019

@solarmon found CentOS 7.2 in my collection of weird VMs. Trying to dust it off and figure out how the heck you managed to run gcc 5 on this thing. 8-)

@solarmon
Copy link
Author

solarmon commented Jul 4, 2019

@sobomax

I updated gcc to 7.3 - using the guide at https://stackoverflow.com/questions/36327805/how-to-install-gcc-5-3-with-yum-on-centos-7-2

I do find that I need to use the following command to tell my setup to use the new gcc version, when I start a new session:

scl enable devtoolset-7 bash

sobomax added a commit that referenced this issue Jul 4, 2019
like we need those to make us compiling on ancient linuxes, such
as Centos 7.x.

Bug report:	#83
@sobomax
Copy link
Member

sobomax commented Jul 6, 2019

@solarmon bunch of changes went in to fix build on old-ish linuxes. Please check latest master and update.

@solarmon
Copy link
Author

solarmon commented Jul 8, 2019

@solarmon bunch of changes went in to fix build on old-ish linuxes. Please check latest master and update.

I wouldn't say CentOS 7.6 is old...

I downloading the latest rtpproxy github repository. However, with gcc 7.6 I'm now getting a "ucl.h: No such file or directory" error

Making all in libexecinfo
make[1]: Entering directory `/usr/local/src/rtpproxy/libexecinfo'
gcc -DHAVE_CONFIG_H -I. -I../src  -Werror=implicit-function-declaration -Wall -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_check-execinfo_check.o -MD -MP -MF .deps/execinfo_check-execinfo_check.Tpo -c -o execinfo_check-execinfo_check.o `test -f 'execinfo_check.c' || echo './'`execinfo_check.c
mv -f .deps/execinfo_check-execinfo_check.Tpo .deps/execinfo_check-execinfo_check.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -Werror=implicit-function-declaration -Wall -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_check-execinfo_testfunc.o -MD -MP -MF .deps/execinfo_check-execinfo_testfunc.Tpo -c -o execinfo_check-execinfo_testfunc.o `test -f 'execinfo_testfunc.c' || echo './'`execinfo_testfunc.c
mv -f .deps/execinfo_check-execinfo_testfunc.Tpo .deps/execinfo_check-execinfo_testfunc.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -Werror=implicit-function-declaration -Wall -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_check-execinfo_testfunc1.o -MD -MP -MF .deps/execinfo_check-execinfo_testfunc1.Tpo -c -o execinfo_check-execinfo_testfunc1.o `test -f 'execinfo_testfunc1.c' || echo './'`execinfo_testfunc1.c
mv -f .deps/execinfo_check-execinfo_testfunc1.Tpo .deps/execinfo_check-execinfo_testfunc1.Po
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libexecinfo_a-execinfo.o -MD -MP -MF .deps/libexecinfo_a-execinfo.Tpo -c -o libexecinfo_a-execinfo.o `test -f 'execinfo.c' || echo './'`execinfo.c
mv -f .deps/libexecinfo_a-execinfo.Tpo .deps/libexecinfo_a-execinfo.Po
gcc -DHAVE_CONFIG_H -I. -I../src   -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libexecinfo_a-stacktraverse.o -MD -MP -MF .deps/libexecinfo_a-stacktraverse.Tpo -c -o libexecinfo_a-stacktraverse.o `test -f 'stacktraverse.c' || echo './'`stacktraverse.c
mv -f .deps/libexecinfo_a-stacktraverse.Tpo .deps/libexecinfo_a-stacktraverse.Po
rm -f libexecinfo.a
ar cru libexecinfo.a libexecinfo_a-execinfo.o libexecinfo_a-stacktraverse.o
ranlib libexecinfo.a
/bin/sh ../libtool  --tag=CC   --mode=link gcc -g3 -O0 -fno-omit-frame-pointer -g -O2   -o execinfo_check execinfo_check-execinfo_check.o execinfo_check-execinfo_testfunc.o execinfo_check-execinfo_testfunc1.o libexecinfo.a -ldl -lpthread -lrt
libtool: link: gcc -g3 -O0 -fno-omit-frame-pointer -g -O2 -o execinfo_check execinfo_check-execinfo_check.o execinfo_check-execinfo_testfunc.o execinfo_check-execinfo_testfunc1.o  libexecinfo.a -ldl -lpthread -lrt
gcc -DHAVE_CONFIG_H -I. -I../src  -Werror=implicit-function-declaration -Wall -Dexecinfo_TEST=main -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_TEST-execinfo.o -MD -MP -MF .deps/execinfo_TEST-execinfo.Tpo -c -o execinfo_TEST-execinfo.o `test -f 'execinfo.c' || echo './'`execinfo.c
mv -f .deps/execinfo_TEST-execinfo.Tpo .deps/execinfo_TEST-execinfo.Po
gcc -DHAVE_CONFIG_H -I. -I../src  -Werror=implicit-function-declaration -Wall -Dexecinfo_TEST=main -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_TEST-stacktraverse.o -MD -MP -MF .deps/execinfo_TEST-stacktraverse.Tpo -c -o execinfo_TEST-stacktraverse.o `test -f 'stacktraverse.c' || echo './'`stacktraverse.c
mv -f .deps/execinfo_TEST-stacktraverse.Tpo .deps/execinfo_TEST-stacktraverse.Po
/bin/sh ../libtool  --tag=CC   --mode=link gcc -g3 -O0 -fno-omit-frame-pointer -g -O2   -o execinfo_TEST execinfo_TEST-execinfo.o execinfo_TEST-stacktraverse.o -ldl -lrt
libtool: link: gcc -g3 -O0 -fno-omit-frame-pointer -g -O2 -o execinfo_TEST execinfo_TEST-execinfo.o execinfo_TEST-stacktraverse.o  -ldl -lrt
make[1]: Leaving directory `/usr/local/src/rtpproxy/libexecinfo'
Making all in libucl
make[1]: Entering directory `/usr/local/src/rtpproxy/libucl'
gcc -DHAVE_CONFIG_H -I. -I../src  -DMODULE_IF_CODE -Dmod_strdup=strdup -DRTPP_MEMDEB_STDOUT -include rtpp_memdeb.h -I.. -DMEMDEB_APP=libucl_test -I../external/libucl/include -I../hepconnector -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT libucl_test-libucl_test.o -MD -MP -MF .deps/libucl_test-libucl_test.Tpo -c -o libucl_test-libucl_test.o `test -f 'libucl_test.c' || echo './'`libucl_test.c
libucl_test.c:10:10: fatal error: ucl.h: No such file or directory
 #include "ucl.h"
          ^~~~~~~
compilation terminated.
make[1]: *** [libucl_test-libucl_test.o] Error 1
make[1]: Leaving directory `/usr/local/src/rtpproxy/libucl'
make: *** [all-recursive] Error 1

I installed the 'ucl-devel' package via yum, and it put the files in /usr/include/ucl/ - which included ucl,h:

# ls  -la /usr/include/ucl/
total 64
drwxr-xr-x.   2 root root  4096 Jul  8 10:15 .
drwxr-xr-x. 102 root root 12288 Jul  8 10:15 ..
-rw-r--r--.   1 root root 16764 Mar  9  2018 ucl_asm.h
-rw-r--r--.   1 root root 15002 Mar  9  2018 uclconf.h
-rw-r--r--.   1 root root 11004 Mar  9  2018 ucl.h

However, this still did not resolve the "ucl.h: No such file or directory" error.

I'm not sure where it is trying to look for the ucl.h header file, but I also noticed that the included libucl directory with the rtpproxy source from github does not include a ucl.h and this is where the make is failing - when it enters "/usr/local/src/rtpproxy/libucl".

libucl]# ls -lah
total 176K
drwxr-x---.  3 root root 4.0K Jul  8 10:23 .
drwxr-x---. 25 root root 4.0K Jul  8 10:21 ..
drwxr-x---.  2 root root 4.0K Jul  8 10:01 .deps
-rw-r-----.  1 root root 6.0K Jul  8 10:01 libucl_test.c
-rw-r-----.  1 root root  69K Jul  8 10:21 Makefile
-rw-r-----.  1 root root 1.3K Jul  8 10:01 Makefile.am
-rw-r-----.  1 root root  77K Jul  8 10:01 Makefile.in

Any suggestions?

@solarmon
Copy link
Author

@sobomax

Sorry to bump this, but do you have any other suggestions on how to resolve this build issue?

@demonspork
Copy link

@solarmon
I had to do this after cloning it and it compiled just fine.
git -C rtpproxy submodule update --init --recursive

@solarmon
Copy link
Author

@demonspork

Thanks. I did actually have that already as part of my build steps.

I tried again following the same build notes I had previously. I don't know if something has been updated/fixed in the master repository since my last attempt, but this time the make completed!

@staneychan
Copy link

@sobomax @demonspork

I have built the code done on centOS 7.4 with gcc 7.3
Update the latest code till 1/7/2020

Update the devtool:
yum -y install centos-release-scl
yum -y install devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils

Then enable the gcc 7.3 for current seesion:
scl enable devtoolset-7 bash
Build it...

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

7 participants