herlesupreeth / kamailio

Kamailio - The Open Source SIP Server for large VoIP and real-time communication platforms -
https://www.kamailio.org
Other
16 stars 18 forks source link

gcc version check error #9

Open Mozartor2 opened 9 months ago

Mozartor2 commented 9 months ago

open5gs@open5gs:/usr/local/src/kamailio$ sudo make cfg
make -C src/ cfg
make[1]: 进入目录“/usr/local/src/kamailio/src”
/bin/sh: 1: pkg-config: not found
target architecture <x86_64>, host architecture <x86_64>
Makefile.defs:1061: You are using an old and unsupported gcc version  (1.4.x), compile at your own risk!
making config...
rm -f modules.lst
make --no-print-directory modules.lst
saving modules list...
make[1]: 离开目录“/usr/local/src/kamailio/src”
open5gs@open5gs:/usr/local/src/kamailio$ gcc  -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

The function of detecting the gcc version in the makefile does not check the scenario of a version higher than gcc 9.0+.


#x86_64
ifeq    ($(ARCH), x86_64)
                # if gcc
ifeq            ($(CC_NAME), gcc)
                                C_DEFS+=-DCC_GCC_LIKE_ASM
                                #common stuff
                                CFLAGS=-g $(CC_OPT) -funroll-loops  -Wcast-align $(PROFILE)
                        #if gcc 4.5+
ifeq                    ($(CC_SHORTVER),$(filter $(CC_SHORTVER),4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+))
$(call                          set_if_empty,CPUTYPE,generic)
                                        CFLAGS+=-m64 -minline-all-stringops \
                                                        -falign-loops \
                                                        -ftree-vectorize \
                                                        -fno-strict-overflow \
                                                        -mtune=$(CPUTYPE)
                                        LDFLAGS+=-m64
else
                        #if gcc 4.0+
ifeq                    ($(CC_SHORTVER), 4.x)
$(call                          set_if_empty,CPUTYPE,athlon64)
                                        CFLAGS+=-m64 -minline-all-stringops \
                                                        -falign-loops \
                                                        -ftree-vectorize \
                                                        -mtune=$(CPUTYPE)
                                        LDFLAGS+=-m64
else
                        #if gcc 3.4
ifeq                    ($(CC_SHORTVER), 3.4)
$(call                          set_if_empty,CPUTYPE,athlon64)
                                        CFLAGS+=-m64 -minline-all-stringops \
                                                        -falign-loops
                                        LDFLAGS+=-m64
else
                        #if gcc 3.0
ifeq                    ($(CC_SHORTVER), 3.0)
$(call                          set_if_empty,CPUTYPE,athlon64)
                                        CFLAGS+=-minline-all-stringops \
                                                        -falign-loops
                                                        #-mcpu=$(CPUTYPE) \ # not working on all x86_64 gccs
                                                        #-mcpu=athlon
                                        #-m64 on x86_64/x86 works starting with gcc 3.2
else
ifeq                    ($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5])
$(warning                       Old gcc detected ($(CC_SHORTVER)), use  gcc >= 3.1 \
                                        for better results)

                                        CFLAGS+=-m486 \
                                                        -malign-loops=4
else
                                #really old version
$(warning                       You are using an old and unsupported gcc \
                                         version  ($(CC_SHORTVER)), compile at your own risk!)
herlesupreeth commented 9 months ago

hmm..I am not familiar with Makefile or make compilation in general. May I know which branch you are using? I would recommend using upstream_master branch. And, if you still face the same error there I would suggest raising an issue in upstream kamailio repo as the experts there would have better idea about the error