Commit cbcfd267 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into 2430-simplify-ivas_core_enc_fx

parents cd04e594 6d0d7634
Loading
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@ set(CMAKE_C_STANDARD 99)
if(UNIX)
  set(TARGET_PLATFORM ""  CACHE STRING "i686 / x86_64")
  set(CLANG           ""  CACHE STRING "1=msan / 2=asan / 3=usan")
  set(GCOV            OFF CACHE BOOL   "enable GCOV")
  set(MSAN_TRACK_ORIGINS OFF CACHE BOOL "enable origin tracking for Clang MSAN")
  set(COVERAGE            OFF CACHE BOOL   "enable coverage instrumentation")
  set(STRIP           OFF CACHE BOOL   "enable STRIP")

  if(NOT CMAKE_BUILD_TYPE)
@@ -62,13 +63,19 @@ if(UNIX)
  # to be uncommented in CI
  # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")

  # set C compiler
  find_program(cc NAMES clang-18 clang REQUIRED)
  set(CMAKE_C_COMPILER "${cc}" CACHE STRING "")

  # CLANG
  if(CLANG)
    find_program(clangBin NAMES /home/amm-archiv/soft/Linux/clang/current/bin/clang clang REQUIRED)
    set(CMAKE_C_COMPILER "${clangBin}" CACHE STRING "")
    if("${CLANG}" MATCHES "1" OR "${CLANG}" MATCHES "msan")
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory")
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=memory")
      if(MSAN_TRACK_ORIGINS)
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize-memory-track-origins")
        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize-memory-track-origins")
      endif()
    elseif("${CLANG}" MATCHES "2" OR "${CLANG}" MATCHES "asan")
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
@@ -89,8 +96,8 @@ if(UNIX)
      message(FATAL_ERROR "Unknown CLANG setting: ${CLANG}")
    endif()
  endif()
  # GCOV
  if(GCOV)
  # COVERAGE
  if(COVERAGE)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage -fprofile-update=atomic")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -fprofile-update=atomic")
  endif()
+23 −12
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ LIB_LC3PLUS ?= liblc3plus.a
LIB_LIBUTIL  	?= libivasutil.a

# Default tool settings
CC        ?= gcc
CC        ?= cc
RM        ?= rm -f
AR        ?= ar

@@ -65,32 +65,43 @@ endif
CFLAGS   += -std=c99 -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long     \
            -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes  \
            -Werror-implicit-function-declaration \
            -Wno-implicit-fallthrough -ffp-contract=off
            -Wno-implicit-fallthrough -ffp-contract=off \
            -Winit-self -Wunused-but-set-variable
# to be uncommented in CI
# CFLAGS += -Werror
CFLAGS += -Winit-self
CFLAGS += -Wunused-but-set-variable

# libs to link
LDLIBS   += -lm

# Clang sanitizer compiler options
CCCLANG = clang
ifeq "$(CLANG)" "0"
CC       = $(CCCLANG)
# check if clang is available on system and use it if it is there
CLANG_EXISTS := $(shell which clang)

ifneq "$(CLANG_EXISTS)" ""
CC = clang
else
$(warning clang compiler not found - falling back to cc)
endif

# Clang sanitizer compiler options
ifeq "$(CLANG)" "1"
CC       = $(CCCLANG)
CC       = clang
CFLAGS  += -fsanitize=memory
LDFLAGS += -fsanitize=memory

# can be set in call to make, e.g. "make CLANG=1 MSAN_TRACK_ORIGINS=1"
ifeq "$(MSAN_TRACK_ORIGINS)" "1"
CFLAGS  += -fsanitize-memory-track-origins
LDFLAGS += -fsanitize-memory-track-origins
endif

endif
ifeq "$(CLANG)" "2"
CC       = $(CCCLANG)
CC       = clang
CFLAGS  += -fsanitize=address
LDFLAGS += -fsanitize=address
endif
ifeq "$(CLANG)" "3"
CC       = $(CCCLANG) 
CC       = clang
# NOTE: keep in sync with list in CMakeLists.txt
usan_checks = undefined,float-divide-by-zero,implicit-conversion,local-bounds
CFLAGS  += -fsanitize=$(usan_checks)
@@ -114,7 +125,7 @@ CFLAGS += -g3
LDFLAGS  += -g3
endif

ifeq "$(GCOV)" "1"
ifeq "$(COVERAGE)" "1"
CFLAGS  += -fprofile-arcs -ftest-coverage -fprofile-update=atomic
LDFLAGS += -fprofile-arcs -ftest-coverage -fprofile-update=atomic
endif
+0 −13
Original line number Diff line number Diff line
@@ -165,7 +165,6 @@
    <ClCompile Include="..\lib_com\gain_inov_fx.c" />
    <ClCompile Include="..\lib_com\get_gain_fx.c" />
    <ClCompile Include="..\lib_com\gs_bitallocation_fx.c" />
    <ClCompile Include="..\lib_com\gs_bitallocation_ivas_fx.c" />
    <ClCompile Include="..\lib_com\gs_gains_fx.c" />
    <ClCompile Include="..\lib_com\gs_inact_switching_fx.c" />
    <ClCompile Include="..\lib_com\gs_noisefill_fx.c" />
@@ -285,20 +284,11 @@
    <ClCompile Include="..\lib_com\wtda_fx.c" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\lib_com\basop32.h" />
    <ClInclude Include="..\lib_com\basop_proto_func.h" />
    <ClInclude Include="..\lib_com\basop_settings.h" />
    <ClInclude Include="..\lib_com\basop_util.h" />
    <ClInclude Include="..\lib_com\cnst.h" />
    <ClInclude Include="..\lib_com\common_api_types.h" />
    <ClInclude Include="..\lib_com\complex_basop.h" />
    <ClInclude Include="..\lib_com\control.h" />
    <ClInclude Include="..\lib_com\count.h" />
    <ClInclude Include="..\lib_com\enh1632.h" />
    <ClInclude Include="..\lib_com\enh32.h" />
    <ClInclude Include="..\lib_com\enh40.h" />
    <ClInclude Include="..\lib_com\enh64.h" />
    <ClInclude Include="..\lib_com\enhUL32.h" />
    <ClInclude Include="..\lib_com\ivas_cnst.h" />
    <ClInclude Include="..\lib_com\ivas_error.h" />
    <ClInclude Include="..\lib_com\ivas_error_utils.h" />
@@ -317,9 +307,6 @@
    <ClInclude Include="..\lib_com\rom_basop_util.h" />
    <ClInclude Include="..\lib_com\rom_com.h" />
    <ClInclude Include="..\lib_com\stat_com.h" />
    <ClInclude Include="..\lib_com\stl.h" />
    <ClInclude Include="..\lib_com\typedef.h" />
    <ClInclude Include="..\lib_com\typedefs.h" />
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
+3 −42
Original line number Diff line number Diff line
@@ -265,12 +265,6 @@
    <ClCompile Include="..\lib_com\get_gain_fx.c">
      <Filter>common_all_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_com\gs_bitallocation_fx.c">
      <Filter>common_all_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_com\gs_bitallocation_ivas_fx.c">
      <Filter>common_all_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_com\gs_gains_fx.c">
      <Filter>common_all_c</Filter>
    </ClCompile>
@@ -481,6 +475,9 @@
    <ClCompile Include="..\lib_com\rom_com_fx.c">
      <Filter>common_all_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_com\gs_bitallocation_fx.c">
      <Filter>common_all_c</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\lib_com\ivas_error.h">
@@ -501,9 +498,6 @@
    <ClInclude Include="..\lib_com\ivas_rom_com.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\basop32.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\basop_settings.h">
      <Filter>common_h</Filter>
    </ClInclude>
@@ -513,33 +507,9 @@
    <ClInclude Include="..\lib_com\cnst.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\complex_basop.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\control.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\count.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\basop_util.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\enh40.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\enh32.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\enh64.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\enh1632.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\enhUL32.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\rom_basic_math.h">
      <Filter>common_h</Filter>
    </ClInclude>
@@ -552,9 +522,6 @@
    <ClInclude Include="..\lib_com\stat_com.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\stl.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\move.h">
      <Filter>common_h</Filter>
    </ClInclude>
@@ -570,12 +537,6 @@
    <ClInclude Include="..\lib_com\oper_32b.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\typedef.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\typedefs.h">
      <Filter>common_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_com\log2.h">
      <Filter>common_h</Filter>
    </ClInclude>
+0 −1
Original line number Diff line number Diff line
@@ -242,7 +242,6 @@
    <ClCompile Include="..\lib_enc\ivas_stereo_dft_td_itd_fx.c" />
    <ClCompile Include="..\lib_enc\ivas_stereo_dmx_evs_fx.c" />
    <ClCompile Include="..\lib_enc\cod4t64_fast_fx.c" />
    <ClCompile Include="..\lib_enc\igf_scf_enc.c" />
    <ClCompile Include="..\lib_enc\ivas_mcmasa_enc_fx.c" />
    <ClCompile Include="..\lib_enc\ivas_core_enc_fx.c" />
    <ClCompile Include="..\lib_enc\ivas_cpe_enc_fx.c" />
Loading