-
Notifications
You must be signed in to change notification settings - Fork 257
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
asm generic termbits.h macro "B0" collides with other macros #630
Comments
From the blog post, the issue appears to be:
This code doesn't compile with Bionic, but it does with glibc, musl, and FreeBSD: #include <sys/ioctl.h>
int main() {
int B0 = 0;
} Maybe |
sounds plausible to me, based on what that the only issue will be compatibility with ourselves. testing that for the platform now: https://android-review.googlesource.com/#/c/platform/bionic/+/600968/ |
(it's one of a number of baud rate constants for serial lines. there's B0, B300, B2400, et cetera. it's a legit POSIX constant, but POSIX says it's in |
Cool, would the change make it in the next version of the NDK? Edit: I applied that change to the standalone toolchain similar to the change above and I still get the error. Based on the review change above, also removing |
The history has no motivation for <asm/termbits.h>, and other C libraries don't seem to include any of the extra types and constants that gains us. This caused problems building FFMPEG, which defines its own B0. Bug: android/ndk#630 Test: builds Change-Id: If032b9fa7860777c13f7bd8e68fb78ff606dcd94
that's more of a problem because btw, that page you linked to isn't the right way to build configure-based projects with the NDK (you can tell because it installs a different compiler). see https://developer.android.com/ndk/guides/standalone_toolchain.html#building_open_source_projects_using_standalone_toolchains for how it should actually work. |
For anyone reading this in the future, to prevent this without modifying the ndk or ffmpeg code, use
It will make /ffmpeg/ffbuild/config.mak comment out the line |
@matthewn4444 Very good solution |
Description
Compiling with libraries such as (newest) FFMPEG with arm64-v8a collides with several functions of the macro B0 (such as hevc_mvs.c). You can see how it may cause issues in this person's blog: http://alientechlab.com/how-to-build-ffmpeg-for-android/
Basically what happens is sysroot/usr/include/asm-generic/termbits.h defines a macro definition of
#define B0 0000000000
and FFMPEG uses variables such as
And then replaces them with 0000000000 as
Which then leads to compile issues like
Sorry for my ignorance but does B0 have some special reason for being 00000000? Could this be changed in the future since this could potentially have collisions with other libraries (for only being 2 letters). (I am not sure if FFMPEG wants to rewrite their variables).
For now, I am using a script to comment that line out (from the termbits.h).
To reproduce you can follow the instructions in that blog (clone FFMPEG, configure, make and make install)
Environment Details
The text was updated successfully, but these errors were encountered: