From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Masahiro Yamada <masahiroy@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org
Subject: x86 - weird cross-compile build problem with try-run next-20210602
Date: Fri, 04 Jun 2021 16:33:30 -0400 [thread overview]
Message-ID: <454425.1622838810@turing-police> (raw)
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'?
(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
next reply other threads:[~2021-06-04 20:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 20:33 Valdis Klētnieks [this message]
2021-06-05 8:19 ` x86 - weird cross-compile build problem with try-run next-20210602 Masahiro Yamada
2021-06-05 10:50 ` Valdis Klētnieks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=454425.1622838810@turing-police \
--to=valdis.kletnieks@vt.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox