I am running OpenWrt 19.07 inside docker (on x86 machine with Ubuntu 22.04 host). I am trying to develop inside OpenWrt docker container. It did not have gcc. So, I installed gcc with opkg install gcc
. By default, it installed gcc 7.4. Is there any way to get latest gcc (at least greater than version 9) running on OpenWrt? or cross compilation is the only way?
You need ancient SDK imside vm/container debian or centos or alpine of similar age
Can you please elaborate a bit? You mean OpenWrt SDK? Can you point me to one? I just checked SDK here: https://downloads.openwrt.org/releases/19.07.10/targets/x86/64/
From the name "openwrt-sdk-19.07.10-x86-64_gcc-7.5.0_musl.Linux-x86_64.tar.xz", it seems it comes with gcc 7.5.
The answer is probably not, simply going by the fact of non-backwards compatible interface changes in the Linux kernel, which will be reflected by the library dependencies of newer gcc packages (such as musl).
Why do you need to develop for OpenWrt 19 and why do you need a newer version of gcc for that?
Why I need to develop? Well, I need certain custom functionality to be run on OpenWrt 19 running on existing device I have.
If I cannot run gcc 9+ on OpenWrt 19.07, what options I have? Even sdk comes with gcc 7.5 ?! Is it that anything that required gcc version greater than 7.5 is undoable for OpenWrt?
Will cross compilation work? If yes, can you please point out me to some minimal step by step guide?
Yoi can always link a static binary on newer SDK, or even debian.
a) OpenWrt is not self-hosting
b) 19.07 is long EOL
While you are welcome to do whatever you like, there won't be any updates to 19.07 anymore, even less for that desire (which wouldn't have met basic backport requirements while it still was {,old}stable either).
I wouldn't expect many others to share your enthusiasm though. The sensible choice would be to upgrade to a supported version first, and then to use the correct tools for the job second.
Statically linking everything (including the C standard library) from a newer SDK version may or may not work. If you hit a kernel interface that was changed in the meantime your problems may range from straight up crashing at startup to weird bugs that will be a nightmare to debug.
gcc 7.5 has up to full experimental C++17 support. If that's not enough for you, the answer above is the correct one.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.