ossrs/srs

Ubuntu20.04 compilation error ::gettimeofday

huanghe2015 opened this issue · 11 comments

Description'

Please ensure that you maintain the markdown structure.

Please describe the issue you encountered here.
'
Make sure to maintain the markdown structure.

  1. SRS version: 3.0-b4
  2. The log for SRS is as follows:
make[1]: Entering directory "/home/ak88/Documents/srs-3.0-b4/trunk
Build the srs(simple rtmp server) over ST(state-threads)
make -f objs/Makefile srs
make[2]: Entering directory "/home/ak88/Documents/srs-3.0-b4/trunk
g++ -c -ansi -Wall -g -O0 \
          -Isrc/kernel -Isrc/core -Iobjs \
          -o objs/src/kernel/srs_kernel_utility.o src/kernel/srs_kernel_utility.cpp
src/kernel/srs_kernel_utility.cpp:128:43: error: invalid conversion from 'int (*)(timeval*, void*) throw ()' {aka 'int (*)(timeval*, void*)'} to '_srs_gettimeofday_t' {aka 'int (*)(timeval*, timezone*)'}' [-fpermissive]

128 | _srs_gettimeofday_t _srs_gettimeofday = ::gettimeofday;
| ~~^~~~~~~~~~~~
| |
| int ()(timeval, void*) throw () {aka int ()(timeval, void*)}

make[2]: *** [objs/Makefile:77: objs/src/kernel/srs_kernel_utility.o] Error 1
make[2]: Leaving directory '/home/ak88/Documents/srs-3.0-b4/trunk'
make[1]: *** [Makefile:75: server] Error 2
make[1]: Leaving directory '/home/ak88/Documents/srs-3.0-b4/trunk'
make: *** [Makefile:10: default] Error 2
1. The configuration of SRS is as follows (Config):
./configure --full --use-sys-ssl && make
**Replay**
> How to replay the bug?
  1. Ubuntu 20.04
  2. GCC 9.3.0

TRANS_BY_GPT3

I encountered the following error when compiling on Ubuntu.

./configure
User config: --x86-x64
Detail config: --prefix=/usr/local/srs --with-hls --with-hds --with-dvr --with-ssl --with-transcode --with-ingest --with-stat --with-http-callback --with-http-server --with-stream-caster --with-http-api --with-librtmp --without-research --without-utest --without-gperf --without-gmc --without-gmd --without-gmp --without-gcp --without-gprof --log-trace --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib
SRS_WORKDIR: ., SRS_OBJS_DIR: objs, SRS_OBJS: ./objs, SRS_PLATFORM: Platform-Linux-5.4.0-SRS3
Fast cleanup, if need to do full cleanup, please use: make clean
Checking gcc/g++/gdb/make.
Required tools are ok.
Installing tools for Ubuntu.
Tools for Ubuntu are installed.
SED is sed_utility
The state-threads is ok.
CherryPy-3.2.4 is ok.
Link players to cherrypy static-dir
Building openssl-1.1.0e.
Operating system: x86_64-whatever-linux2
"glob" is not exported by the File::Glob module
Can't continue after import errors at ./Configure line 17.
BEGIN failed--compilation aborted at ./Configure line 17.
"glob" is not exported by the File::Glob module
Can't continue after import errors at ./Configure line 17.
BEGIN failed--compilation aborted at ./Configure line 17.
This system (linux-x86_64) is not supported. See file INSTALL for details.
make: *** No targets specified and no makefile found. Stop.
Build openssl-1.1.0e failed, ret=2

TRANS_BY_GPT3

I encountered the following error when compiling on Ubuntu.

./configure
User config: --x86-x64
Detail config: --prefix=/usr/local/srs --with-hls --with-hds --with-dvr --with-ssl --with-transcode --with-ingest --with-stat --with-http-callback --with-http-server --with-stream-caster --with-http-api --with-librtmp --without-research --without-utest --without-gperf --without-gmc --without-gmd --without-gmp --without-gcp --without-gprof --log-trace --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib
SRS_WORKDIR: ., SRS_OBJS_DIR: objs, SRS_OBJS: ./objs, SRS_PLATFORM: Platform-Linux-5.4.0-SRS3
Fast cleanup, if need to do full cleanup, please use: make clean
Checking gcc/g++/gdb/make.
Required tools are ok.
Installing tools for Ubuntu.
Tools for Ubuntu are installed.
SED is sed_utility
The state-threads is ok.
CherryPy-3.2.4 is ok.
Link players to cherrypy static-dir
Building openssl-1.1.0e.
Operating system: x86_64-whatever-linux2
"glob" is not exported by the File::Glob module
Can't continue after import errors at ./Configure line 17.
BEGIN failed--compilation aborted at ./Configure line 17.
"glob" is not exported by the File::Glob module
Can't continue after import errors at ./Configure line 17.
BEGIN failed--compilation aborted at ./Configure line 17.
This system (linux-x86_64) is not supported. See file INSTALL for details.
make: *** No targets specified and no makefile found. Stop.
Build openssl-1.1.0e failed, ret=2

This is an OpenSSL issue and has nothing to do with SRS.

TRANS_BY_GPT3

I encountered the following error when compiling on Ubuntu.
./configure
User config: --x86-x64
Detail config: --prefix=/usr/local/srs --with-hls --with-hds --with-dvr --with-ssl --with-transcode --with-ingest --with-stat --with-http-callback --with-http-server --with-stream-caster --with-http-api --with-librtmp --without-research --without-utest --without-gperf --without-gmc --without-gmd --without-gmp --without-gcp --without-gprof --log-trace --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib
SRS_WORKDIR: ., SRS_OBJS_DIR: objs, SRS_OBJS: ./objs, SRS_PLATFORM: Platform-Linux-5.4.0-SRS3
Fast cleanup, if need to do full cleanup, please use: make clean
Checking gcc/g++/gdb/make.
Required tools are ok.
Installing tools for Ubuntu.
Tools for Ubuntu are installed.
SED is sed_utility
The state-threads is ok.
CherryPy-3.2.4 is ok.
Link players to cherrypy static-dir
Building openssl-1.1.0e.
Operating system: x86_64-whatever-linux2
"glob" is not exported by the File::Glob module
Can't continue after import errors at ./Configure line 17.
BEGIN failed--compilation aborted at ./Configure line 17.
"glob" is not exported by the File::Glob module
Can't continue after import errors at ./Configure line 17.
BEGIN failed--compilation aborted at ./Configure line 17.
This system (linux-x86_64) is not supported. See file INSTALL for details.
make: *** No targets specified and no makefile found. Stop.
Build openssl-1.1.0e failed, ret=2

This is an OpenSSL issue, unrelated to SRS.

How should it be resolved?

TRANS_BY_GPT3

I encountered the following error when compiling on Ubuntu.
./configure
User config: --x86-x64
Detail config: --prefix=/usr/local/srs --with-hls --with-hds --with-dvr --with-ssl --with-transcode --with-ingest --with-stat --with-http-callback --with-http-server --with-stream-caster --with-http-api --with-librtmp --without-research --without-utest --without-gperf --without-gmc --without-gmd --without-gmp --without-gcp --without-gprof --log-trace --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib
SRS_WORKDIR: ., SRS_OBJS_DIR: objs, SRS_OBJS: ./objs, SRS_PLATFORM: Platform-Linux-5.4.0-SRS3
Fast cleanup, if need to do full cleanup, please use: make clean
Checking gcc/g++/gdb/make.
Required tools are ok.
Installing tools for Ubuntu.
Tools for Ubuntu are installed.
SED is sed_utility
The state-threads is ok.
CherryPy-3.2.4 is ok.
Link players to cherrypy static-dir
Building openssl-1.1.0e.
Operating system: x86_64-whatever-linux2
"glob" is not exported by the File::Glob module
Can't continue after import errors at ./Configure line 17.
BEGIN failed--compilation aborted at ./Configure line 17.
"glob" is not exported by the File::Glob module
Can't continue after import errors at ./Configure line 17.
BEGIN failed--compilation aborted at ./Configure line 17.
This system (linux-x86_64) is not supported. See file INSTALL for details.
make: *** No targets specified and no makefile found. Stop.
Build openssl-1.1.0e failed, ret=2

This is an OpenSSL issue and has nothing to do with SRS.

How should it be resolved?

  • Replace the OpenSSL package, modify the compilation script, or use the system's built-in OpenSSL like I did.

TRANS_BY_GPT3

Description
'
Make sure to maintain the markdown structure.

Please describe your issue here.
'
Make sure to maintain the markdown structure.

  1. SRS version: 3.0-b4
  2. The log of SRS is as follows:

make[1]: Entering directory "/home/ak88/Documents/srs-3.0-b4/trunk
Build the srs(simple rtmp server) over ST(state-threads)
make -f objs/Makefile srs
make[2]: Entering directory "/home/ak88/Documents/srs-3.0-b4/trunk
g++ -c -ansi -Wall -g -O0
-Isrc/kernel -Isrc/core -Iobjs
-o objs/src/kernel/srs_kernel_utility.o src/kernel/srs_kernel_utility.cpp
src/kernel/srs_kernel_utility.cpp:128:43: error: invalid conversion from 'int ()(timeval, void*) throw ()' {aka 'int ()(timeval, void*)'} to '_srs_gettimeofday_t' {aka 'int ()(timeval, timezone*)'} [-fpermissive]
128 | _srs_gettimeofday_t _srs_gettimeofday = ::gettimeofday;
| ~~^~~~~~~~~~~~
| |
| int ()(timeval, void*) throw () {aka int ()(timeval, void*)}
make[2]: *** [objs/Makefile:77: objs/src/kernel/srs_kernel_utility.o] Error 1
make[2]: Leaving directory '/home/ak88/Documents/srs-3.0-b4/trunk'
make[1]: *** [Makefile:75: server] Error 2
make[1]: Leaving directory '/home/ak88/Documents/srs-3.0-b4/trunk'
make: *** [Makefile:10: default] Error 2

  1. SRS configuration is as follows (Config):
./configure --full --use-sys-ssl && make

Replay

How to replay bug?

  1. Ubuntu 20.04
  2. GCC 9.3.0

_srs_gettimeofday_t _srs_gettimeofday = ::gettimeofday needs to be changed to _srs_gettimeofday_t _srs_gettimeofday = (_srs_gettimeofday_t)::gettimeofday.

TRANS_BY_GPT3

Next is OpenSSL, the next one.

TRANS_BY_GPT3

OpenSSL Usage Record:
#1812
#1813

TRANS_BY_GPT3

Firstly without utest

OpenSSL usage record:
#1812
#1813

Then modify the source file (src/kernel/srs_kernel_utility.cpp)

_srs_gettimeofday_t _srs_gettimeofday = ::gettimeofday needs to be changed to _srs_gettimeofday_t _srs_gettimeofday = (_srs_gettimeofday_t)::gettimeofday

The compilation passed, thank you very much to both of you.

TRANS_BY_GPT3

@HungMingWu @kentmay @huanghe2015 👍 The gettimeofday issue has been resolved. I have merged it: 13af54171

At the same time, I have set up a compilation environment for Ubuntu 20. You can directly use this image to compile SRS, and the resulting binary can be directly run on the machine: ossrs/srs:ubuntu20

Note: OpenSSL patch 968bb74c can also be applied to OpenSSL, but this requires a good understanding of the compilation process and is more difficult.

TRANS_BY_GPT3

The error I encountered when compiling on Ubuntu is as follows:

./configure
User config: --x86-x64
Detail config: --prefix=/usr/local/srs --with-hls --with-hds --with-dvr --with-ssl --with-transcode --with-ingest --with-stat --with-http-callback --with-http-server --with-stream-caster --with-http-api --with-librtmp --without-research --without-utest --without-gperf --without-gmc --without-gmd --without-gmp --without-gcp --without-gprof --log-trace --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib
SRS_WORKDIR: ., SRS_OBJS_DIR: objs, SRS_OBJS: ./objs, SRS_PLATFORM: Platform-Linux-5.4.0-SRS3
Fast cleanup, if need to do full cleanup, please use: make clean
Checking gcc/g++/gdb/make.
Required tools are ok.
Installing tools for Ubuntu.
Tools for Ubuntu are installed.
SED is sed_utility
The state-threads is ok.
CherryPy-3.2.4 is ok.
Link players to cherrypy static-dir
Building openssl-1.1.0e.
Operating system: x86_64-whatever-linux2
"glob" is not exported by the File::Glob module
Can't continue after import errors at ./Configure line 17.
BEGIN failed--compilation aborted at ./Configure line 17.
"glob" is not exported by the File::Glob module
Can't continue after import errors at ./Configure line 17.
BEGIN failed--compilation aborted at ./Configure line 17.
This system (linux-x86_64) is not supported. See file INSTALL for details.
make: *** No targets specified and no makefile found. Stop.
Build openssl-1.1.0e failed, ret=2

Please check the version of Perl.
On my Mac, I encountered this issue because I installed Perl v5.32.0 using Homebrew.
If I temporarily move /usr/local/bin/perl to /usr/local/bin/perl.bak and use the system's default Perl v5.18.4, the issue is resolved.

Currently, I found a potentially related mail-archive at https://www.mail-archive.com/openssl-commits@openssl.org/msg14057.html.

Due to my lack of familiarity with openssl and perl, I am unable to delve into further details at the moment.

By the way, @winlinvip, have you considered updating an openssl version that can be compiled properly under higher versions of perl?

TRANS_BY_GPT3

I am on Ubuntu 20.04.1, trying to download the 4.0 branch of git, but the "./configure" command failed.
I made a change in "trunk/auto/depends.sh":
Changed "OPENSSL_CANDIDATE="openssl-1.1.0e"" to "OPENSSL_CANDIDATE="openssl-OpenSSL_1_1_0l"".
Then I downloaded "openssl-OpenSSL_1_1_0l.zip" and placed it in "trunk/3rdparty/".
After that, the "./configure" command passed successfully.

TRANS_BY_GPT3