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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNAQvGpf7zFR49-5TwE-mknGE_Kbw3JuQ+3Qf0dp+DvmSVA@mail.gmail.com>
Date: Fri, 19 Jan 2024 14:29:47 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Palmer Dabbelt <palmer@...osinc.com>
Cc: nicolas@...sle.eu, nathan@...nel.org, linux-kbuild@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Makefile: Add HOST_GCC_SUFFIX and CROSS_GCC_SUFFIX

On Fri, Jan 19, 2024 at 4:20 AM Palmer Dabbelt <palmer@...osinc.com> wrote:
>
> From: Palmer Dabbelt <palmer@...osinc.com>
>
> I was just trying to track down a build bug with an old toolchain.
> Turns out Ubuntu installs old GCCs as something like
> riscv64-linux-gnu-gcc-10, which is a bit clunky to point the build at
> without a way to append a suffix to CC.


You can do:

make CROSS_COMPILE=riscv64-linux-gnu- CC=riscv64-linux-gnu-gcc-10





>
> There's already LLVM_SUFFIX, but nothing similar for GCC.  I've split
> out the host and target suffixes as users probably don't have the same
> version of for both (unlike LLVM, where the cross compiler is likely to
> support the host target).
>
> Signed-off-by: Palmer Dabbelt <palmer@...osinc.com>
> ---
> I've only given this some very minimal testing, but it at least works
> for my simple use case.
> ---
>  Makefile | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index f1b2fd977275..36ce336cda3b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -433,8 +433,8 @@ endif
>  HOSTCC = $(LLVM_PREFIX)clang$(LLVM_SUFFIX)
>  HOSTCXX        = $(LLVM_PREFIX)clang++$(LLVM_SUFFIX)
>  else
> -HOSTCC = gcc
> -HOSTCXX        = g++
> +HOSTCC = gcc$(HOST_GCC_SUFFIX)
> +HOSTCXX        = g++$(HOST_GCC_SUFFIX)
>  endif
>  HOSTRUSTC = rustc
>  HOSTPKG_CONFIG = pkg-config
> @@ -480,7 +480,7 @@ OBJDUMP             = $(LLVM_PREFIX)llvm-objdump$(LLVM_SUFFIX)
>  READELF                = $(LLVM_PREFIX)llvm-readelf$(LLVM_SUFFIX)
>  STRIP          = $(LLVM_PREFIX)llvm-strip$(LLVM_SUFFIX)
>  else
> -CC             = $(CROSS_COMPILE)gcc
> +CC             = $(CROSS_COMPILE)gcc$(CROSS_GCC_SUFFIX)
>  LD             = $(CROSS_COMPILE)ld
>  AR             = $(CROSS_COMPILE)ar
>  NM             = $(CROSS_COMPILE)nm
> --
> 2.43.0
>
>


-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ