Кросс-компиляция QEMU для Android ошибок - PullRequest
0 голосов
/ 10 июня 2018

Я использую ndk-10e для компиляции qemu2.5.0.Я успешно скомпилировал glib для Android.Моя команда конфигурирования выглядит так:

PKG_CONFIG_PATH="$SYSROOT/usr/lib/pkgconfig" ./configure -- 
prefix="$SYSROOT/usr" --target-list=arm-linux-user --disable-system -- 
disable-bsd-user --disable-tools --disable-zlib-test --cross- 
prefix="arm-linux-androideabi-" --cc="$NDK/toolchains/arm-linux- 
androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc" - 
-host-cc="$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux- 
x86_64/bin/arm-linux-androideabi-gcc" --cpu="arm" -- 
cxx="$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux- 
x86_64/bin/arm-linux-androideabi-g++" --extra-ldflags="-fPIE -pie -- 
sysroot $SYSROOT -L$NDK/toolchains/arm-linux-androideabi- 
4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/ - 
L$NDK/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/ - 
L$NDK/platforms/android-21/arch-arm/usr/lib" --extra-cflags="-fPIE - 
pie --sysroot $SYSROOT -I$NDK/sources/cxx-stl/gnu- 
libstdc++/4.9/include -I$NDK/sources/cxx-stl/gnu- 
libstdc++/4.9/libs/armeabi/include -L$NDK/sources/cxx-stl/gnu- 
libstdc++/4.9/libs/armeabi/" --disable-guest-agent

Когда я набираю "make", она выдает мне эту ошибку.


>   CHK version_gen.h
  CC    arm-linux-user/linux-user/syscall.o
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:374:16: error: static declaration of 'gettid' follows non-static declaration
 _syscall0(int, gettid)
                ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:303:13: note: in definition of macro '_syscall0'
 static type name (void)   \
             ^
In file included from /home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:27:0:
/home/sam/Documents/android-ndk-r10e/platforms/android-21/arch-arm/usr/include/unistd.h:57:15: note: previous declaration of 'gettid' was here
 extern pid_t  gettid(void) __pure2;
               ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'gettid':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:374:1: warning: implicit declaration of function 'syscall' [-Wimplicit-function-declaration]
 _syscall0(int, gettid)
 ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:374:1: warning: nested extern declaration of 'syscall' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'lock_iovec':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:2050:30: error: 'IOV_MAX' undeclared (first use in this function)
     if (count  IOV_MAX) {
                              ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:2050:30: note: each undeclared identifier is reported only once for each function it appears in
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'target_to_host_ipc_perm':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:2703:12: error: 'struct ipc_perm' has no member named '__key'
     host_ip->__key = tswap32(target_ip->__key);
            ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:2716:12: error: 'struct ipc_perm' has no member named '__seq'
     host_ip->__seq = tswap16(target_ip->__seq);
            ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'host_to_target_ipc_perm':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:2731:39: error: 'struct ipc_perm' has no member named '__key'
     target_ip->__key = tswap32(host_ip->__key);
                                       ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:2744:39: error: 'struct ipc_perm' has no member named '__seq'
     target_ip->__seq = tswap16(host_ip->__seq);
                                       ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: At top level:
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:2815:7: error: redefinition of 'union semun'
 union semun {
       ^
In file included from /home/sam/Documents/android-ndk-r10e/platforms/android-21/arch-arm/usr/include/sys/sem.h:32:0,
                 from /home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:59:
/home/sam/Documents/android-ndk-r10e/platforms/android-21/arch-arm/usr/include/linux/sem.h:55:7: note: originally defined here
 union semun {
       ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'target_to_host_semarray':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:2840:5: warning: implicit declaration of function 'semctl' [-Wimplicit-function-declaration]
     ret = semctl(semid, 0, IPC_STAT, semun);
     ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:2840:5: warning: nested extern declaration of 'semctl' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'do_semop':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3002:5: warning: implicit declaration of function 'semop' [-Wimplicit-function-declaration]
     return get_errno(semop(semid, sops, nsops));
     ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3002:5: warning: nested extern declaration of 'semop' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'target_to_host_msqid_ds':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3041:12: error: 'struct msqid_ds' has no member named '__msg_cbytes'
     host_md->__msg_cbytes = tswapal(target_md->__msg_cbytes);
            ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'host_to_target_msqid_ds':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3062:46: error: 'struct msqid_ds' has no member named '__msg_cbytes'
     target_md->__msg_cbytes = tswapal(host_md->__msg_cbytes);
                                              ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'do_msgctl':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3114:9: warning: implicit declaration of function 'msgctl' [-Wimplicit-function-declaration]
         ret = get_errno(msgctl(msgid, cmd, &dsarg));
         ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3114:9: warning: nested extern declaration of 'msgctl' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'do_msgsnd':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3157:5: warning: implicit declaration of function 'msgsnd' [-Wimplicit-function-declaration]
     ret = get_errno(msgsnd(msqid, host_mb, msgsz, msgflg));
     ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3157:5: warning: nested extern declaration of 'msgsnd' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'do_msgrcv':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3177:5: warning: implicit declaration of function 'msgrcv' [-Wimplicit-function-declaration]
     ret = get_errno(msgrcv(msqid, host_mb, msgsz, msgtyp, msgflg));
     ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3177:5: warning: nested extern declaration of 'msgrcv' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'do_shmctl':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3302:9: warning: implicit declaration of function 'shmctl' [-Wimplicit-function-declaration]
         ret = get_errno(shmctl(shmid, cmd, &dsarg));
         ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3302:9: warning: nested extern declaration of 'shmctl' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'do_shmat':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3343:9: warning: implicit declaration of function 'shmat' [-Wimplicit-function-declaration]
         host_raddr = shmat(shmid, (void *)g2h(shmaddr), shmflg);
         ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3343:9: warning: nested extern declaration of 'shmat' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3343:20: warning: assignment makes pointer from integer without a cast
         host_raddr = shmat(shmid, (void *)g2h(shmaddr), shmflg);
                    ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3353:24: warning: assignment makes pointer from integer without a cast
             host_raddr = shmat(shmid, g2h(mmap_start), shmflg | SHM_REMAP);
                        ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'do_shmdt':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3391:5: warning: implicit declaration of function 'shmdt' [-Wimplicit-function-declaration]
     return get_errno(shmdt(g2h(shmaddr)));
     ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3391:5: warning: nested extern declaration of 'shmdt' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'do_ipc':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3413:9: warning: implicit declaration of function 'semget' [-Wimplicit-function-declaration]
         ret = get_errno(semget(first, second, third));
         ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3413:9: warning: nested extern declaration of 'semget' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3426:9: warning: implicit declaration of function 'msgget' [-Wimplicit-function-declaration]
         ret = get_errno(msgget(first, second));
         ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3426:9: warning: nested extern declaration of 'msgget' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3484:2: warning: implicit declaration of function 'shmget' [-Wimplicit-function-declaration]
  ret = get_errno(shmget(first, second, third));
  ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:3484:2: warning: nested extern declaration of 'shmget' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c: In function 'do_syscall':
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:6241:13: warning: implicit declaration of function 'stime' [-Wimplicit-function-declaration]
             ret = get_errno(stime(&host_time));
             ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:6241:13: warning: nested extern declaration of 'stime' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:6318:13: warning: implicit declaration of function 'futimesat' [-Wimplicit-function-declaration]
             ret = get_errno(futimesat(arg1, path(p), tvp));
             ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:6318:13: warning: nested extern declaration of 'futimesat' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:6686:13: warning: implicit declaration of function 'sigorset' [-Wimplicit-function-declaration]
             sigorset(&set, &set, &cur_set);
             ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:6686:13: warning: nested extern declaration of 'sigorset' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:6870:13: warning: implicit declaration of function 'sigtimedwait' [-Wimplicit-function-declaration]
             ret = get_errno(sigtimedwait(&set, &uinfo, puts));
             ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:6870:13: warning: nested extern declaration of 'sigtimedwait' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:6908:9: warning: implicit declaration of function 'sethostname' [-Wimplicit-function-declaration]
         ret = get_errno(sethostname(p, arg2));
         ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:6908:9: warning: nested extern declaration of 'sethostname' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:7627:9: warning: implicit declaration of function 'vhangup' [-Wimplicit-function-declaration]
         ret = get_errno(vhangup());
         ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:7627:9: warning: nested extern declaration of 'vhangup' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:7794:9: warning: implicit declaration of function 'setdomainname' [-Wimplicit-function-declaration]
         ret = get_errno(setdomainname(p, arg2));
         ^
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:7794:9: warning: nested extern declaration of 'setdomainname' [-Wnested-externs]
/home/sam/Documents/qemu-2.5.0/linux-user/syscall.c:9280:9: warning: implicit declaration of function 'readahead' [-Wimplicit-function-declaration]
         ret = get_errno(readahead(arg1, ((off64_t)arg3 

Есть некоторые странные вещи, такие как

/ home / sam / Documents / qemu-2.5.0 / linux-user / syscall.c: 2703: 12: ошибка: в «struct ipc_perm» нет члена с именем «__key» host_ip -> __ key = tswap32 (target_ip-> __ ключ);который я не знаю, как это исправить.Кто-нибудь может помочь?

1 Ответ

0 голосов
/ 11 июня 2018

Это будет смесь:

  • 2.5 - довольно старая версия QEMU;вы можете столкнуться с ошибками при компиляции с новыми / разными версиями libc, которые уже исправлены в апстриме.Начните с использования более новой версии.
  • Вы работаете с Android libc (bionic), который не является протестированным или поддерживаемым libc для сборки.Там, где он имеет различия или отличительные особенности по сравнению с glibc (стандартным libc для Linux), вам нужно изменить QEMU, чтобы обойти их.его версия этого поля в struct ipc_perm "ключ", а не "__key".
...