[CRIU] [PATCH] build: nmk -- Filter out -Wl flags from linking builtin targets

Dmitry Safonov dsafonov at virtuozzo.com
Fri Jul 1 04:05:37 PDT 2016


On 06/30/2016 06:46 PM, Cyrill Gorcunov wrote:
> Tycho reported that Debian uses custom LDFLAGS to
> build criu, this flag get propagated into built-in
> targets where we use $(LD) instead causing build
> procedure to interrupt
>
> |  LINK     arch/x86/syscalls.built-in.o
> | ld: unrecognized option '-Wl,-Bsymbolic-functions'
> | ld: use the --help option for usage information
> | /«PKGBUILDDIR»/scripts/nmk/scripts/build.mk:141: recipe for target 'arch/x86/syscalls.built-in.o' failed
>
> Lets make maintainers life easier and filter
> out the flags we know never accepted by $(LD).
>
> Reported-by: Tycho Andersen <tycho.andersen at canonical.com>
> Tested-by: Tycho Andersen <tycho.andersen at canonical.com>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>

Should we pass those parameters to ld without -Wl, or silently ignore
them like in this patch?
Maybe ignore for simplicity for now. Anyway, anyone who want override
LDFLAGS may pass them without -Wl, so they wouldn't be filtered.

Reviewed-by: Dmitry Safonov <dsafonov at virtuozzo.com>

> ---
>  scripts/nmk/scripts/build.mk | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/scripts/nmk/scripts/build.mk b/scripts/nmk/scripts/build.mk
> index bd409441293e..87da2d97aee4 100644
> --- a/scripts/nmk/scripts/build.mk
> +++ b/scripts/nmk/scripts/build.mk
> @@ -25,6 +25,15 @@ ifndef obj
>  endif
>
>  #
> +# Filter out any -Wl,XXX option: some of build farms
> +# assumes that we're using $(CC) for building built-in
> +# targets (and they have all rights to). But we're
> +# using $(LD) directly instead so filter out -Wl
> +# flags to make maintainer's life easier.
> +LDFLAGS-MASK	:= -Wl,%
> +LDFLAGS		:= $(filter-out $(LDFLAGS-MASK),$(LDFLAGS))
> +
> +#
>  # Accumulate common flags.
>  define nmk-ccflags
>          $(CFLAGS) $(ccflags-y) $(CFLAGS_$(@F))
>


-- 
Regards,
Dmitry Safonov


More information about the CRIU mailing list