解决uos上面编译的版本不能在kylin上运行的问题

This commit is contained in:
luoliangyi 2022-10-24 22:49:36 +08:00
parent 10e411c1f0
commit fe446bf81d
2 changed files with 31 additions and 2 deletions

View File

@ -9,6 +9,10 @@ add_definitions(-DVERSION_BUILD=${MONTHDAY})
add_definitions(-DOEM_HUAGAO)
add_definitions(-Duos)
add_definitions("-Wl,--exclude-libs,ALL")
add_definitions("-Wl,--wrap=log2f")
add_definitions("-Wl,--wrap=logf")
add_definitions("-Wl,--wrap=expf")
add_definitions("-Wl,--wrap=powf")
#add_definitions("-B direct")
add_compile_options(-std=c++11)
#set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS} -g -ftest-coverage -fprofile-arcs")
@ -90,7 +94,7 @@ message(FATAL_ERROR "not find cpu and exit cmake ...")
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE -static-libgcc -static-libstdc++ -Wl,--exclude-libs,ALL -zdefs -Bdirect pthread dl -Wl,-rpath=.)
target_link_libraries(${PROJECT_NAME} PRIVATE -static-libgcc -static-libstdc++ -Wl,--exclude-libs,ALL -Wl,--wrap=log2f -Wl,--wrap=logf -Wl,--wrap=expf -Wl,--wrap=powf -zdefs -Bdirect pthread dl -Wl,-rpath=.)
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/../3rdparty/nick
${PROJECT_SOURCE_DIR}/../3rdparty/opencv/include

View File

@ -1,4 +1,4 @@
#include "../../sdk/hginclude/huagaoxxx_warraper_ex.h"
#include "../../sdk/hginclude/huagaoxxx_warraper_ex.h"
#include "../wrapper/hg_log.h"
#include "../hgdev/scanner_manager.h"
#include <iostream>
@ -9,6 +9,7 @@
#include <sys/vfs.h>
#include <string.h>
#endif
#include <math.h>
#define MAKE_VERSION(a, b, c, d) \
@ -65,6 +66,30 @@ namespace err_map
}
extern "C"
{
float __wrap_log2f(float f)
{
asm(".symver log2f, log2f@GLIBC_2.2.5");
return log2f(f);
}
float __wrap_logf(float f)
{
asm(".symver logf, logf@GLIBC_2.2.5");
return logf(f);
}
float __wrap_expf(float f)
{
asm(".symver expf, expf@GLIBC_2.2.5");
return expf(f);
}
float __wrap_powf(float f, float g)
{
asm(".symver powf, powf@GLIBC_2.2.5");
return powf(f, g);
}
scanner_err hg_scanner_initialize(sane_callback callback, void* reserve)
{
std::string name(""),