Skip to content

无法编译,gitmodules 缺少url #1

Closed

Description

@xzl01

warn: ignoring non-existent submodule ui/keycodemapdb
warn: ignoring non-existent submodule tests/fp/berkeley-testfloat-3
warn: ignoring non-existent submodule tests/fp/berkeley-softfloat-3
warn: ignoring non-existent submodule slirp
致命错误:在 .gitmodules 中未找到子模组路径 'dtc' 的 url
/tmp/lat/scripts/git-submodule.sh: failed to update modules

Unable to automatically checkout GIT submodules ''.
If you require use of an alternative GIT binary (for example to
enable use of a transparent proxy), then please specify it by
running configure by with the '--with-git' argument. e.g.

$ ./configure --with-git='tsocks git'

Alternatively you may disable automatic GIT submodule checkout
with:

$ ./configure --with-git-submodules=validate

and then manually update submodules prior to running make, with:

$ scripts/git-submodule.sh update

ninja: error: loading 'build.ninja': No such file or directory
ninja: error: loading 'build.ninja': No such file or directory

Activity

  1. sunhaiyong1978 commented on Mar 26, 2025

    @sunhaiyong1978
    Contributor

    加个参数 --with-git-submodules=ignore

  2. wojiushixiaobai commented on Mar 26, 2025

    @wojiushixiaobai
    Contributor

    @xzl01 可以用 latxbuild 下面的构建脚本构建,但是现在新世界构建不了

    # debian sid
    apt install -y git ninja-build libssl-dev libc6 gcc g++ pkg-config libglib2.0-dev libdrm-dev lsb-release make python3-setuptools
    git clone --depth=1 --recursive https://github.com/lat-opensource/lat
    cd lat/latxbuild
    ./build-release-nw.sh
    • include/qemu/osdep.h
    error: 'mcontext_t' has no member named '__fpregs'; did you mean '__gregs'?

    注意要到 latxbuild 目录下面执行脚本,否则会出现 fatal error: latx-version.h: No such file or directory

  3. xiangzhai commented on Mar 26, 2025

    @xiangzhai
    Contributor

    Hi @wojiushixiaobai

    Please check CONFIG_LOONGARCH_NEW_WORLD value, meson option new-world.

    Thanks,
    Leslie Zhai

  4. sunhaiyong1978 commented on Mar 26, 2025

    @sunhaiyong1978
    Contributor

    Hi @wojiushixiaobai

    Please check CONFIG_LOONGARCH_NEW_WORLD value, meson option new-world.

    Thanks, Leslie Zhai

    现在即使就是加上--enable-new-world 参数也出现 __fpregs 的错误。

  5. specialpointcentral commented on Mar 26, 2025

    @specialpointcentral
    Contributor

    I don't have a LoongArch computer, so I'm not sure if the code is correct. You can have a try. :-)

    lat/include/qemu/osdep.h

    Lines 27 to 43 in 7cef838

    #ifndef QEMU_OSDEP_H
    #define QEMU_OSDEP_H
    /* arch dependent signal context retriev macros */
    #if defined(__mips__)
    #define UC_GR(uc) ((uc)->uc_mcontext.gregs)
    #define UC_PC(uc) ((uc)->uc_mcontext.pc)
    #elif defined(__loongarch__)
    #define UC_GR(uc) ((uc)->uc_mcontext.__gregs)
    #define UC_PC(uc) ((uc)->uc_mcontext.__pc)
    #define UC_FREG(uc) ((uc)->uc_mcontext.__fpregs)
    #define UC_FCSR(uc) ((uc)->uc_mcontext.__fcsr)
    #else
    #error "unknown arch"
    #endif
    #include "config-host.h"
    can be changed into:

    #ifndef QEMU_OSDEP_H
    #define QEMU_OSDEP_H
    
    #include "config-host.h"
    
    /* arch dependent signal context retriev macros */
    #if defined(__mips__)
    #define UC_GR(uc) ((uc)->uc_mcontext.gregs)
    #define UC_PC(uc) ((uc)->uc_mcontext.pc)
    #elif defined(__loongarch__)
    #define UC_GR(uc) ((uc)->uc_mcontext.__gregs)
    #define UC_PC(uc) ((uc)->uc_mcontext.__pc)
    #ifndef CONFIG_LOONGARCH_NEW_WORLD
        #define UC_FREG(uc) ((uc)->uc_mcontext.__fpregs)
        #define UC_FCSR(uc) ((uc)->uc_mcontext.__fcsr)
    #endif
    #else
    #error "unknown arch"
    #endif

    Also in:

    lat/accel/tcg/translate-all.c

    Lines 4610 to 4636 in 7cef838

    case 0xc0:
    if (inst & (1<<21)) {
    /*VLDREPL.W*/
    for(int i = 0; i < 8; i++) {
    UC_FREG(uc)[fd].__val32[i] = *(int32_t *)mem_addr;
    }
    goto end;
    }
    /*VLDREPL.D*/
    for(int i = 0; i < 4; i++) {
    UC_FREG(uc)[fd].__val64[i] = *(int64_t *)mem_addr;
    }
    goto end;
    case 0xc1:/*VLDREPL.H*/
    for(int i = 0; i < 8; i++) {
    *((int16_t *)&UC_FREG(uc)[fd].__val32[i] + 0) = *(int16_t *)mem_addr;
    *((int16_t *)&UC_FREG(uc)[fd].__val32[i] + 1) = *(int16_t *)mem_addr;
    }
    goto end;
    case 0xc2:/*VLDREPL.B*/
    for(int i = 0; i < 8; i++) {
    *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 0) = *(int8_t *)mem_addr;
    *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 1) = *(int8_t *)mem_addr;
    *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 2) = *(int8_t *)mem_addr;
    *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 3) = *(int8_t *)mem_addr;
    }
    goto end;

    It may change to:

    #define EXPAND_TO_64BIT(type, addr) ({ \
        type value = *(type *)(addr); \
        int64_t result = value; \
        for (int i = 1; i < (64 / (sizeof(type) * 8)); i++) { \
            result = (result << (sizeof(type) * 8)) | value; \
        } \
        result; \
    })  /* EXPAND_TO_64BIT */
    
    #ifndef CONFIG_LOONGARCH_NEW_WORLD
    case 0xc0:
        if (inst & (1<<21)) {
            /*VLDREPL.W*/
            for(int i = 0; i < 8; i++) {
                UC_FREG(uc)[fd].__val32[i] = *(int32_t *)mem_addr;
            }
            goto end;
        }
        /*VLDREPL.D*/
        for(int i = 0; i < 4; i++) {
            UC_FREG(uc)[fd].__val64[i] = *(int64_t *)mem_addr;
        }
        goto end;
    case 0xc1:/*VLDREPL.H*/
        for(int i = 0; i < 8; i++) {
            *((int16_t *)&UC_FREG(uc)[fd].__val32[i] + 0) = *(int16_t *)mem_addr;
            *((int16_t *)&UC_FREG(uc)[fd].__val32[i] + 1) = *(int16_t *)mem_addr;
        }
        goto end;
    case 0xc2:/*VLDREPL.B*/
        for(int i = 0; i < 8; i++) {
            *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 0) = *(int8_t *)mem_addr;
            *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 1) = *(int8_t *)mem_addr;
            *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 2) = *(int8_t *)mem_addr;
            *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 3) = *(int8_t *)mem_addr;
        }
        goto end;
    #else /* CONFIG_LOONGARCH_NEW_WORLD */
    case 0xc0:
        if (inst & (1<<21)) {
            /*VLDREPL.W*/
            int64_t tmp_mem = EXPAND_TO_64BIT(int32_t, mem_addr);
            for(int i = 0; i < 4; i++) {
                UC_SET_LASX(&extctx, fd, i, &tmp_mem, int64_t);
            }
            goto end;
        }
        /*VLDREPL.D*/
        for(int i = 0; i < 4; i++) {
            UC_SET_LASX(&extctx, fd, i, mem_addr, int64_t);
        }
        goto end;
    case 0xc1: { /*VLDREPL.H*/
        int64_t tmp_mem = EXPAND_TO_64BIT(int16_t, mem_addr);
        for(int i = 0; i < 4; i++) {
            UC_SET_LASX(&extctx, fd, i, &tmp_mem, int64_t);
        }
        goto end;
    }
    case 0xc2: { /*VLDREPL.B*/
        int64_t tmp_mem = EXPAND_TO_64BIT(int8_t, mem_addr);
        for(int i = 0; i < 4; i++) {
            UC_SET_LASX(&extctx, fd, i, &tmp_mem, int64_t);
        }
        goto end;
    }
    #endif
  6. wojiushixiaobai commented on Mar 26, 2025

    @wojiushixiaobai
    Contributor

    @specialpointcentral
    新的错误

    • include/qemu/osdep.h
    error: 'mcontext_t' has no member named 'sc_regs'
    error: 'mcontext_t' has no member named 'sc_pc'
    • /usr/include/loongarch64-linux-gnu/asm/sigcontext.h
    struct sigcontext {
            __u64   sc_pc;
            __u64   sc_regs[32];
            __u32   sc_flags;
            __u64   sc_extcontext[0] __attribute__((__aligned__(16)));
    };
    

    我尝试修改下

  7. specialpointcentral commented on Mar 26, 2025

    @specialpointcentral
    Contributor

    @specialpointcentral 新的错误

    • include/qemu/osdep.h

    error: 'mcontext_t' has no member named 'sc_regs'
    error: 'mcontext_t' has no member named 'sc_pc'

    • /usr/include/loongarch64-linux-gnu/asm/sigcontext.h
    struct sigcontext {
            __u64   sc_pc;
            __u64   sc_regs[32];
            __u32   sc_flags;
            __u64   sc_extcontext[0] __attribute__((__aligned__(16)));
    };
    

    我尝试修改下

    看起来应该得用glibc的部分:

    typedef struct mcontext_t
    {
        unsigned long long __pc;
        unsigned long long __gregs[32];
        unsigned int __flags;
        unsigned long long __extcontext[0] __attribute__((__aligned__(16)));
    } mcontext_t;

    应该是:

        #define UC_GR(uc) ((uc)->uc_mcontext.__gregs)
        #define UC_PC(uc) ((uc)->uc_mcontext.__pc)

    然后:

    lat/accel/tcg/translate-all.c

    Lines 4610 to 4636 in 7cef838

    case 0xc0:
    if (inst & (1<<21)) {
    /*VLDREPL.W*/
    for(int i = 0; i < 8; i++) {
    UC_FREG(uc)[fd].__val32[i] = *(int32_t *)mem_addr;
    }
    goto end;
    }
    /*VLDREPL.D*/
    for(int i = 0; i < 4; i++) {
    UC_FREG(uc)[fd].__val64[i] = *(int64_t *)mem_addr;
    }
    goto end;
    case 0xc1:/*VLDREPL.H*/
    for(int i = 0; i < 8; i++) {
    *((int16_t *)&UC_FREG(uc)[fd].__val32[i] + 0) = *(int16_t *)mem_addr;
    *((int16_t *)&UC_FREG(uc)[fd].__val32[i] + 1) = *(int16_t *)mem_addr;
    }
    goto end;
    case 0xc2:/*VLDREPL.B*/
    for(int i = 0; i < 8; i++) {
    *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 0) = *(int8_t *)mem_addr;
    *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 1) = *(int8_t *)mem_addr;
    *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 2) = *(int8_t *)mem_addr;
    *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 3) = *(int8_t *)mem_addr;
    }
    goto end;
    部分也得修改

    更新:可以参看:#1 (comment)
    因为手头上没有电脑,属于手工写的,不知道正确与否

  8. MingcongBai commented on Mar 28, 2025

    @MingcongBai
    Contributor

    上述 submodule 问题应该已经得到解决了,构建问题昨天也有另外的补丁修复了

    cc @deuso @LaurenIsACoder

  9. specialpointcentral commented on Mar 28, 2025

    @specialpointcentral
    Contributor

    ref: #5 #12

    似乎可以关闭这个issue了 @xzl01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions