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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 3 Nov 2017 23:41:57 +0300
From:   Yury Norov <>
To:     Sami Tolvanen <>
        Greg Hackmann <>,
        Kees Cook <>,
        Matthias Kaehlcke <>,
        Nick Desaulniers <>
Subject: Re: [PATCH 08/15] arm64: don't pass -maarch64linux to GNU gold

Hi Sami,

Very interesting reading, thank you.

On Fri, Nov 03, 2017 at 10:11:53AM -0700, Sami Tolvanen wrote:
> This change fixes the following error message when linking with GNU
> gold:
> error: unrecognized emulation aarch64linux
> Signed-off-by: Sami Tolvanen <>
> ---
>  arch/arm64/Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index eb6f3c9ec6cb..c16bd1ab37f8 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -64,14 +64,18 @@ KBUILD_CPPFLAGS	+= -mbig-endian
>  AS		+= -EB
>  LD		+= -EB
> +ifneq ($(ld-name),gold)
>  LDFLAGS		+= -maarch64linuxb
> +endif
>  UTS_MACHINE	:= aarch64_be
>  else
>  KBUILD_CPPFLAGS	+= -mlittle-endian
>  AS		+= -EL
>  LD		+= -EL
> +ifneq ($(ld-name),gold)
>  LDFLAGS		+= -maarch64linux
> +endif
>  UTS_MACHINE	:= aarch64
>  endif

-maarch64linux was added to LDFLAGS, and -mabi=lp64 was added to CFLAGS
at the same patch to ensure that kernel will be compiled and linked in
lp64 mode, even if toolchain by default compiles and links targets in
ilp32 mode. So I think that simple removing this flag looks inaccurate.

Also, IIUC, this patch is not related to LTO, because if doesn't
recognize -maarch64linux with LTO, it will not recognize it in non-LTO
build. Am I right?

I think that more correct way to do it would be either:
 - add maarch64linux to, if possible. In discussion to other
   patches people talk that they need very fresh clang to build kernel
   properly, so this may be considered as similar issue;
 - if understands some synonyms like -mabi=lp64, it should be
   passed to LDFLAGS here;
 - if can link only lp64 objects, it should be commented here.
   But in this case I don't understand for example how to build vdso
   for ilp32 userspace...


Powered by blists - more mailing lists