2017年3月9日 星期四

Compile出現error: incompatible types when assigning to type &int * from type &kuid_t * pOSFSInfo->fsuid = current_fsuid();錯誤

主要是新版linux kernel,current_fsuid() function有修改。

這function定義在
/usr/src/linux-headers-X.XX.X-XX/include/linux/cred.h
struct cred {
...
kuid_t fsuid;   /* UID for VFS ops */
kgid_t fsgid; /* GID for VFS ops */

/usr/src/linux-headers-3.19.0-32/include/linux/uidgid.h
typedef struct {
uid_t  val;
} kuid_t;

可依下面方式更改解決此問題。
os/linux/xxx_linux.c
pOSFSInfo->fsuid = current_fsuid().val;
pOSFSInfo->fsgid = current_fsgid().val;
或是

include/os/xxx_linux.h
typedef struct _OS_FS_INFO_
{
kuid_t                     fsuid;
  kgid_t                     fsgid;
  mm_segment_t      fs;
} OS_FS_INFO;

2017年3月8日 星期三

Compile出現arm-none-eabi-gcc: not found /bin/sh: 4:錯誤

一直以為這訊息是沒有找到這檔案,
但檔案明明有在 ><
查了Google後才知道並不是指檔案沒找到 Orz

原來是自己的Ubuntu是64位元版本,
而gcc是32位元版本,才出現這樣的錯誤訊息。

安裝ia32-libs就解決了 ...

判斷Linux執行檔為32-bit或64-bit



> file filename