You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will make the compilation fail on architectures others than the listed there, like MIPS. Distros like debian are shipping the runc binary for those architectures already.
Steps to reproduce the issue
No response
Describe the results you received and expected
I'd expect runc compiles in the same architectures as before or a clear reasoning explaining to users why we dropped some is provided
I think adding support for other architectures is simple, so it is worth it. I think we need to change this:
to just define the CFLAGS like "-DRUNC_USE_STDLIB" instead of error out.
and then in the file libct/dmz/Makefile provide a target for the arches that support nolibc, identical to the one we have today, and then another that doesn't add the flags to compile with nolibc (ie not add -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib -lgcc).
The stuff in cc_platform.mk you mention is related to cross-compilation, not nolibc usage. If you are on a MIPS machine, you already should be able to compile runc-dmz with your local compiler (well, aside from the lack of nolibc support 😉) because we don't do any of the platform stuff for the local architecture:
ifeq ($(GOARCH),$(shell GOARCH= $(GO) env GOARCH))
# use the native CC and STRIP
HOST :=
else # ...
So changing the $(error ...) line won't affect local compilation on MIPS (I don't know if Debian cross-compiles for MIPS). You probably need to rework cc_platform.mk a bit to make it work for both HOST configuration and detecting which platforms are supported by nolibc.
Oh, I looked at it quickly and missed that, thanks!
Then it is even simpler, we just need to look at the go arch and if nolibc is not supported, add a target that uses stdlib (using -DRUNC_USE_STDLIB as I said should do it).
Description
When re-working the cloned binary trick (#3987), we ended up doing this:
runc/cc_platform.mk
Lines 51 to 53 in 96a61d3
This will make the compilation fail on architectures others than the listed there, like MIPS. Distros like debian are shipping the runc binary for those architectures already.
Steps to reproduce the issue
No response
Describe the results you received and expected
I'd expect runc compiles in the same architectures as before or a clear reasoning explaining to users why we dropped some is provided
I think adding support for other architectures is simple, so it is worth it. I think we need to change this:
runc/cc_platform.mk
Lines 51 to 53 in 96a61d3
to just define the CFLAGS like "-DRUNC_USE_STDLIB" instead of error out.
and then in the file
libct/dmz/Makefile
provide a target for the arches that support nolibc, identical to the one we have today, and then another that doesn't add the flags to compile with nolibc (ie not add-fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib -lgcc
).Then, the _dmz.c file can have something like:
And this should do the trick.
I'm going afk for a few weeks tomorrow, so I'm not opening a PR I won't be able to be active. But it would be great if someone does so :)
cc @AkihiroSuda @cyphar
What version of runc are you using?
runc main
Host OS information
No response
Host kernel information
No response
The text was updated successfully, but these errors were encountered: