.Net Core 5/6 binaries on OpenWrt

Hi yall

I am trying to get my IPQ8065 based device to run .Net Core 5.0 binaries. It should be possible because core5 can compile to 32bit musl-arm.

Specifically, the device im using is this;

Hello-world was built for linux-musl-arm using
dotnet publish --configuration Release --runtime linux-musl-arm --self-contained

Attempting to run it on my device, a bunch of missing symbols related to stdstring


root@OpenWrt:~/test3# ldd EmbeddedTestApp2
        /lib/ld-musl-armhf.so.1 (0xb6f38000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6e15000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6df9000)
        libc.musl-armv7.so.1 => /lib/ld-musl-armhf.so.1 (0xb6f38000)
Error relocating EmbeddedTestApp2: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE14_M_replace_auxEjjjc: symbol not found
Error relocating EmbeddedTestApp2: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_appendEPKcj: symbol not found
Error relocating EmbeddedTestApp2: _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5rfindEPKcjj: symbol not found
Error relocating EmbeddedTestApp2: _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12find_last_ofEPKcjj: symbol not found
Error relocating EmbeddedTestApp2: _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEjjPKc: symbol not found
Error relocating EmbeddedTestApp2: _ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_: symbol not found
Error relocating EmbeddedTestApp2: _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEjjRKS4_: symbol not found
Error relocating EmbeddedTestApp2: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_assignERKS4_: symbol not found
Error relocating EmbeddedTestApp2: _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode: symbol not found
Error relocating EmbeddedTestApp2: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE8_M_eraseEjj: symbol not found
Error relocating EmbeddedTestApp2: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEj: symbol not found
Error relocating EmbeddedTestApp2: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERjj: symbol not found
Error relocating EmbeddedTestApp2: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev: symbol not found
Error relocating EmbeddedTestApp2: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEjjPKcj: symbol not found
Error relocating EmbeddedTestApp2: _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5rfindEcj: symbol not found
Error relocating EmbeddedTestApp2: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6resizeEjc: symbol not found
Error relocating EmbeddedTestApp2: _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcj: symbol not found
Error relocating EmbeddedTestApp2: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_mutateEjjPKcj: symbol not found
Error relocating EmbeddedTestApp2: _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE17find_first_not_ofEPKcjj: symbol not found
Error relocating EmbeddedTestApp2: _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found
Error relocating EmbeddedTestApp2: _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcjj: symbol not found
Error relocating EmbeddedTestApp2: _ZTTNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE: symbol not found
Error relocating EmbeddedTestApp2: _ZTVNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEE: symbol not found
root@OpenWrt:~/test3#

Im using a generic openwrt build
openwrt-22.03.3-ipq806x-generic-askey_rt4230w-rev6-initramfs-uImage

What am I doing wrong??

All my installed libs

ar
ath10k-board-qca9984
ath10k-firmware-qca9984-ct
base-files
binutils
busybox
ca-bundle
cgi-io
curl
dnsmasq
dropbear
firewall4
fstools
fwtool
gcc
getrandom
hostapd-common
icu71
iw
iwinfo
jansson4
jshn
jsonfilter
kernel
kmod-ata-ahci
kmod-ata-ahci-platform
kmod-ata-core
kmod-ath
kmod-ath10k-ct
kmod-cfg80211
kmod-crypto-aead
kmod-crypto-ccm
kmod-crypto-cmac
kmod-crypto-crc32c
kmod-crypto-ctr
kmod-crypto-gcm
kmod-crypto-gf128
kmod-crypto-ghash
kmod-crypto-hash
kmod-crypto-hmac
kmod-crypto-manager
kmod-crypto-null
kmod-crypto-rng
kmod-crypto-seqiv
kmod-crypto-sha256
kmod-gpio-button-hotplug
kmod-hwmon-core
kmod-leds-gpio
kmod-lib-crc-ccitt
kmod-lib-crc32c
kmod-mac80211
kmod-nf-conntrack
kmod-nf-conntrack6
kmod-nf-flow
kmod-nf-log
kmod-nf-log6
kmod-nf-nat
kmod-nf-reject
kmod-nf-reject6
kmod-nfnetlink
kmod-nft-core
kmod-nft-fib
kmod-nft-nat
kmod-nft-offload
kmod-nls-base
kmod-phy-qcom-ipq806x-usb
kmod-ppp
kmod-pppoe
kmod-pppox
kmod-scsi-core
kmod-slhc
kmod-usb-core
kmod-usb-dwc3
kmod-usb-dwc3-qcom
kmod-usb-ehci
kmod-usb-ledtrig-usbport
kmod-usb-ohci
kmod-usb-xhci-hcd
kmod-usb2
kmod-usb3
libbfd
libblobmsg-json20220515
libc
libctf
libcurl4
libgcc1
libintl-full8
libiwinfo-data
libiwinfo-lua
libiwinfo20210430
libjson-c5
libjson-script20220515
liblua5.1.5
liblucihttp-lua
liblucihttp0
libmbedtls12
libmnl0
libnftnl11
libnghttp2-14
libnl-tiny1
libopcodes
libpthread
libstdcpp6
libubox20220515
libubus-lua
libubus20220601
libuci20130104
libuclient20201210
libucode20220812
libunwind8
libustream-wolfssl20201210
libwolfssl5.5.4.ee39414e
libzstd
logd
lua
luci
luci-app-firewall
luci-app-opkg
luci-base
luci-lib-base
luci-lib-ip
luci-lib-jsonc
luci-lib-nixio
luci-mod-admin-full
luci-mod-network
luci-mod-status
luci-mod-system
luci-proto-ipv6
luci-proto-ppp
luci-ssl
luci-theme-bootstrap
mtd
netifd
nftables-json
objdump
odhcp6c
odhcpd-ipv6only
openwrt-keyring
opkg
ppp
ppp-mod-pppoe
procd
procd-seccomp
procd-ujail
px5g-wolfssl
rpcd
rpcd-mod-file
rpcd-mod-iwinfo
rpcd-mod-luci
rpcd-mod-rrdns
swconfig
ubi-utils
uboot-envtools
ubox
ubus
ubusd
uci
uclient-fetch
ucode
ucode-mod-fs
ucode-mod-ubus
ucode-mod-uci
uhttpd
uhttpd-mod-ubus
urandom-seed
urngd
usign
wireless-regdb
wpad-basic-wolfssl
zlib

those are libc++ symbols.

well i have libstdcpp6 package installed, shouldnt that be enough?

I’m not of any help here but I would love to know… why..?

I see you guys dealt with a similar issue here;

https://github.com/openwrt/openwrt/pull/5014

This is the exact same symbols issue I have. Should I perhaps recompile with different config?

No, the system libc is musl - everything is built against that (musl), including everything else (libraries) mono depends on. The system libc (musl | glibc) is a build-time choice (defaulting to musl), it can't be changed at runtime (via opkg).

1 Like

I've just cherry-picked that fix into 22.03 branch, so if nothing breaks, then it should be fixed with the next snapshot build of the release branch and in next 22.03.4 release.

1 Like

Thank you, this is huge

Thanks, just installed latest stable OpenWRT v23.05 and dotnet sdk 7.0.401 and seems still have this same problem. However latest SNAPSHOT works fine.

Check REPO and they all seem to have this fix already.
Ive been chasing this issue for 2ytrs, confused now what the actual issue is... Any clues
Thankyou for your time!

Also
https://forum.openwrt.org/t/dotnet-core-error-relocating/125784/5?u=primetss