bsd-user: Fix linking/dependency issues
v2 cover bsd-user: Fix linking/dependency issues
v2
Correct email address for Ed Maste
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
PATCH v2 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
@@ -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
Re: [Qemu-devel] [PATCH 1/3 v2] bsd-user: Revert part of update to rules.mk
Quoted 13 lines · Sean Bruno
In
c5cb1afc4675bf5ff66e7a149d2a8cffba2eaa9erules.mk change was causing complete failure on bsd-user when not using --disable-curlSigned-off-by Sean Bruno <[email protected]>--- rules.mak | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)rules.mak +0
-0
rules.mak QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d · line 29
Quoted 9 lines
rules.mak +2
-1@@ -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))
Fam, Paolo: looks like this extract-libs rune is stil causing problems :-(
thanks
-- PMM
Re: [Qemu-devel] [PATCH 1/3 v2] bsd-user: Revert part of update to rules.mk
Quoted 17 lines · Peter Maydell
Quoted 16 lines · Sean Bruno
In
c5cb1afc4675bf5ff66e7a149d2a8cffba2eaa9erules.mk change was causing complete failure on bsd-user when not using --disable-curlSigned-off-by Sean Bruno <[email protected]>--- rules.mak | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)rules.mak +0
-0@@ -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)
Quoted 9 lines
rules.mak QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d · line 29
Quoted 6 lines
rules.mak +2
-1-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))Fam, Paolo: looks like this extract-libs rune is stil causing problems :-(
Sean, could you show the configure command line?
Thanks,
Fam
Re: [Qemu-devel] [PATCH 1/3 v2] bsd-user: Revert part of update to rules.mk
Il 16/06/2014 11:12, Fam Zheng ha scritto:
Quoted 28 lines · Peter Maydell
Quoted 17 lines · Sean Bruno
Quoted 16 lines
In
c5cb1afc4675bf5ff66e7a149d2a8cffba2eaa9erules.mk change was causing complete failure on bsd-user when not using --disable-curlSigned-off-by Sean Bruno <[email protected]>--- rules.mak | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)rules.mak +0
-0@@ -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)Quoted 9 lines
rules.mak QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d · line 29
Quoted 6 lines
rules.mak +2
-1-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))Fam, Paolo: looks like this extract-libs rune is stil causing problems :-(
Quoted 1 line
Sean, could you show the configure command line?
Also please attach the "make V=1" output and config-host.mak file.
Paolo
Re: [Qemu-devel] [PATCH 1/3 v2] bsd-user: Revert part of update to rules.mk
Quoted 7 lines
Quoted 1 line
Sean, could you show the configure command line?
Also please attach the "make V=1" output and config-host.mak file.
Paolo
I'm using:
./configure --static --target-list="i386-bsd-user sparc-bsd-user
sparc64-bsd-user x86_64-bsd-user"
Log:
http://people.freebsd.org/~sbruno/qemu_build_fail.txt
sean
Re: [Qemu-devel] [PATCH 1/3 v2] bsd-user: Revert part of update to rules.mk
Quoted 10 lines · Sean Bruno
Quoted 7 lines
Quoted 1 line
Sean, could you show the configure command line?
Also please attach the "make V=1" output and config-host.mak file.
Paolo
I'm using:
Quoted 9 lines
./configure --static --target-list="i386-bsd-user sparc-bsd-user
sparc64-bsd-user x86_64-bsd-user"Log:
http://people.freebsd.org/~sbruno/qemu_build_fail.txtsean
Also, configure output
http://people.freebsd.org/~sbruno/qemu_user_configure.txt
sean
Re: [Qemu-devel] [PATCH 1/3 v2] bsd-user: Revert part of update to rules.mk
Il 16/06/2014 15:58, Sean Bruno ha scritto:
Quoted 17 lines · Sean Bruno
Quoted 16 lines
Quoted 7 lines
Quoted 1 line
Sean, could you show the configure command line?
Also please attach the "make V=1" output and config-host.mak file.
Paolo
I'm using:
./configure --static --target-list="i386-bsd-user sparc-bsd-user
sparc64-bsd-user x86_64-bsd-user"
Quoted 7 lines
Quoted 3 lines
sean
Also, configure output
So this is happening because the $(sort) removes the ordering between libraries and breaks static linking. Your patch likely does nothing except adding more copies of the libraries, which lets the linker work.
The executable that breaks is qemu-nbd, which I suspect you couldn't care less about.
The bug remains, and ought to be fixed, probably like this:
rules.mak +1 -1
@@ -22,7 +22,7 @@ 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 = $(foreach o,$1,$($o-libs)) expand-objs = $(strip $(sort $(filter %.o,$1)) \ $(foreach o,$(filter %.mo,$1),$($o-objs)) \ $(filter-out %.o %.mo,$1))
but the other question is: do we care about static linking of anything except the user-mode emulators? Should --static automatically imply --disable-tools --disable-system?
Paolo
Re: [Qemu-devel] [PATCH 1/3 v2] bsd-user: Revert part of update to rules.mk
Quoted 49 lines · Paolo Bonzini
Il 16/06/2014 15:58, Sean Bruno ha scritto:
Quoted 17 lines · Sean Bruno
Quoted 16 lines
Quoted 7 lines
Quoted 1 line
Sean, could you show the configure command line?
Also please attach the "make V=1" output and config-host.mak file.
Paolo
I'm using:
./configure --static --target-list="i386-bsd-user sparc-bsd-user
sparc64-bsd-user x86_64-bsd-user"Quoted 7 lines
Quoted 3 lines
sean
Also, configure output
So this is happening because the $(sort) removes the ordering between libraries and breaks static linking. Your patch likely does nothing except adding more copies of the libraries, which lets the linker work.
The executable that breaks is qemu-nbd, which I suspect you couldn't care less about.
The bug remains, and ought to be fixed, probably like this:
rules.mak +1
-1@@ -22,7 +22,7 @@ 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 = $(foreach o,$1,$($o-libs)) expand-objs = $(strip $(sort $(filter %.o,$1)) \ $(foreach o,$(filter %.mo,$1),$($o-objs)) \ $(filter-out %.o %.mo,$1))
Quoted 5 lines
but the other question is: do we care about static linking of anything except the user-mode emulators? Should --static automatically imply --disable-tools --disable-system?
Paolo
Seems like this works for me on FreeBSD with my test case.
sean
Re: [Qemu-devel] [PATCH 1/3 v2] bsd-user: Revert part of update to rules.mk
In reply to Paolo BonziniQuoted 3 lines · Paolo Bonzini
but the other question is: do we care about static linking of anything except the user-mode emulators? Should --static automatically imply --disable-tools --disable-system?
It's certainly tempting. No doubt somebody somewhere is using the statically linked config, of course...
thanks
-- PMM
PATCH v2 2/3 bsd-user: Add patches to fix AES_* link errors
In reply to Sean BrunoRedefine 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
--- include/qemu/aes.h | 9 +++++++++ 1 file changed, 9 insertions(+)
include/qemu/aes.h +9 -0
@@ -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
PATCH v2 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
@@ -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