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 libraries were being called. The relevant call chain looked
like this: like this:
</p> </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> <p>
My first theory was that the <code>protoc</code> compiler My first theory was that the <code>protoc</code> compiler
had generated code for the wrong architecture or endianess. 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> </li>
</ul> </ul>
<p> <p>
The conclusion was clear: the import code itself worked. It The conclusion was clear: the import code itself worked. Just not for me, for some reason.
just didnt work inside my main binary.
</p> </p>
<h2>debugging phase two</h2> <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: version that still failed. The culprit quickly emerged:
simply importing <code>tflite</code> with simply importing <code>tflite</code> with
<code>use tflite::Tflite</code> was enough to break OpenCV. <code>use tflite::Tflite</code> was enough to break OpenCV.
Two unrelated libraries were somehow breaking each other.
</p> </p>
<h3>the real root cause</h3> <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> <h2>the end (for now)</h2>
<p> <p>
After months of debugging, rebuilding, and manually patching After months of debugging, rebuilding, and manually patching
binaries, everything finally works again. Until the next binaries, everything finally works again, with the added benefit of cross-compiling, instead of either building on the Raspberry Pi or under emulation.
<code>nixpkgs</code> update, of course.
</p> </p>
<!-- -- <!-- --