github.com/opencontainers/runc@v1.2.0-rc.1.0.20240520010911-492dc558cdd6/libcontainer/dmz/Makefile (about)

     1  # Get GO, GOARCH and CC values for cross-compilation.
     2  include ../../cc_platform.mk
     3  
     4  # List of GOARCH that nolibc supports, from:
     5  # 	https://go.dev/doc/install/source#environment (with GOOS=linux)
     6  #
     7  # See nolibc supported arches in ./nolibc/arch-*.h
     8  NOLIBC_GOARCHES := 386 amd64 arm arm64 loong64 ppc64le riscv64 s390x
     9  
    10  ifneq (,$(filter $(GOARCH), $(NOLIBC_GOARCHES)))
    11  	# We use the flags suggested in nolibc/nolibc.h, it makes the binary very small.
    12  	CFLAGS += -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib -lgcc
    13  else
    14  	CFLAGS += -DRUNC_USE_STDLIB
    15  endif
    16  
    17  binary/runc-dmz: _dmz.c
    18  	$(CC) $(CFLAGS) -static -o $@ $^
    19  	$(STRIP) -gs $@