I am (attempting to) port webrtc / webrtc-streamer to OpenWrt (x86_64), which involves:
- using OpenWrt sysroot
- adding custom CFLAGS, LDFLAGS
So far, based on the post below, it should be possible to fully specify build variables.
"This CL also adds the following optional build args that do pretty
much what you'd expect them to do:
cros_target_ld, cros_target_extra_cflags, cros_target_extra_cppflags,
cros_target_extra_cxx_flags, cros_target_extra_ldflags,
cros_host_ar, cros_host_cc, cros_host_cxx, cros_host_ld,
cros_host_is_clang, cros_host_extra_cflags, cros_host_extra_cppflags,
cros_host_extra_cxx_flags, cros_host_extra_ldflags,
cros_v8_snapshot_ar, cros_v8_snapshot_cc, cros_v8_snapshot_cxx,
cros_v8_snapshot_ld, cros_v8_snapshot_extra_cflags,
cros_v8_snapshot_extra_cppflags, cros_v8_snapshot_extra_cxx_flags,
cros_v8_snapshot_extra_ldflags"
my generate arguments are:
gn gen out/Release --args='is_debug=false \
cros_target_ar="x86_64-openwrt-linux-gnu-ar" \
cros_target_cc="x86_64-openwrt-linux-gnu-gcc" \
cros_target_cxx="x86_64-openwrt-linux-gnu-g++" \
target_sysroot="$(STAGING_DIR)" \
use_custom_libcxx=false \
is_clang=false \
rtc_use_h264=true \
ffmpeg_branding="Chrome" \
rtc_include_tests=false \
use_ozone=true \
target_os="linux" \
target_cpu="x64" \
host_toolchain="//build/toolchain/cros:host" \
cros_target_extra_ldflags="$(TARGET_LDFLAGS)" \
cros_target_extra_cppflags="$(TARGET_CFLAGS)" \
cros_target_extra_cflags="$(TARGET_CFLAGS)" \
rtc_include_pulse_audio=false';
...BUT, the ldflags, cppflags, cflags are not appearing in any of the generated ninja files
Clearly, I am doing something wrong or, the post above is incorrect, or, I am missing the correct way to do this.
My first impulse was to just re-package the official binaries, but library version problems
root@SecureOffice:/tmp# ldd webrtc-streamer
./webrtc-streamer: /usr/lib/libasound.so.2: no version information available (required by ./webrtc-streamer)
./webrtc-streamer: /lib/libm.so.6: version `GLIBC_2.27' not found (required by ./webrtc-streamer)
./webrtc-streamer: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by ./webrtc-streamer)
linux-vdso.so.1 (0x00007ffdce9fb000)
...other libs (found)
Any advice?
Regards;
Bill