From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/qemu/files/, app-emulation/qemu/
Date: Tue, 7 Jun 2016 03:02:25 +0000 (UTC) [thread overview]
Message-ID: <1465268352.cb48eca5e347d3b916edb77078f1d2bd39716d66.vapier@gentoo> (raw)
commit: cb48eca5e347d3b916edb77078f1d2bd39716d66
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 7 02:58:50 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Jun 7 02:59:12 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb48eca5
app-emulation/qemu: fix static linking errors w/curl[ssl,curl_ssl_openssl]
.../qemu/files/qemu-2.6.0-crypto-static.patch | 60 ++++++++++++++++++++++
app-emulation/qemu/qemu-2.6.0.ebuild | 3 +-
app-emulation/qemu/qemu-9999.ebuild | 4 +-
3 files changed, 65 insertions(+), 2 deletions(-)
diff --git a/app-emulation/qemu/files/qemu-2.6.0-crypto-static.patch b/app-emulation/qemu/files/qemu-2.6.0-crypto-static.patch
new file mode 100644
index 0000000..4856373
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.6.0-crypto-static.patch
@@ -0,0 +1,60 @@
+https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg01611.html
+
+From 6a2909cf98e892783b2502df6f7f4de46d13e42b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Mon, 6 Jun 2016 17:58:26 -0400
+Subject: [PATCH] crypto: aes: always rename internal symbols
+
+OpenSSL's libcrypto always defines AES symbols with the same names as
+qemu's local aes code. This is problematic when enabling at least curl
+as that frequently also uses libcrypto. It might not be noticed when
+running, but if you try to statically link, everything falls down.
+
+An example snippet:
+ LINK qemu-nbd
+.../libcrypto.a(aes-x86_64.o): In function 'AES_encrypt':
+(.text+0x460): multiple definition of 'AES_encrypt'
+crypto/aes.o:aes.c:(.text+0x670): first defined here
+.../libcrypto.a(aes-x86_64.o): In function 'AES_decrypt':
+(.text+0x9f0): multiple definition of 'AES_decrypt'
+crypto/aes.o:aes.c:(.text+0xb30): first defined here
+.../libcrypto.a(aes-x86_64.o): In function 'AES_cbc_encrypt':
+(.text+0xf90): multiple definition of 'AES_cbc_encrypt'
+crypto/aes.o:aes.c:(.text+0xff0): first defined here
+collect2: error: ld returned 1 exit status
+.../qemu-2.6.0/rules.mak:105: recipe for target 'qemu-nbd' failed
+make: *** [qemu-nbd] Error 1
+
+The aes.h header has redefines already for FreeBSD, but go ahead and
+enable that for everyone since there's no real good reason to not use
+a namespace all the time.
+
+Signed-off-by: Mike Frysinger <vapier@chromium.org>
+---
+ include/crypto/aes.h | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/include/crypto/aes.h b/include/crypto/aes.h
+index a006da2224a9..12fb321b89de 100644
+--- a/include/crypto/aes.h
++++ b/include/crypto/aes.h
+@@ -10,14 +10,13 @@ struct aes_key_st {
+ };
+ typedef struct aes_key_st AES_KEY;
+
+-/* FreeBSD has its own AES_set_decrypt_key in -lcrypto, avoid conflicts */
+-#ifdef __FreeBSD__
++/* FreeBSD/OpenSSL have their own AES functions with the same names in -lcrypto
++ * (which might be pulled in via curl), so redefine to avoid conflicts. */
+ #define AES_set_encrypt_key QEMU_AES_set_encrypt_key
+ #define AES_set_decrypt_key QEMU_AES_set_decrypt_key
+ #define AES_encrypt QEMU_AES_encrypt
+ #define AES_decrypt QEMU_AES_decrypt
+ #define AES_cbc_encrypt QEMU_AES_cbc_encrypt
+-#endif
+
+ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+--
+2.8.2
+
diff --git a/app-emulation/qemu/qemu-2.6.0.ebuild b/app-emulation/qemu/qemu-2.6.0.ebuild
index 81504ad..95a953e 100644
--- a/app-emulation/qemu/qemu-2.6.0.ebuild
+++ b/app-emulation/qemu/qemu-2.6.0.ebuild
@@ -327,8 +327,9 @@ src_prepare() {
-e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
Makefile Makefile.target || die
- epatch "${FILESDIR}"/qemu-2.5.0-cflags.patch
+ epatch "${FILESDIR}"/${PN}-2.5.0-cflags.patch
epatch "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch
+ epatch "${FILESDIR}"/${PN}-2.6.0-crypto-static.patch
# Fix ld and objcopy being called directly
tc-export AR LD OBJCOPY
diff --git a/app-emulation/qemu/qemu-9999.ebuild b/app-emulation/qemu/qemu-9999.ebuild
index 8f136c3..95a953e 100644
--- a/app-emulation/qemu/qemu-9999.ebuild
+++ b/app-emulation/qemu/qemu-9999.ebuild
@@ -327,7 +327,9 @@ src_prepare() {
-e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
Makefile Makefile.target || die
- epatch "${FILESDIR}"/qemu-2.5.0-cflags.patch
+ epatch "${FILESDIR}"/${PN}-2.5.0-cflags.patch
+ epatch "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch
+ epatch "${FILESDIR}"/${PN}-2.6.0-crypto-static.patch
# Fix ld and objcopy being called directly
tc-export AR LD OBJCOPY
next reply other threads:[~2016-06-07 3:02 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-07 3:02 Mike Frysinger [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-10-12 6:33 [gentoo-commits] repo/gentoo:master commit in: app-emulation/qemu/files/, app-emulation/qemu/ Sam James
2025-05-07 18:41 Sam James
2025-02-26 6:31 Sam James
2025-02-20 17:17 Sam James
2024-04-29 2:38 Sam James
2023-07-02 23:35 Sam James
2023-07-02 23:01 Sam James
2023-05-18 21:07 Matthias Maier
2023-05-05 18:11 Matthias Maier
2023-02-21 6:50 Sam James
2023-02-04 16:46 Andreas K. Hüttel
2022-12-08 1:22 John Helmert III
2022-11-12 19:43 Andreas K. Hüttel
2022-09-27 17:31 John Helmert III
2022-08-03 18:21 Sam James
2022-07-05 1:05 WANG Xuerui
2022-06-04 3:01 Sam James
2022-05-22 15:59 John Helmert III
2022-03-29 5:38 Sam James
2022-01-01 1:22 John Helmert III
2021-12-21 23:53 John Helmert III
2021-06-26 19:59 Sergei Trofimovich
2021-04-12 19:39 Sergei Trofimovich
2021-02-28 23:24 Sergei Trofimovich
2020-12-12 23:53 Sergei Trofimovich
2020-12-12 8:33 Sergei Trofimovich
2020-12-10 15:03 Sergei Trofimovich
2020-10-21 20:55 Sergei Trofimovich
2020-09-08 7:33 Sergei Trofimovich
2020-04-24 19:59 Sergei Trofimovich
2020-04-16 22:16 Sergei Trofimovich
2019-05-21 3:53 Matthias Maier
2019-05-17 8:58 Matthias Maier
2019-05-17 7:43 Matthias Maier
2019-04-29 6:48 Matthias Maier
2019-02-19 0:19 Matthias Maier
2018-08-19 17:49 Matthias Maier
2018-06-15 14:10 Jason Donenfeld
2018-03-27 15:44 Matthias Maier
2018-03-18 20:02 Matthias Maier
2017-11-12 20:22 Matthias Maier
2017-07-26 17:15 Matthias Maier
2017-05-18 4:20 Matthias Maier
2017-04-25 13:51 Matthias Maier
2017-03-27 4:03 Matthias Maier
2017-02-13 4:58 Matthias Maier
2016-12-29 18:47 Mike Frysinger
2016-11-12 17:29 Matthias Maier
2016-09-27 2:17 Matthias Maier
2016-09-09 5:23 Matthias Maier
2016-09-05 16:45 Matthias Maier
2016-09-05 5:30 Matthias Maier
2016-08-07 14:04 Luca Barbato
2016-05-17 4:41 Mike Frysinger
2016-04-23 20:30 Mike Frysinger
2016-03-23 5:25 Mike Frysinger
2015-12-15 5:55 Mike Frysinger
2015-12-08 3:17 Mike Frysinger
2015-11-23 0:41 Mike Frysinger
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=1465268352.cb48eca5e347d3b916edb77078f1d2bd39716d66.vapier@gentoo \
--to=vapier@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.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