Wind4 / vlmcsd

KMS Emulator in C (currently runs on Linux including Android, FreeBSD, Solaris, Minix, Mac OS, iOS, Windows with or without Cygwin)
https://forums.mydigitallife.net/threads/50234
8.35k stars 2.23k forks source link

友善R2S安装的OpenWRT升级到23版本以后,运行程序报错:line 1: syntax error: unexpected word (expecting ")") #95

Closed ThornBirds77 closed 2 months ago

ThornBirds77 commented 2 months ago

试过Linux/arm/little-endian的各种版本,均报错无法运行,在升级之前的OpenWRT 22版本运行正常。

/etc/openwrt_release输出:

_

DISTRIB_ID='OpenWrt' DISTRIB_RELEASE='23.05.3' DISTRIB_REVISION='r23809-234f1a2efa' DISTRIB_TARGET='rockchip/armv8' DISTRIB_ARCH='aarch64_generic' DISTRIB_DESCRIPTION='OpenWrt 23.05.3 r23809-234f1a2efa' DISTRIB_TAINTS=''

_

lscpu输出:

_

Architecture: aarch64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Vendor ID: ARM Model name: Cortex-A53 Model: 4 Thread(s) per core: 1 Core(s) per cluster: 4 Socket(s): - Cluster(s): 1 Stepping: r0p4 CPU(s) scaling MHz: 63% CPU max MHz: 1296.0000 CPU min MHz: 408.0000 BogoMIPS: 48.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid Vulnerabilities:
Gather data sampling: Not affected Itlb multihit: Not affected L1tf: Not affected Mds: Not affected Meltdown: Not affected Mmio stale data: Not affected Retbleed: Not affected Spec rstack overflow: Not affected Spec store bypass: Not affected Spectre v1: Mitigation; __user pointer sanitization Spectre v2: Not affected Srbds: Not affected Tsx async abort: Not affected

_

rouben commented 2 months ago

What are you running and how exactly? Please post the exact command you use and the error message.

Also please post what shell you're using (busybox, ash, sh).

The error looks like it's from a bash script (OpenWRT comes with busybox or ash, and these do not support full bash syntax).

ThornBirds77 commented 2 months ago

Thank runebn, I did not use any shell to run the app, please refer attached error message :

error

thirdwheel commented 2 months ago

Are you sure you have the right architecture? What does uname -m tell you?

ThornBirds77 commented 2 months ago

Are you sure you have the right architecture? What does uname -m tell you?

The uname -m output "aarch64". When I run it under OpenWRT 22 on the same hardware, everything is fine. Until I upgraded it to OpenWRT 23 last night.

thirdwheel commented 2 months ago

Ah, I would've known that if I'd read the first post.

Sounds to me like there's been a kernel change such that armv7el code no longer runs on aarch64. Maybe try the other little-endian binaries, see if they work. Worst case, you might have to bust out the OpenWrt SDK and build your own binaries.

rouben commented 2 months ago

I don't think arm64/aarch64 binaries are provided in the current release... anyone want to take a crack at building them?

It also looks like OpenWRT does not enable 32-bit executable support in 64-bit builds... at least it appears to be true for x86, according to this.

ThornBirds77 commented 2 months ago

Ah, I would've known that if I'd read the first post.

Sounds to me like there's been a kernel change such that armv7el code no longer runs on aarch64. Maybe try the other little-endian binaries, see if they work. Worst case, you might have to bust out the OpenWrt SDK and build your own binaries.

Yes, I have tried the other binaries and got the same error. Also I have no experience building standalone binaries under OpenWRT SDK. so I can only hope that someone else will help build and share it.

rouben commented 2 months ago

This looks promising... https://github.com/openwrt/docker

I think the SDK container running on a Raspberry Pi or even an always free arm64 VM from Oracle might be useful to build the appropriate binary.

ThornBirds77 commented 2 months ago

This looks promising... https://github.com/openwrt/docker

I think the SDK container running on a Raspberry Pi or even an always free arm64 VM from Oracle might be useful to build the appropriate binary.

Thanks. It should be helpful.

ThornBirds77 commented 2 months ago

After installing gcc into my OpenWRT environment, I've built the native binary. I also add the NOLRESOLV=1 NOLPTHREAD=1 option to avoid link error.