forum.gl-inet.cn

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
    查看: 888|回复: 5

    [问题反馈] 版主看过来!反馈Go语言适配siflower架构,需配合

    [复制链接]

    1

    主题

    6

    帖子

    61

    积分

    注册会员

    Rank: 2

    积分
    61
    发表于 2023-7-10 23:31:43 | 显示全部楼层 |阅读模式
    本帖最后由 jony 于 2023-7-11 09:28 编辑

    Go already supports four MIPS GOOS settings: mips, mips64, mipsle, and mips64le, with two GOMIPSsettings (hardfloat and softfloat). Does one of those combinations work with the instruction set supported by siflower? If not, what causes them to be incompatible?


    github问题链接:https://github.com/golang/go/issues/61254
    回复

    使用道具 举报

    1

    主题

    6

    帖子

    61

    积分

    注册会员

    Rank: 2

    积分
    61
     楼主| 发表于 2023-7-11 08:23:58 | 显示全部楼层
    gox语言的移植策略:https://github.com/golang/go/wik ... ents-for-a-new-port
    希望版主协助解决
    回复

    使用道具 举报

    76

    主题

    2144

    帖子

    9639

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    9639

    官方人员

    发表于 2023-7-11 14:58:30 | 显示全部楼层
    jony 发表于 2023-7-11 08:23
    gox语言的移植策略:https://github.com/golang/go/wiki/PortingPolicy#requirements-for-a-new-port
    希望 ...

    这种芯片架构的支持只能靠芯片厂商去推呢
    回复

    使用道具 举报

    1

    主题

    6

    帖子

    61

    积分

    注册会员

    Rank: 2

    积分
    61
     楼主| 发表于 2023-7-11 15:52:49 | 显示全部楼层
    萝卜大侠 发表于 2023-7-11 14:58
    这种芯片架构的支持只能靠芯片厂商去推呢

    大佬和厂家反馈下,我们这也沟通不到厂家的技术人员啊
    回复

    使用道具 举报

    1

    主题

    6

    帖子

    61

    积分

    注册会员

    Rank: 2

    积分
    61
     楼主| 发表于 2023-7-11 20:01:52 来自手机 | 显示全部楼层
    萝卜大侠 发表于 2023-7-11 14:58
    这种芯片架构的支持只能靠芯片厂商去推呢

    /proc/cpuinfo

    system type             : MIPS sf19a28
    machine                 : GL-SFT1200
    processor               : 0
    cpu model               : MIPS interAptiv (multi) V2.8  FPU V0.0
    BogoMIPS                : 531.66
    wait instruction        : yes
    microsecond timers      : yes
    tlb_entries             : 64
    extra interrupt vector  : yes
    hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
    isa                     : mips1 mips2 mips32r1 mips32r2
    ASEs implemented        : mips16 dsp dsp2 mt eva
    Datasheet: https://www.siflower.com.cn/assets/upload/file/SF19A2890_datasheet.pdf

    Its CPU is MIPS32® interAptiv, a MIPS32r2 CPU.

    readelf

    busybox_1.29.3-3_mips_siflower.ipk

    ELF Header:
      Magic:   7f 45 4c 46 01 01 01 00 01 00 00 00 00 00 00 00
      Class:                             ELF32
      Data:                              2's complement, little endian
      Version:                           1 (current)
      OS/ABI:                            UNIX - System V
      ABI Version:                       1
      Type:                              EXEC (Executable file)
      Machine:                           MIPS R3000
      Version:                           0x1
      Entry point address:               0x403760
      Start of program headers:          52 (bytes into file)
      Start of section headers:          0 (bytes into file)
      Flags:                             0x1005, noreorder, cpic, o32, mips1
      Size of this header:               52 (bytes)
      Size of program headers:           32 (bytes)
      Number of program headers:         9
      Size of section headers:           0 (bytes)
      Number of section headers:         0
      Section header string table index: 0
    ...
          [Requesting program interpreter: /lib/ld-musl-mipsel.so.1]
    ...
    0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
    0x00000001 (NEEDED)                     Shared library: [libc.so]
    MIPS I (weird!) little-endian. ld.so is /lib/ld-musl-mipsel.so.1.

    busybox_1.28.4-3_mipsel_24kc.ipk

    ELF Header:
      Magic:   7f 45 4c 46 01 01 01 00 01 00 00 00 00 00 00 00
      Class:                             ELF32
      Data:                              2's complement, little endian
      Version:                           1 (current)
      OS/ABI:                            UNIX - System V
      ABI Version:                       1
      Type:                              EXEC (Executable file)
      Machine:                           MIPS R3000
      Version:                           0x1
      Entry point address:               0x403940
      Start of program headers:          52 (bytes into file)
      Start of section headers:          0 (bytes into file)
      Flags:                             0x74001005, noreorder, cpic, o32, mips16, mips32r2
      Size of this header:               52 (bytes)
      Size of program headers:           32 (bytes)
      Number of program headers:         9
      Size of section headers:           0 (bytes)
      Number of section headers:         0
      Section header string table index: 0
    ...
          [Requesting program interpreter: /lib/ld-musl-mipsel-sf.so.1]
    ...
    0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
    0x00000001 (NEEDED)                     Shared library: [libc.so]
    MIPS32r2 little-endian. ld.so is /lib/ld-musl-mipsel-sf.so.1.

    The reason why one cannot "execute an ELF built for mipsel_24kc" is clear now:

    OpenWrt opkg refuses to install mipsel_24kc ipk as is not considered a compatible architecture.
    A dynamically linked ELF is unable to find a proper ld.so.
    In theory, a static linked Go program should be able to execute on mips_siflower. So, could you test?

    In conclusion, I don't think it need a new port for Go to support mips_siflower, but the downstream OpenWrt GL.iNet provides is a bit "toxic". No much things can do from our side, but users needs to configure CGO properly.
    回复

    使用道具 举报

    1

    主题

    6

    帖子

    61

    积分

    注册会员

    Rank: 2

    积分
    61
     楼主| 发表于 2023-7-14 12:32:49 来自手机 | 显示全部楼层
    萝卜大侠 发表于 2023-7-11 14:58
    这种芯片架构的支持只能靠芯片厂商去推呢

    大佬协助测试下,Go给出反馈了
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|gl-inet.cn ( 粤ICP备18130956号 )

    GMT+8, 2024-5-5 23:59 , Processed in 0.022568 second(s), 25 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表