jony 发表于 2023-7-10 23:31:43

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

本帖最后由 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

jony 发表于 2023-7-11 08:23:58

gox语言的移植策略:https://github.com/golang/go/wiki/PortingPolicy#requirements-for-a-new-port
希望版主协助解决

萝卜大侠 发表于 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
希望 ...

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

jony 发表于 2023-7-11 15:52:49

萝卜大侠 发表于 2023-7-11 14:58
这种芯片架构的支持只能靠芯片厂商去推呢

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

jony 发表于 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.8FPU 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:
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
...
      
...
0x00000001 (NEEDED)                     Shared library:
0x00000001 (NEEDED)                     Shared library:
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
...
      
...
0x00000001 (NEEDED)                     Shared library:
0x00000001 (NEEDED)                     Shared library:
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.

jony 发表于 2023-7-14 12:32:49

萝卜大侠 发表于 2023-7-11 14:58
这种芯片架构的支持只能靠芯片厂商去推呢

大佬协助测试下,Go给出反馈了
页: [1]
查看完整版本: 版主看过来!反馈Go语言适配siflower架构,需配合