pjsip / pjproject

PJSIP project
http://www.pjsip.org
GNU General Public License v2.0
2.07k stars 786 forks source link

Correct CPU (compiler) features detection during cross-compile #4150

Closed aol-nnov closed 1 week ago

aol-nnov commented 1 week ago

Describe the bug

While cross-compiling cpu features (like neon, sse2, etc.) are not properly detected, which leads to compilation failures.

Steps to reproduce

Compile pjsip on linux amd64 for armhf

PJSIP version

2.14.1

Context

Debian 12 amd64 with cross-compiler for armhf

Log, call stack, etc

../../webrtc/src/webrtc//common_audio/signal_processing/vector_scaling_operations.c 
arm-linux-gnueabihf-gcc -Wall -DPJ_AUTOCONF=1 -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/builds/foreign/telephony/pjsip=. -fstack-protector-strong -Wformat -Werror=format-security -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -fPIC -Iyes/include -Iyes/include -Iyes/include -Iyes/include   -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/builds/foreign/telephony/pjsip=. -fstack-protector-strong -Wformat -Werror=format-security -I. -I../../webrtc/src -I../../../pjlib/include -fexceptions -DWEBRTC_POSIX=1  \
    -c -o output/libwebrtc-arm-unknown-linux-gnueabihf/modules/audio_processing/aec/aec_core_sse2.o \
    ../../webrtc/src/webrtc//modules/audio_processing/aec/aec_core_sse2.c 
arm-linux-gnueabihf-gcc -Wall -DPJ_AUTOCONF=1 -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/builds/foreign/telephony/pjsip=. -fstack-protector-strong -Wformat -Werror=format-security -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -fPIC -Iyes/include -Iyes/include -Iyes/include -Iyes/include   -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/builds/foreign/telephony/pjsip=. -fstack-protector-strong -Wformat -Werror=format-security -I. -I../../webrtc/src -I../../../pjlib/include -fexceptions -DWEBRTC_POSIX=1  \
    -c -o output/libwebrtc-arm-unknown-linux-gnueabihf/modules/audio_processing/aec/aec_rdft_sse2.o \
    ../../webrtc/src/webrtc//modules/audio_processing/aec/aec_rdft_sse2.c 
arm-linux-gnueabihf-gcc -Wall -DPJ_AUTOCONF=1 -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/builds/foreign/telephony/pjsip=. -fstack-protector-strong -Wformat -Werror=format-security -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -fPIC -Iyes/include -Iyes/include -Iyes/include -Iyes/include   -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/builds/foreign/telephony/pjsip=. -fstack-protector-strong -Wformat -Werror=format-security -I. -I../../webrtc/src -I../../../pjlib/include -fexceptions -DWEBRTC_POSIX=1  \
    -c -o output/libwebrtc-arm-unknown-linux-gnueabihf/modules/audio_processing/aecm/aecm_core_c.o \
    ../../webrtc/src/webrtc//modules/audio_processing/aecm/aecm_core_c.c 
../../webrtc/src/webrtc//modules/audio_processing/aec/aec_core_sse2.c:15:10: fatal error: emmintrin.h: No such file or directory
   15 | #include <emmintrin.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[5]: *** [/builds/foreign/telephony/pjsip/build/rules.mak:163: output/libwebrtc-arm-unknown-linux-gnueabihf/modules/audio_processing/aec/aec_core_sse2.o] Error 1
make[5]: *** Waiting for unfinished jobs....
../../webrtc/src/webrtc//modules/audio_processing/aec/aec_rdft_sse2.c:13:10: fatal error: emmintrin.h: No such file or directory
   13 | #include <emmintrin.h>
      |          ^~~~~~~~~~~~~
compilation terminated.