注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Talk:Frankenchroot/Manual Binary Format Setup

From Funtoo
Revision as of 00:25, July 13, 2020 by Necrose99 (talk | contribs) (qemu-arm64-rpi4-rock64-wrapper.c)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

/*

    * Call QEMU binary with additional "-cpu cortex-a7" argument.
    *
    * Copyright (c) 2018 sakaki <sakaki@deciban.com>
    * License: GPL v3.0+
    *
    * Based on code from the Gentoo Embedded Handbook
    * ("General/Compiling_with_qemu_user_chroot")

* added Rock64pro/rock64/RPI4 cpu statment * COMMON_FLAGS="-O2 -pipe -march=armv8-a+crc+crypto -mcpu=cortex-a72.cortex-a53" make.conf

    */
   #include <string.h>
   #include <unistd.h>
   int main(int argc, char **argv, char **envp) {
       char *newargv[argc + 3];
       newargv[0] = argv[0];
       newargv[1] = "-cpu";
       newargv[2] = "cortex-a72.cortex-a53";
       memcpy(&newargv[3], &argv[1], sizeof(*argv) * (argc -1));
       newargv[argc + 2] = NULL;
       return execve("/usr/local/bin/qemu-arm", newargv, envp);
   }