Вопрос по macos, linux, kernel – сборка ядра Linux на Mac OS X

21

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceededelf.h was not found.

Error: User Rate Limit ExceededNO ELF

Error: User Rate Limit Exceeded/usr/includeError: User Rate Limit Exceeded"u8" not declared

Каков стандартный способ разработки ядра на Mac? У меня есть виртуальная машина под управлением Linux на том же Mac, и она будет использоваться для тестирования модифицированного ядра. Однако я не очень хочу собирать на нем ядро, так как оно довольно медленное.

Error: User Rate Limit Exceeded kolosy
Error: User Rate Limit Exceeded Alfred Zhong
Error: User Rate Limit ExceededNO ELFError: User Rate Limit ExceededmakeError: User Rate Limit Exceededmake V=1Error: User Rate Limit Exceeded mpontillo
Error: User Rate Limit ExceededNO ELFError: User Rate Limit Exceeded mpontillo
Error: User Rate Limit Exceededcode.google.com/p/android/issues/detail?id=2755 nmagerko

Ваш Ответ

5   ответов
2

Error: User Rate Limit Exceededmake -j8 ARCH=arm CROSS_COMPILE=arm-eabi- HOSTCFLAGS="-I ../external/elfutils/libelf"

Error: User Rate Limit Exceeded

3

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceededusr/local/opt/libelf/include/libelf/gelf.h

brew install libelf

Error: User Rate Limit Exceededusr/local/includeError: User Rate Limit Exceeded<kernel_source>/arch/arm/include/asm/elf.hError: User Rate Limit Exceeded

cat <<EOT >> /usr/local/include/elf.h
#include "../opt/libelf/include/libelf/gelf.h"
#define R_386_NONE 0
#define R_386_32 1
#define R_386_PC32 2
#define R_ARM_NONE 0
#define R_ARM_PC24 1
#define R_ARM_ABS32 2
#define R_MIPS_NONE 0
#define R_MIPS_16 1
#define R_MIPS_32 2
#define R_MIPS_REL32 3
#define R_MIPS_26 4
#define R_MIPS_HI16 5
#define R_MIPS_LO16 6
#define R_IA64_IMM64 0x23 /* symbol + addend, mov imm64 */
#define R_PPC_ADDR32 1 /* 32bit absolute address */
#define R_PPC64_ADDR64 38 /* doubleword64 S + A */
#define R_SH_DIR32 1
#define R_SPARC_64 32 /* Direct 64 bit */
#define R_X86_64_64 1 /* Direct 64 bit */
#define R_390_32 4 /* Direct 32 bit. */
#define R_390_64 22 /* Direct 64 bit. */
#define R_MIPS_64 18
EOT

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

3

Compile Kernel using AOSP's prebuilts

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

<SOME-PATH>/prebuilts/
<SOME-PATH>/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/
<SOME-PATH>/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.8/

Error: User Rate Limit Exceeded

Install the missing headers

Error: User Rate Limit Exceeded/usr/local/includeError: User Rate Limit Exceededchmod +xError: User Rate Limit Exceeded

install_headers.sh:

#!/bin/sh

PREBUILTS_DIR="<SOME-PATH>/prebuilts" # fill in the path here!

PREBUILT_GCC=$PREBUILTS_DIR"/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8"
KERNEL_HEADERS=$PREBUILT_GCC"/sysroot/usr/include"
HOST_HEADERS="/usr/local/include"

function install_header() {
    header=$1
    ln -s $KERNEL_HEADERS/$header $HOST_HEADERS/$header
}

# create symlinks for the missing headers
install_header elf.h
install_header features.h
# the following are folders (that contain headers)
install_header bits
install_header gnu
install_header linux
install_header asm
install_header asm-generic

Build the kernel

export PATH=<SOME-PATH>/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.8/bin:$PATH
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
# in this example it builds for N6
make shamu_defconfig
make -j8

Voila:

Kernel: arch/arm/boot/zImage-dtb is ready

My configuration

  • macOS Sierra 10.12.3
  • XCode: using MacOSX10.11.sdk, which allows building AOSP on mac
  • Target device: N6/shamu
  • AOSP branch: Marshmallow (updated mac_version.mk in build to allow using 10.12.3 sdk)
20

Error: User Rate Limit ExceededreallyError: User Rate Limit Exceeded

Error: User Rate Limit ExceededError: User Rate Limit Exceeded.

Error: User Rate Limit Exceeded/usr/include):

/usr/include/elf.h
/usr/include/features.h
/usr/include/bits/predefs.h
/usr/include/bits/wordsize.h
/usr/include/gnu/stubs.h
/usr/include/gnu/stubs-64.h

Error: User Rate Limit Exceededmalloc.hError: User Rate Limit Exceeded

sudo ln -s /usr/include/malloc/malloc.h /usr/include/malloc.h

Error: User Rate Limit ExceededgccError: User Rate Limit Exceeded


EDITError: User Rate Limit ExceededsedError: User Rate Limit Exceeded

$ sudo port install libelf
$ sudo port install gsed
4

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Согласен. Я сдался ... Я думал, что люди могут понять это и придумать удобный способ ... И оказывается, что это неправильно. Alfred Zhong

Похожие вопросы