pkg/libb2: rename config.h to avoid conflicts in the global namespace, set HAVE_ALIGNED_ACCESS_REQUIRED based on CPU (fixes build on esp8266)#12135
Conversation
|
Ok, I created a patch for the libb2 pkg to rename the |
+1. Somehow using "config.h" in the global header namespace seems like a poor choice from the start... |
config.h to avoid conflicts in the global namespace, set
config.h to avoid conflicts in the global namespace, set |
On a second thought, adding a define to native and then relying on that to detect if we can do unaligned access or not seems like the cleaner solution. If this stretches the scope of this PR too much, I can remove it. |
|
Works on: arduino-due (arm), esp8266, esp32, iotlab-m3, native. |
|
Huh that's weird - does it also crash on master? |
It seems so. At least the output is repeated three times. I guess it crashes and restarts three times before the output stops. With the PR, the output above is repeated in an endless loop. |
|
@benpicco Please squash. I tried to investigate the problem a bit more. |
On Linux, even if the architecture does not support it, the kernel will catch the fault and emulate the unaligned accesss.
Most architectures do not support unaligned memory access, so set the define accordingly.
This is to avoid conflics with other config.h files, e.g. when building for esp8266 where $(NEWLIB)/xtensa-lx106-elf/include/config.h gets included instead.
|
Squashed. |
|
Lets go. |
Contribution description
tests/pkg_libb2fails to build on esp8266 targets. TheSUFFIXis used to select a CPU specific optimized implementation, e.g.SUFFIX=_avxenables the AVX code path,SUFFIX=_ssse3builds with SSE3 instructions and so on. Since we do not evaluatesrc/Makefile.am,SUFFIXis never set and the preprocessor just pasts it literal, resulting in function names likeblake2bSUFFIXfor which no implementation exists.To fix this, set
SUFFIXto empty string to select the generic implementation.Testing procedure
Build
tests/pkg_libb2Issues/PRs references
Discovered in #12133