lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMcCCgRGpi+3D4479MLU2xQZJYBA1c6mzZ=bb1VLEwPg3VAgLg@mail.gmail.com>
Date:   Wed, 12 Aug 2020 19:31:32 -0700
From:   Tom Hebb <tommyhebb@...il.com>
To:     Daniel Díaz <daniel.diaz@...aro.org>
Cc:     Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        Andrii Nakryiko <andriin@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...omium.org>,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Stephane Eranian <eranian@...gle.com>,
        Namhyung Kim <namhyung@...nel.org>,
        open list <linux-kernel@...r.kernel.org>,
        "open list:BPF (Safe dynamic programs and tools)" 
        <netdev@...r.kernel.org>,
        "open list:BPF (Safe dynamic programs and tools)" 
        <bpf@...r.kernel.org>
Subject: Re: [PATCH] tools build feature: Quote CC and CXX for their arguments

On Wed, Aug 12, 2020 at 3:15 PM Daniel Díaz <daniel.diaz@...aro.org> wrote:
>
> When using a cross-compilation environment, such as OpenEmbedded,
> the CC an CXX variables are set to something more than just a
> command: there are arguments (such as --sysroot) that need to be
> passed on to the compiler so that the right set of headers and
> libraries are used.
>
> For the particular case that our systems detected, CC is set to
> the following:
>
>   export CC="aarch64-linaro-linux-gcc  --sysroot=/oe/build/tmp/work/machine/perf/1.0-r9/recipe-sysroot"
>
> Without quotes, detection is as follows:
>
>   Auto-detecting system features:
>   ...                         dwarf: [ OFF ]
>   ...            dwarf_getlocations: [ OFF ]
>   ...                         glibc: [ OFF ]
>   ...                          gtk2: [ OFF ]
>   ...                        libbfd: [ OFF ]
>   ...                        libcap: [ OFF ]
>   ...                        libelf: [ OFF ]
>   ...                       libnuma: [ OFF ]
>   ...        numa_num_possible_cpus: [ OFF ]
>   ...                       libperl: [ OFF ]
>   ...                     libpython: [ OFF ]
>   ...                     libcrypto: [ OFF ]
>   ...                     libunwind: [ OFF ]
>   ...            libdw-dwarf-unwind: [ OFF ]
>   ...                          zlib: [ OFF ]
>   ...                          lzma: [ OFF ]
>   ...                     get_cpuid: [ OFF ]
>   ...                           bpf: [ OFF ]
>   ...                        libaio: [ OFF ]
>   ...                       libzstd: [ OFF ]
>   ...        disassembler-four-args: [ OFF ]
>
>   Makefile.config:414: *** No gnu/libc-version.h found, please install glibc-dev[el].  Stop.
>   Makefile.perf:230: recipe for target 'sub-make' failed
>   make[1]: *** [sub-make] Error 2
>   Makefile:69: recipe for target 'all' failed
>   make: *** [all] Error 2
>
> With CC and CXX quoted, some of those features are now detected.
>
> Fixes: e3232c2f39ac ("tools build feature: Use CC and CXX from parent")
>
> Signed-off-by: Daniel Díaz <daniel.diaz@...aro.org>

Whoops, I'm the one who introduced this issue. Fix looks good, thanks!

Reviewed-by: Thomas Hebb <tommyhebb@...il.com>
Fixes: e3232c2f39ac ("tools build feature: Use CC and CXX from parent")

> ---
>  tools/build/Makefile.feature | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> index 774f0b0ca28a..e7818b44b48e 100644
> --- a/tools/build/Makefile.feature
> +++ b/tools/build/Makefile.feature
> @@ -8,7 +8,7 @@ endif
>
>  feature_check = $(eval $(feature_check_code))
>  define feature_check_code
> -  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CC=$(CC) CXX=$(CXX) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" CXXFLAGS="$(EXTRA_CXXFLAGS) $(FEATURE_CHECK_CXXFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C $(feature_dir) $(OUTPUT_FEATURES)test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
> +  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CC="$(CC)" CXX="$(CXX)" CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" CXXFLAGS="$(EXTRA_CXXFLAGS) $(FEATURE_CHECK_CXXFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C $(feature_dir) $(OUTPUT_FEATURES)test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)

We should probably also be quoting the arguments that expand $(OUTPUT_FEATURES)
too, although trying to handle path names with spaces is probably a
lost cause anyway.

>  endef
>
>  feature_set = $(eval $(feature_set_code))
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ