python-rpi-gpio on aarch64 (pi 4): ImportError: /usr/lib/python3.8/site-packages/RPi/_GPIO.cpython-38-aarch64-linux-gnu.so: undefined symbol: high There is a patch attached to the package - fixes the "multiple definition of" errors with gcc10 Signed-off-by: Michael Fischer <mf@go-sys.de> It changes the "high" variable to be "extern" which might have caused this?
According to this, originally the submitter tried to disable the warning, but that patch was rejected by the maintainers: http://buildroot-busybox.2317881.n4.nabble.com/PATCH-1-1-package-python-rpi-gpio-fix-build-with-gcc-10-x-td261727.html Then they submitted another with the more deep changes, I wonder, what was so bad about disabling the compiler warning?
Created attachment 8566 [details] Removes a faulty patch which caused a "undefined symbol" error at runtime against aarch64 on a Raspberry Pi.
Here's a patch to fix it by going back to the "disable compiler warning and paper over the problem" approach, not sure if the maintainers will like it, but at least it fixed the problem for me in the short term.
(In reply to Christian Stewart from comment #1) > I wonder, what was so bad about disabling the compiler warning? Because duplicate symbols are a source for bugs. If we just add the -fcommon option, this indeed hides the warning away, but the problematic code will not get fixed, and we will have to carry that option ad libitum. Instead, we want patches that fixes those warnings, so those patches are sent to the corresponding upstreams, so the packages get fixed, and so we can drop those patches in a future version bump. So, I've had a look a deeper look at the patch now, and indeed it is not complete... I'll follow up with a revised fix. Stay tuned to the ML.
Thanks Yann. The patch I attached to this bug actually doesn't work anyway, the module still fails at runtime: File "usr/lib/python3.8/site-packages/RPi/GPIO/__init__.py", line 23, in <module> SystemError: Type does not define the tp_name field. Feel free to send me any patch for testing.
Created attachment 8571 [details] Fix patch, add runtime test
Christian, care to test the attached patch, please? The runtime test demonstrates that it is possible to import the module, but I have no way to test it on real hardware for now...
Hi Yann, looks to be working perfectly now. Thanks!
Christian, All, Fixed with commit ae6bd1eb44. Thanks for the report. Regards, Yann E. MORIN.