解决uos上面编译的版本不能在kylin上运行的问题
This commit is contained in:
parent
9057709fa0
commit
45478b92b8
|
@ -505,6 +505,10 @@
|
|||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-Wl,--exclude-libs,ALL" />
|
||||
<Add option="-Wl,--wrap=log2f" />
|
||||
<Add option="-Wl,--wrap=logf" />
|
||||
<Add option="-Wl,--wrap=expf" />
|
||||
<Add option="-Wl,--wrap=powf" />
|
||||
<Add option="-z defs" />
|
||||
<Add option="-B direct" />
|
||||
<Add option="-static-libgcc" />
|
||||
|
@ -521,10 +525,10 @@
|
|||
<Unit filename="../../../modules/imgproc/HGOCRBase.hpp" />
|
||||
<Unit filename="../../../modules/imgproc/HGOCRHanvon.cpp" />
|
||||
<Unit filename="../../../modules/imgproc/HGOCRHanvon.hpp" />
|
||||
<Unit filename="../../../modules/imgproc/HGOCRTesseract.cpp" />
|
||||
<Unit filename="../../../modules/imgproc/HGOCRTesseract.hpp" />
|
||||
<Unit filename="../../../modules/imgproc/HGOCRRetImpl.cpp" />
|
||||
<Unit filename="../../../modules/imgproc/HGOCRRetImpl.hpp" />
|
||||
<Unit filename="../../../modules/imgproc/HGOCRTesseract.cpp" />
|
||||
<Unit filename="../../../modules/imgproc/HGOCRTesseract.hpp" />
|
||||
<Unit filename="../../../modules/imgproc/ImageProcess/ImageApply.cpp" />
|
||||
<Unit filename="../../../modules/imgproc/ImageProcess/ImageApply.h" />
|
||||
<Unit filename="../../../modules/imgproc/ImageProcess/ImageApplyAdjustColors.cpp" />
|
||||
|
|
|
@ -379,6 +379,7 @@
|
|||
<Add directory="../../../../sdk/include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-Wl,--wrap=fcntl64" />
|
||||
<Add option="-lpthread" />
|
||||
<Add option="-ldl" />
|
||||
<Add option="-static-libgcc" />
|
||||
|
|
|
@ -14,6 +14,34 @@
|
|||
#include "../base/HGInc.h"
|
||||
#include "../base/HGUtility.h"
|
||||
|
||||
#if !defined(HG_CMP_MSC)
|
||||
|
||||
extern "C" float __wrap_log2f(float f)
|
||||
{
|
||||
asm(".symver log2f, log2f@GLIBC_2.2.5");
|
||||
return log2f(f);
|
||||
}
|
||||
|
||||
extern "C" float __wrap_logf(float f)
|
||||
{
|
||||
asm(".symver logf, logf@GLIBC_2.2.5");
|
||||
return logf(f);
|
||||
}
|
||||
|
||||
extern "C" float __wrap_expf(float f)
|
||||
{
|
||||
asm(".symver expf, expf@GLIBC_2.2.5");
|
||||
return expf(f);
|
||||
}
|
||||
|
||||
extern "C" float __wrap_powf(float f, float g)
|
||||
{
|
||||
asm(".symver powf, powf@GLIBC_2.2.5");
|
||||
return powf(f, g);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
HGResult HGAPI HGImgProc_ResizeImage(HGImage image, HGImage destImage, HGUInt interp)
|
||||
{
|
||||
if (NULL == image || NULL == destImage || image == destImage)
|
||||
|
|
|
@ -13,6 +13,113 @@
|
|||
#include "MsgPumpCallback.h"
|
||||
#include "curl/curl.h"
|
||||
|
||||
#if !defined(HG_CMP_MSC)
|
||||
|
||||
asm (".symver fcntl64, fcntl@GLIBC_2.2.5");
|
||||
|
||||
extern "C" int __wrap_fcntl64(int fd, int cmd, ...)
|
||||
{
|
||||
int result;
|
||||
va_list va;
|
||||
va_start(va, cmd);
|
||||
|
||||
switch (cmd) {
|
||||
//
|
||||
// File descriptor flags
|
||||
//
|
||||
case F_GETFD: goto takes_void;
|
||||
case F_SETFD: goto takes_int;
|
||||
|
||||
// File status flags
|
||||
//
|
||||
case F_GETFL: goto takes_void;
|
||||
case F_SETFL: goto takes_int;
|
||||
|
||||
// File byte range locking, not held across fork() or clone()
|
||||
//
|
||||
case F_SETLK: goto takes_flock_ptr_INCOMPATIBLE;
|
||||
case F_SETLKW: goto takes_flock_ptr_INCOMPATIBLE;
|
||||
case F_GETLK: goto takes_flock_ptr_INCOMPATIBLE;
|
||||
|
||||
// File byte range locking, held across fork()/clone() -- Not POSIX
|
||||
//
|
||||
case F_OFD_SETLK: goto takes_flock_ptr_INCOMPATIBLE;
|
||||
case F_OFD_SETLKW: goto takes_flock_ptr_INCOMPATIBLE;
|
||||
case F_OFD_GETLK: goto takes_flock_ptr_INCOMPATIBLE;
|
||||
|
||||
// Managing I/O availability signals
|
||||
//
|
||||
case F_GETOWN: goto takes_void;
|
||||
case F_SETOWN: goto takes_int;
|
||||
case F_GETOWN_EX: goto takes_f_owner_ex_ptr;
|
||||
case F_SETOWN_EX: goto takes_f_owner_ex_ptr;
|
||||
case F_GETSIG: goto takes_void;
|
||||
case F_SETSIG: goto takes_int;
|
||||
|
||||
// Notified when process tries to open or truncate file (Linux 2.4+)
|
||||
//
|
||||
case F_SETLEASE: goto takes_int;
|
||||
case F_GETLEASE: goto takes_void;
|
||||
|
||||
// File and directory change notification
|
||||
//
|
||||
case F_NOTIFY: goto takes_int;
|
||||
|
||||
// Changing pipe capacity (Linux 2.6.35+)
|
||||
//
|
||||
case F_SETPIPE_SZ: goto takes_int;
|
||||
case F_GETPIPE_SZ: goto takes_void;
|
||||
|
||||
// File sealing (Linux 3.17+)
|
||||
//
|
||||
case F_ADD_SEALS: goto takes_int;
|
||||
case F_GET_SEALS: goto takes_void;
|
||||
|
||||
// File read/write hints (Linux 4.13+)
|
||||
//
|
||||
case F_GET_RW_HINT: goto takes_uint64_t_ptr;
|
||||
case F_SET_RW_HINT: goto takes_uint64_t_ptr;
|
||||
case F_GET_FILE_RW_HINT: goto takes_uint64_t_ptr;
|
||||
case F_SET_FILE_RW_HINT: goto takes_uint64_t_ptr;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "fcntl64 workaround got unknown F_XXX constant");
|
||||
}
|
||||
|
||||
takes_void:
|
||||
va_end(va);
|
||||
return fcntl64(fd, cmd);
|
||||
|
||||
takes_int:
|
||||
result = fcntl64(fd, cmd, va_arg(va, int));
|
||||
va_end(va);
|
||||
return result;
|
||||
|
||||
takes_flock_ptr_INCOMPATIBLE:
|
||||
//
|
||||
// !!! This is the breaking case: the size of the flock
|
||||
// structure changed to accommodate larger files. If you
|
||||
// need this, you'll have to define a compatibility struct
|
||||
// with the older glibc and make your own entry point using it,
|
||||
// then call fcntl64() with it directly (bear in mind that has
|
||||
// been remapped to the old fcntl())
|
||||
//
|
||||
fprintf(stderr, "fcntl64 hack can't use glibc flock directly");
|
||||
exit(1);
|
||||
|
||||
takes_f_owner_ex_ptr:
|
||||
result = fcntl64(fd, cmd, va_arg(va, struct f_owner_ex*));
|
||||
va_end(va);
|
||||
return result;
|
||||
|
||||
takes_uint64_t_ptr:
|
||||
result = fcntl64(fd, cmd, va_arg(va, uint64_t*));
|
||||
va_end(va);
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void HGAPI CrashFunc(HGPointer crashAddr, HGPointer param)
|
||||
{
|
||||
HGChar logPath[256];
|
||||
|
|
Loading…
Reference in New Issue