mirror of https://github.com/OpenIPC/firmware.git
fix segfault in audio on v1 chips (SDK uses old version of "stat") (#621)
parent
294d1203c8
commit
e9487d4321
Binary file not shown.
|
@ -9,6 +9,10 @@ HISILICON_OSDRV_HI3516CV100_SITE =
|
|||
HISILICON_OSDRV_HI3516CV100_LICENSE = MIT
|
||||
HISILICON_OSDRV_HI3516CV100_LICENSE_FILES = LICENSE
|
||||
|
||||
define HISILICON_OSDRV_HI3516CV100_BUILD_CMDS
|
||||
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(BR2_EXTERNAL_HISILICON_PATH)/package/hisilicon-osdrv-hi3516cv100/libhisicompat all
|
||||
endef
|
||||
|
||||
define HISILICON_OSDRV_HI3516CV100_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(BR2_EXTERNAL_HISILICON_PATH)/package/hisilicon-osdrv-hi3516cv100/files/script/S95hisilicon
|
||||
|
@ -65,6 +69,7 @@ define HISILICON_OSDRV_HI3516CV100_INSTALL_TARGET_CMDS
|
|||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/lib/sensors
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib/sensors $(BR2_EXTERNAL_HISILICON_PATH)/package/hisilicon-osdrv-hi3516cv100/files/sensor/*.so
|
||||
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/lib
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib $(BR2_EXTERNAL_HISILICON_PATH)/package/hisilicon-osdrv-hi3516cv100/files/lib/libaec.so
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib $(BR2_EXTERNAL_HISILICON_PATH)/package/hisilicon-osdrv-hi3516cv100/files/lib/libanr.so
|
||||
|
@ -89,6 +94,8 @@ define HISILICON_OSDRV_HI3516CV100_INSTALL_TARGET_CMDS
|
|||
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib $(BR2_EXTERNAL_HISILICON_PATH)/package/hisilicon-osdrv-hi3516cv100/files/lib/libupvqe.so
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib $(BR2_EXTERNAL_HISILICON_PATH)/package/hisilicon-osdrv-hi3516cv100/files/lib/libVoiceEngine.so
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib $(BR2_EXTERNAL_HISILICON_PATH)/package/hisilicon-osdrv-hi3516cv100/files/lib/libvqev2.so
|
||||
|
||||
$(INSTALL) -D -m 0755 $(BR2_EXTERNAL_HISILICON_PATH)/package/hisilicon-osdrv-hi3516cv100/libhisicompat/libhisicompat.so $(TARGET_DIR)/usr/lib
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
LIB_NAME := libhisicompat
|
||||
|
||||
SRCS := sTaT.c
|
||||
|
||||
OBJS := sTaT.o
|
||||
|
||||
all: $(LIB_NAME).so
|
||||
|
||||
$(LIB_NAME).so: $(OBJS)
|
||||
$(CC) -shared -o $@ $(OBJS)
|
||||
|
||||
clean:
|
||||
@rm -f $(OBJS) $(LIB_NAME).so
|
||||
|
Binary file not shown.
|
@ -0,0 +1,23 @@
|
|||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct ugly_fake_stat {
|
||||
unsigned long long A;
|
||||
unsigned long long B;
|
||||
unsigned int st_mode; /* File mode. */
|
||||
};
|
||||
|
||||
int sTaT(const char *pathname, struct stat *statbuf)
|
||||
{
|
||||
struct stat good_struct_stat;
|
||||
memset(&good_struct_stat, 0, sizeof(struct stat));
|
||||
int ret = stat(pathname, &good_struct_stat);
|
||||
|
||||
struct ugly_fake_stat* ugly = (struct ugly_fake_stat*)statbuf;
|
||||
ugly->st_mode = good_struct_stat.st_mode;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue