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
BUG: compile error on MIPS architecture #274
Comments
Thanks for the report @pudh4418, I'll take a look. |
It turns out that the MIPS GCC compiler defines the "mips" symbol which was resulting in build failures on MIPS so we need to namespace the arch/ABI fields in the arch_syscall_table struct. This was reported in the following GH issue: * seccomp#274 Signed-off-by: Paul Moore <paul@paul-moore.com>
Hi @pudh4418, can you check the commit below? I think it should fix your problem: Also, I'd like to give you credit for reporting the bug in the commit via the |
It seems the fix is not that easy. After applying your patch, error messages turn to:
You may put |
Ungh, that's pretty awful. Thanks for testing that out, let me see what I can do. |
As I'm working on this I just noticed that we use the "mips" string in a lot of places in the libseccomp code; I'm growing skeptical that GCC is defining a "mips" macro as that would mean this code never compiled (?!). Would you mind checking you application and build environment @pudh4418 to make sure that something else isn't defining a "mips" macro somewhere? |
It turns out that the MIPS GCC compiler defines the "mips" symbol which was resulting in build failures on MIPS so we need to namespace the arch/ABI fields in the arch_syscall_table struct. This was reported in the following GH issue: * seccomp#274 Reported-by: Rongwei Zhang <pudh4418@gmail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Some quick googling found this: @pudh4418 can you try compiling libseccomp with If this proves to be the case, this may be something we simply want to note in the README as obfuscating ever instance of the "mips" string in the code is going to be very annoying. |
Oh, I didn't find that post. I tried compiling with Fortunately, it seems adding |
Good find on |
It turns out that the MIPS GCC compiler defines a "mips" cpp macro which was resulting in build failures on MIPS so we need to undefine the "mips" macro during build. As this should be safe to do in all architectures, just add it to the compiler flags by default. This was reported in the following GH issue: * seccomp#274 Reported-by: Rongwei Zhang <pudh4418@gmail.com> Suggested-by: Rongwei Zhang <pudh4418@gmail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Sorry about the delay, but I put together a proper PR to fix this with PR #279. |
It turns out that the MIPS GCC compiler defines a "mips" cpp macro which was resulting in build failures on MIPS so we need to undefine the "mips" macro during build. As this should be safe to do in all architectures, just add it to the compiler flags by default. This was reported in the following GH issue: * seccomp#274 Reported-by: Rongwei Zhang <pudh4418@gmail.com> Suggested-by: Rongwei Zhang <pudh4418@gmail.com> Acked-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Hi @pcmoore, I noticed that this issue is marked for the 2.5.1 milestone but the fix is not part of the release-2.5 branch. |
It turns out that the MIPS GCC compiler defines a "mips" cpp macro which was resulting in build failures on MIPS so we need to undefine the "mips" macro during build. As this should be safe to do in all architectures, just add it to the compiler flags by default. This was reported in the following GH issue: * #274 Reported-by: Rongwei Zhang <pudh4418@gmail.com> Suggested-by: Rongwei Zhang <pudh4418@gmail.com> Acked-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com> (imported from commit 5cd9059)
This includes a fix for compiling on MIPS platforms: <seccomp/libseccomp#274> Signed-off-by: Roland Hieber <rhi@pengutronix.de> Message-Id: <20210228231043.10783-1-rhi@pengutronix.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Hi,
Compiling libseccomp v2.5.0 on MIPS will bring errors like this:
This error will also appear when cross compiling MIPS lib from x86-64. A preliminary analysis shows that GCC defines
mips
for MIPS architecture, thus the code becomesint 1;
.Maybe we can change it to a different name?
Thanks.
The text was updated successfully, but these errors were encountered: