Help with building openwrt19

Hello, community. I am trying to build OpenWRT 19 on Ubuntu 24.04 and I am encountering a CMake compilation error:

[ 67%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmWorkerPool.cxx.o
In file included from /home/iwakurarain/openwrt19/build_dir/host/cmake-3.15.1/Source/cmWorkerPool.cxx:3:
/home/iwakurarain/openwrt19/build_dir/host/cmake-3.15.1/Source/cmWorkerPool.h:36:10: error: 'int64_t' in namespace 'std' does not name a type
   36 |     std::int64_t ExitStatus = 0;
      |          ^~~~~~~
/home/iwakurarain/openwrt19/build_dir/host/cmake-3.15.1/Source/cmWorkerPool.h: In member function 'bool cmWorkerPool::ProcessResultT::error() const':
/home/iwakurarain/openwrt19/build_dir/host/cmake-3.15.1/Source/cmWorkerPool.h:33:15: error: 'ExitStatus' was not declared in this scope
   33 |       return (ExitStatus != 0) || (TermSignal != 0) || !ErrorMessage.empty();
      |               ^~~~~~~~~~
/home/iwakurarain/openwrt19/build_dir/host/cmake-3.15.1/Source/cmWorkerPool.cxx: In static member function 'static void cmUVReadOnlyProcess::UVExit(uv_process_t*, int64_t, int)':
/home/iwakurarain/openwrt19/build_dir/host/cmake-3.15.1/Source/cmWorkerPool.cxx:303:20: error: 'struct cmWorkerPool::ProcessResultT' has no member named 'ExitStatus'
  303 |     proc.Result()->ExitStatus = exitStatus;
      |                    ^~~~~~~~~~
/home/iwakurarain/openwrt19/build_dir/host/cmake-3.15.1/Source/cmWorkerPool.cxx:313:41: error: 'struct cmWorkerPool::ProcessResultT' has no member named 'ExitStatus'
  313 |           std::to_string(proc.Result()->ExitStatus);
      |                                         ^~~~~~~~~~
/home/iwakurarain/openwrt19/build_dir/host/cmake-3.15.1/Source/cmWorkerPool.cxx: In member function 'void cmWorkerPool::ProcessResultT::reset()':
/home/iwakurarain/openwrt19/build_dir/host/cmake-3.15.1/Source/cmWorkerPool.cxx:543:3: error: 'ExitStatus' was not declared in this scope
  543 |   ExitStatus = 0;
      |   ^~~~~~~~~~

I suspect this is due to newer versions of dependencies, particularly GCC and G++ 14. Could this be related? To build OpenWRT 19, do I need to look for older versions of packages, or can I set some compatibility flag?

I'm a beginner trying to build OpenWRT for the first time (OpenWRT 23 built successfully with the same dependencies), but I specifically need version 19. Where should I look to resolve this issue? Thanks in advance for your help ; - ;

CONFIG_TARGET_ramips_mt76x8=y if that means

Have you tried Ubuntu 18 or 20 (i.e., the version that existed when OpenWrt 19 was released)?

3 Likes

thank you, it works!

1 Like

This worked for me to build OpenWrt 19 on Ubuntu 24.04. The patch is needed for GCC 13 and newer.

  1. Build and install Python 2.7
  2. Create this patch file:
mkdir -p tools/cmake/patches
cat << 'EOF' > tools/cmake/patches/010-add-cstdint.patch
--- a/Source/cmWorkerPool.h
+++ b/Source/cmWorkerPool.h
@@ -10,6 +10,7 @@
 #include <memory> // IWYU pragma: keep
 #include <stdint.h>
 #include <string>
+#include <cstdint>
 #include <utility>
 #include <vector>

EOF
  1. make menuconfig
  2. make -j$(nproc)

You need ubuntu that was current while openwrt 19 was current, i.e 16 18 20 LTS

1 Like