Improve cross-compile page wording and links

Add links to opencv-rust and the OpenCV ONNX importer, clarify the
debugging narrative (note that two unrelated libraries conflicted), and
mention cross-compiling as the final outcome.
This commit is contained in:
Stefan Kempinger 2025-11-10 12:21:46 +01:00
parent aaabfcf030
commit b482ed2bd4

View file

@ -224,7 +224,7 @@ LD_LIBRARY_PATH=/path/to/libs:$LD_LIBRARY_PATH ./binary</pre
libraries were being called. The relevant call chain looked
like this:
</p>
<p>Rust code → rust-opencv → OpenCV → Protobuf.</p>
<p>Rust code → <a href="https://github.com/twistedfall/opencv-rust">opencv-rust</a><a href="https://github.com/opencv/opencv/blob/4.x/modules/dnn/src/onnx/onnx_importer.cpp#L283">OpenCV</a> → Protobuf</p>
<p>
My first theory was that the <code>protoc</code> compiler
had generated code for the wrong architecture or endianess.
@ -247,8 +247,7 @@ LD_LIBRARY_PATH=/path/to/libs:$LD_LIBRARY_PATH ./binary</pre
</li>
</ul>
<p>
The conclusion was clear: the import code itself worked. It
just didnt work inside my main binary.
The conclusion was clear: the import code itself worked. Just not for me, for some reason.
</p>
<h2>debugging phase two</h2>
@ -258,6 +257,7 @@ LD_LIBRARY_PATH=/path/to/libs:$LD_LIBRARY_PATH ./binary</pre
version that still failed. The culprit quickly emerged:
simply importing <code>tflite</code> with
<code>use tflite::Tflite</code> was enough to break OpenCV.
Two unrelated libraries were somehow breaking each other.
</p>
<h3>the real root cause</h3>
@ -286,8 +286,7 @@ LD_LIBRARY_PATH=/path/to/libs:$LD_LIBRARY_PATH ./binary</pre
<h2>the end (for now)</h2>
<p>
After months of debugging, rebuilding, and manually patching
binaries, everything finally works again. Until the next
<code>nixpkgs</code> update, of course.
binaries, everything finally works again, with the added benefit of cross-compiling, instead of either building on the Raspberry Pi or under emulation.
</p>
<!-- --