-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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_libb2
fails to build on esp8266 targets. TheSUFFIX
is used to select a CPU specific optimized implementation, e.g.SUFFIX=_avx
enables the AVX code path,SUFFIX=_ssse3
builds with SSE3 instructions and so on. Since we do not evaluatesrc/Makefile.am
,SUFFIX
is never set and the preprocessor just pasts it literal, resulting in function names likeblake2bSUFFIX
for which no implementation exists.To fix this, set
SUFFIX
to empty string to select the generic implementation.Testing procedure
Build
tests/pkg_libb2
Issues/PRs references
Discovered in #12133