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] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 5 Jun 2021 17:19:30 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Valdis Klētnieks <valdis.kletnieks@...edu>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        X86 ML <x86@...nel.org>
Subject: Re: x86 - weird cross-compile build problem with try-run next-20210602

On Sat, Jun 5, 2021 at 5:33 AM Valdis Klētnieks <valdis.kletnieks@...edu> wrote:
>
> I built a gcc 11.1 cross-compiler targeting x86_64, and builds
> were throwing an error message:
>
> Makefile:149: CONFIG_X86_X32 enabled but no binutils support
>
> so I added some debugging to arch/x86/Makefile:
>
> ifdef CONFIG_X86_X32
>         x32_ld_ok := $(call try-run,\
>                         /bin/echo -e '1: .quad 1b' | \
>                         $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" - && \
>                         $(OBJCOPY) -O elf32-x86-64 "$$TMP" "$$TMP.o" && \
>                         $(LD) -m elf32_x86_64 "$$TMP.o" -o "$$TMP",y,n)
>  $(warning x32_ld_ok is +$(x32_ld_ok)+ with CC=$(CC) $(KBUILD_AFLAGS) OBJ=$(OBJCOPY) LD=$(LD) )
>         ifeq ($(x32_ld_ok),y)
>                 CONFIG_X86_X32_ABI := y
>
> and that throws:
>
> arch/x86/Makefile:143: x32_ld_ok is ++ with CC=x86_64-unknown-linux-gnu-gcc -D__ASSEMBLY__ -fno-PIE -m64 OBJ=x86_64-unknown-linux-gnu-objcopy LD=x86_64-unknown-linux-gnu-ld
>
> Anybody have a clue why $(x32_ld_ok)  is null rather than 'y' or 'n'?


What command did you run?

I see this warning message for 'make install' for example.

$ make install
arch/x86/Makefile:148: CONFIG_X86_X32 enabled but no binutils support



Please add one more debug line:
  $(warning need-compiler is +$(need-compiler)+)
and what will you get?



One quick fix is to change

    ifeq ($(x32_ld_ok),y)

to

   ifneq ($(x32_ld_ok),n)

But, I think moving this check to Kconfig
is a more proper fix.







> (It's totally possible that my cross-compiler is broken, but I still don't see how
> try-run would return null rather than 'n' in that case...  I built a shell script that did the
> test and that ended with $? == 0, but had a warning msg:
>
> + /bin/echo -e '1: .quad 1b'
> + x86_64-unknown-linux-gnu-gcc -D__ASSEMBLY__ -fno-PIE -m64 -c -x assembler -o /tmp/z97 -
> + x86_64-unknown-linux-gnu-objcopy -O elf32-x86-64 /tmp/z97 /tmp/z99.o
> + x86_64-unknown-linux-gnu-ld -m elf32_x86_64 /tmp/z99.o -o /tmp/z98
> x86_64-unknown-linux-gnu-ld: warning: cannot find entry symbol _start; defaulting to 0000000000401000
> echo $?
> + echo 0
> 0
>
>
>


-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ