Re: [PATCH v2 liburing 4/4] Add CONFIG_NOLIBC variable and macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/10/21 12:39 AM, Ammar Faizi wrote:
> For conditonal variable and macro to enable nolibc build.
> Add `--nolibc` option for `configure` to enable it.
> 
> Link: https://github.com/axboe/liburing/issues/443
> Signed-off-by: Ammar Faizi <ammar.faizi@xxxxxxxxxxxxxxxxxxxxx>
> ---
>  configure    |  8 ++++++++
>  src/Makefile | 13 ++++++++++++-
>  2 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 92f51bd..6712ce3 100755
> --- a/configure
> +++ b/configure
> @@ -24,6 +24,8 @@ for opt do
>    ;;
>    --cxx=*) cxx="$optarg"
>    ;;
> +  --nolibc) liburing_nolibc="yes"
> +  ;;
>    *)
>      echo "ERROR: unknown option $opt"
>      echo "Try '$0 --help' for more information"

This also needs an addition in the configure --help section.

> diff --git a/src/Makefile b/src/Makefile
> index 5e46a9d..290517d 100644
> --- a/src/Makefile
> +++ b/src/Makefile
> @@ -32,11 +32,22 @@ endif
>  
>  all: $(all_targets)
>  
> -liburing_srcs := setup.c queue.c syscall.c register.c
> +liburing_srcs := setup.c queue.c register.c
> +
> +ifeq ($(CONFIG_NOLIBC),y)
> +	liburing_srcs += nolibc.c
> +	override CFLAGS += -nostdlib -nolibc -nodefaultlibs -ffreestanding -fno-stack-protector
> +	override CPPFLAGS += -nostdlib -nolibc -nodefaultlibs -ffreestanding -fno-stack-protector
> +	override LINK_FLAGS += -nostdlib -nolibc -nodefaultlibs
> +else
> +	liburing_srcs += syscall.c
> +endif

If I build this with clang, I get a lot of:

clang: warning: argument unused during compilation: '-nolibc' [-Wunused-command-line-argument]

Apart from this reply and the little language tweaks I suggested, I
think this now looks good. If you can respin with these things fixed,
let's get it applied.

-- 
Jens Axboe




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux