Skip to contentSkip to conversation

bsd-user: Fix linking/dependency issues

PATCH Superseded Sean Bruno 2 participants 5 messages Jun 15, 2014 – Jun 16, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sean Bruno

author
#0 lore raw

cover bsd-user: Fix linking/dependency issues

Recent changes to master caused complete failures to build bsd-user.

Sean Bruno (3):
bsd-user: Revert part of c5cb1afc4675bf5ff66e7a149d2a8cffba2eaa9e
bsd-user: Add patches to fix AES_* link errors
bsd-user: Implement strace support for getcwd syscall

 bsd-user/freebsd/strace.list | 1 +
 include/qemu/aes.h           | 9 +++++++++
 rules.mak                    | 3 ++-
 3 files changed, 12 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.3
author
#1 lore raw

PATCH 1/3 bsd-user: Revert part of update to rules.mk

In c5cb1afc4675bf5ff66e7a149d2a8cffba2eaa9e rules.mk change was causing complete failure on bsd-user when not using --disable-curl

---
 rules.mak | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
rules.mak +2 -1
index dde8e00..4a33c27 100644
@@ -22,7 +22,8 @@ QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d
 # Same as -I$(SRC_PATH) -I., but for the nested source/object directories
 QEMU_INCLUDES += -I$(<D) -I$(@D)
 
-extract-libs = $(strip $(sort $(foreach o,$1,$($o-libs))))
+extract-libs = $(strip $(sort $(foreach o,$1,$($o-libs))) \
+                  $(foreach o,$(call expand-objs,$1),$($o-libs)))
 expand-objs = $(strip $(sort $(filter %.o,$1)) \
                   $(foreach o,$(filter %.mo,$1),$($o-objs)) \
                   $(filter-out %.o %.mo,$1))
Signature · 1 line
1.9.3
author
#2 lore raw

PATCH 2/3 bsd-user: Add patches to fix AES_* link errors

In reply to Sean Bruno

Redefine functions as QEMU_AES_* to avoid conflicts with AES_* in -lcrypto needed (at least) by -lcurl.

Take from emulators/qemu-devel/files/patch-include-qemu-aes.h

Signed-off-by Ed Maste <emastefreebsd.org>
---
 include/qemu/aes.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/qemu/aes.h +9 -0
index e79c707..d310411 100644
@@ -10,6 +10,15 @@ struct aes_key_st {
 };
 typedef struct aes_key_st AES_KEY;
 
+/* FreeBSD has it's own AES_set_decrypt_key in -lcrypto, avoid conflicts */
+#ifdef __FreeBSD__
+#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);
 int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
Signature · 1 line
1.9.3
author
#3 lore raw

PATCH 3/3 bsd-user: Implement strace support for getcwd syscall

In reply to Sean Bruno
---
 bsd-user/freebsd/strace.list | 1 +
 1 file changed, 1 insertion(+)
bsd-user/freebsd/strace.list +1 -0
index 2800a2d..f10caaa 100644
@@ -28,6 +28,7 @@
 { TARGET_FREEBSD_NR___acl_set_fd, "__acl_set_fd", "%s(%d, %d, %#x)", NULL, NULL },
 { TARGET_FREEBSD_NR___acl_set_file, "__acl_set_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
 { TARGET_FREEBSD_NR___acl_set_link, "__acl_set_link", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___getcwd, "__getcwd", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR___semctl, "__semctl", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR___syscall, "__syscall", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR___sysctl, "__sysctl", NULL, print_sysctl, NULL },
Signature · 1 line
1.9.3
#4 lore raw

Re: [Qemu-devel] [PATCH 3/3] bsd-user: Implement strace support for getcwd syscall

Quoted 10 lines · Sean Bruno
---
 bsd-user/freebsd/strace.list | 1 +
 1 file changed, 1 insertion(+)
bsd-user/freebsd/strace.list +0 -0
index 2800a2d..f10caaa 100644

bsd-user/freebsd/strace.list line 34

Quoted 7 lines
bsd-user/freebsd/strace.list +1 -0
@@ -28,6 +28,7 @@
 { TARGET_FREEBSD_NR___acl_set_fd, "__acl_set_fd", "%s(%d, %d, %#x)", NULL, NULL },
 { TARGET_FREEBSD_NR___acl_set_file, "__acl_set_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
 { TARGET_FREEBSD_NR___acl_set_link, "__acl_set_link", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___getcwd, "__getcwd", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR___semctl, "__semctl", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR___syscall, "__syscall", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR___sysctl, "__sysctl", NULL, print_sysctl, NULL },

This doesn't look like it belongs in with the build fixes patches...

thanks
-- PMM