From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <famz@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Eric Blake" <eblake@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [Qemu-devel] [PATCH] DO NOT APPLY - demo broken unnest-vars with clashing .o filenames
Date: Mon, 11 Jun 2018 12:03:27 +0100 [thread overview]
Message-ID: <20180611110327.21218-1-berrange@redhat.com> (raw)
In a sub-directory source files may be conditionally built using a
Makefile.objs line such as
crypto-obj-$(CONFIG_CTHULHU) = foo.o
It is also possible to add custom linker flags for when this
foo.o is later linked into a binary
foo.o-libs = -lcthulhu
When the unqualfied 'foo.o' filename matches the name of an object in
another directory, however, it appears the linker flags leak out and
affect the linking of the foo.o from the other directory.
This patch demos the bug by adding a crypto/piix.o file. It should have
no effect because CONFIG_CTHULHU is not defined, however, the existence
of hw/pci-host/piix.o and hw/ide/piix.o in fact causes '-lcthulhu' to be
added to the link line twice, causing build failure:
$ make
LINK x86_64-softmmu/qemu-system-x86_64
/usr/bin/ld: cannot find -lcthuhlu
/usr/bin/ld: cannot find -lcthuhlu
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:193: qemu-system-x86_64] Error 1
make: *** [Makefile:482: subdir-x86_64-softmmu] Error 2
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
crypto/Makefile.objs | 4 ++++
crypto/piix.c | 2 ++
2 files changed, 6 insertions(+)
create mode 100644 crypto/piix.c
diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
index 2b99e08062..73b4548f12 100644
--- a/crypto/Makefile.objs
+++ b/crypto/Makefile.objs
@@ -38,3 +38,7 @@ crypto-obj-y += block-luks.o
crypto-aes-obj-y = aes.o
stub-obj-y += pbkdf-stub.o
+
+
+crypto-obj-$(CONFIG_CTHUHLU) += piix.o
+piix.o-libs = -lcthuhlu
diff --git a/crypto/piix.c b/crypto/piix.c
new file mode 100644
index 0000000000..367683f7bb
--- /dev/null
+++ b/crypto/piix.c
@@ -0,0 +1,2 @@
+
+random garbage as this ".c" file will never be built
--
2.17.0
next reply other threads:[~2018-06-11 11:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 11:03 Daniel P. Berrangé [this message]
2018-06-11 11:24 ` [Qemu-devel] [PATCH] DO NOT APPLY - demo broken unnest-vars with clashing .o filenames no-reply
2018-06-11 11:31 ` no-reply
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=20180611110327.21218-1-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).