* [Qemu-devel] [PATCH v2] libcacard: fix compile error on glib2-2.12.3-4.el5
@ 2014-09-30 9:12 Zhi Yong Wu
2014-09-30 9:28 ` Paolo Bonzini
0 siblings, 1 reply; 7+ messages in thread
From: Zhi Yong Wu @ 2014-09-30 9:12 UTC (permalink / raw)
To: qemu-devel; +Cc: zwu.kernel, Zhi Yong Wu
lt LINK libcacard.la
CC libcacard/vscclient.o
lt LINK vscclient
/usr/bin/ld: -f may not be used without -shared
collect2: ld returned 1 exit status
make: *** [vscclient] Error 1
Suguested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Zhi Yong Wu <zhiyong.wzy@alibaba-inc.com>
---
Makefile | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index b33aaac..7cbf7dd 100644
--- a/Makefile
+++ b/Makefile
@@ -149,6 +149,8 @@ ifneq ($(wildcard config-host.mak),)
include $(SRC_PATH)/tests/Makefile
endif
ifeq ($(CONFIG_SMARTCARD_NSS),y)
+CFLAGS += -fPIC
+LDFLAGS += $(LDFLAGS_SHARED)
include $(SRC_PATH)/libcacard/Makefile
endif
--
1.5.5.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2] libcacard: fix compile error on glib2-2.12.3-4.el5
2014-09-30 9:12 [Qemu-devel] [PATCH v2] libcacard: fix compile error on glib2-2.12.3-4.el5 Zhi Yong Wu
@ 2014-09-30 9:28 ` Paolo Bonzini
2014-09-30 13:57 ` Zhi Yong Wu
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2014-09-30 9:28 UTC (permalink / raw)
To: Zhi Yong Wu, qemu-devel; +Cc: Zhi Yong Wu
Il 30/09/2014 11:12, Zhi Yong Wu ha scritto:
> diff --git a/Makefile b/Makefile
> index b33aaac..7cbf7dd 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -149,6 +149,8 @@ ifneq ($(wildcard config-host.mak),)
> include $(SRC_PATH)/tests/Makefile
> endif
> ifeq ($(CONFIG_SMARTCARD_NSS),y)
> +CFLAGS += -fPIC
> +LDFLAGS += $(LDFLAGS_SHARED)
> include $(SRC_PATH)/libcacard/Makefile
> endif
>
c++ ... -m64 -g -shared -o qemu-io qemu-io.o ...
So you are making all programs shared libraries? (And it would make no
sense even if you only made vscclient a shared library).
Can you include "make V=1" output in the commit message so that we
understand what is going on?
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2] libcacard: fix compile error on glib2-2.12.3-4.el5
2014-09-30 9:28 ` Paolo Bonzini
@ 2014-09-30 13:57 ` Zhi Yong Wu
2014-09-30 14:06 ` Paolo Bonzini
0 siblings, 1 reply; 7+ messages in thread
From: Zhi Yong Wu @ 2014-09-30 13:57 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU Developers, Zhi Yong Wu
c++ -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings
-Wmissing-prototypes -fno-strict-aliasing -fno-common -Wendif-labels
-Wmissing-include-dirs -Wnested-externs -Wformat-security -Wformat-y2k
-Winit-self -Wold-style-definition -fstack-protector-all
-I/usr/include/libpng12 -I/home/zhiyong.wzy/qemu/pixman/pixman
-I/home/zhiyong.wzy/qemu/pixman/pixman -I/home/zhiyong.wzy/qemu/tests
-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -g
-Wl,--warn-common -m64 -g -o fsdev/virtfs-proxy-helper
fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o libqemuutil.a
libqemustub.a -lm -pthread -L/lib64 -lgthread-2.0 -lglib-2.0 -lz
-lrt -lz -luuid -lutil -lcap
cc -I/home/zhiyong.wzy/qemu/tcg -I/home/zhiyong.wzy/qemu/tcg/i386
-I/home/zhiyong.wzy/qemu/linux-headers
-I/home/zhiyong.wzy/qemu/linux-headers -I. -I/home/zhiyong.wzy/qemu
-I/home/zhiyong.wzy/qemu/include -Ilibcacard -Ilibcacard -m64
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings
-Wmissing-prototypes -fno-strict-aliasing -fno-common -Wendif-labels
-Wmissing-include-dirs -Wnested-externs -Wformat-security -Wformat-y2k
-Winit-self -Wold-style-definition -fstack-protector-all
-I/usr/include/libpng12 -I/home/zhiyong.wzy/qemu/pixman/pixman
-I/home/zhiyong.wzy/qemu/pixman/pixman -I/home/zhiyong.wzy/qemu/tests
-MMD -MP -MT libcacard/vscclient.o -MF libcacard/vscclient.d -O2
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -g -c -o libcacard/vscclient.o
libcacard/vscclient.c
libtool --mode=link --tag=CC c++ -m64 -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
-Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes
-fno-strict-aliasing -fno-common -Wendif-labels
-Wmissing-include-dirs -Wnested-externs -Wformat-security -Wformat-y2k
-Winit-self -Wold-style-definition -fstack-protector-all
-I/usr/include/libpng12 -I/home/zhiyong.wzy/qemu/pixman/pixman
-I/home/zhiyong.wzy/qemu/pixman/pixman -I/home/zhiyong.wzy/qemu/tests
-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -g
-Wl,--warn-common -m64 -g -o vscclient libcacard/vscclient.o
libcacard.la -Wc,-fstack-protector-all -lm -pthread -L/lib64
-lgthread-2.0 -lglib-2.0 -lz -lrt -lz -luuid -lutil
c++ -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings
-Wmissing-prototypes -fno-strict-aliasing -fno-common -Wendif-labels
-Wmissing-include-dirs -Wnested-externs -Wformat-security -Wformat-y2k
-Winit-self -Wold-style-definition -fstack-protector-all
-I/usr/include/libpng12 -I/home/zhiyong.wzy/qemu/pixman/pixman
-I/home/zhiyong.wzy/qemu/pixman/pixman -I/home/zhiyong.wzy/qemu/tests
-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -g
-Wl,--warn-common -m64 -g -o .libs/vscclient libcacard/vscclient.o
-Wl,-fstack-protector-all -pthread ./.libs/libcacard.so -lssl3
-lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl
-L/lib64 -lm -lgthread-2.0 -lglib-2.0 -lrt -lz -luuid -lutil
-Wl,--rpath -Wl,/usr/local/lib
/usr/bin/ld: -f may not be used without -shared
collect2: ld returned 1 exit status
make: *** [vscclient] Error 1
On Tue, Sep 30, 2014 at 5:28 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Il 30/09/2014 11:12, Zhi Yong Wu ha scritto:
>> diff --git a/Makefile b/Makefile
>> index b33aaac..7cbf7dd 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -149,6 +149,8 @@ ifneq ($(wildcard config-host.mak),)
>> include $(SRC_PATH)/tests/Makefile
>> endif
>> ifeq ($(CONFIG_SMARTCARD_NSS),y)
>> +CFLAGS += -fPIC
>> +LDFLAGS += $(LDFLAGS_SHARED)
>> include $(SRC_PATH)/libcacard/Makefile
>> endif
>>
>
> c++ ... -m64 -g -shared -o qemu-io qemu-io.o ...
>
> So you are making all programs shared libraries? (And it would make no
> sense even if you only made vscclient a shared library).
>
> Can you include "make V=1" output in the commit message so that we
> understand what is going on?
>
> Paolo
--
Regards,
Zhi Yong Wu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2] libcacard: fix compile error on glib2-2.12.3-4.el5
2014-09-30 13:57 ` Zhi Yong Wu
@ 2014-09-30 14:06 ` Paolo Bonzini
2014-09-30 15:09 ` Zhi Yong Wu
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2014-09-30 14:06 UTC (permalink / raw)
To: Zhi Yong Wu; +Cc: QEMU Developers, Zhi Yong Wu
Il 30/09/2014 15:57, Zhi Yong Wu ha scritto:
> libtool --mode=link --tag=CC c++ -m64 -D_GNU_SOURCE
> -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
> -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes
> -fno-strict-aliasing -fno-common -Wendif-labels
> -Wmissing-include-dirs -Wnested-externs -Wformat-security -Wformat-y2k
> -Winit-self -Wold-style-definition -fstack-protector-all
> -I/usr/include/libpng12 -I/home/zhiyong.wzy/qemu/pixman/pixman
> -I/home/zhiyong.wzy/qemu/pixman/pixman -I/home/zhiyong.wzy/qemu/tests
> -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread
> -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -g
> -Wl,--warn-common -m64 -g -o vscclient libcacard/vscclient.o
> libcacard.la -Wc,-fstack-protector-all -lm -pthread -L/lib64
> -lgthread-2.0 -lglib-2.0 -lz -lrt -lz -luuid -lutil
> c++ -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
> -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings
> -Wmissing-prototypes -fno-strict-aliasing -fno-common -Wendif-labels
> -Wmissing-include-dirs -Wnested-externs -Wformat-security -Wformat-y2k
> -Winit-self -Wold-style-definition -fstack-protector-all
> -I/usr/include/libpng12 -I/home/zhiyong.wzy/qemu/pixman/pixman
> -I/home/zhiyong.wzy/qemu/pixman/pixman -I/home/zhiyong.wzy/qemu/tests
> -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread
> -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -g
> -Wl,--warn-common -m64 -g -o .libs/vscclient libcacard/vscclient.o
> -Wl,-fstack-protector-all -pthread ./.libs/libcacard.so -lssl3
> -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl
> -L/lib64 -lm -lgthread-2.0 -lglib-2.0 -lrt -lz -luuid -lutil
> -Wl,--rpath -Wl,/usr/local/lib
> /usr/bin/ld: -f may not be used without -shared
So the problem seems to be with "-Wl,-fstack-protector-all". Where does
it come from? QEMU or some pkg-config file?
Does it work if you configure with the --disable-stack-protector option?
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2] libcacard: fix compile error on glib2-2.12.3-4.el5
2014-09-30 14:06 ` Paolo Bonzini
@ 2014-09-30 15:09 ` Zhi Yong Wu
2014-09-30 15:16 ` Paolo Bonzini
0 siblings, 1 reply; 7+ messages in thread
From: Zhi Yong Wu @ 2014-09-30 15:09 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU Developers, Zhi Yong Wu
On Tue, Sep 30, 2014 at 10:06 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Il 30/09/2014 15:57, Zhi Yong Wu ha scritto:
>> libtool --mode=link --tag=CC c++ -m64 -D_GNU_SOURCE
>> -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
>> -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes
>> -fno-strict-aliasing -fno-common -Wendif-labels
>> -Wmissing-include-dirs -Wnested-externs -Wformat-security -Wformat-y2k
>> -Winit-self -Wold-style-definition -fstack-protector-all
>> -I/usr/include/libpng12 -I/home/zhiyong.wzy/qemu/pixman/pixman
>> -I/home/zhiyong.wzy/qemu/pixman/pixman -I/home/zhiyong.wzy/qemu/tests
>> -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread
>> -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -g
>> -Wl,--warn-common -m64 -g -o vscclient libcacard/vscclient.o
>> libcacard.la -Wc,-fstack-protector-all -lm -pthread -L/lib64
>> -lgthread-2.0 -lglib-2.0 -lz -lrt -lz -luuid -lutil
>> c++ -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
>> -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings
>> -Wmissing-prototypes -fno-strict-aliasing -fno-common -Wendif-labels
>> -Wmissing-include-dirs -Wnested-externs -Wformat-security -Wformat-y2k
>> -Winit-self -Wold-style-definition -fstack-protector-all
>> -I/usr/include/libpng12 -I/home/zhiyong.wzy/qemu/pixman/pixman
>> -I/home/zhiyong.wzy/qemu/pixman/pixman -I/home/zhiyong.wzy/qemu/tests
>> -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread
>> -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -g
>> -Wl,--warn-common -m64 -g -o .libs/vscclient libcacard/vscclient.o
>> -Wl,-fstack-protector-all -pthread ./.libs/libcacard.so -lssl3
>> -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl
>> -L/lib64 -lm -lgthread-2.0 -lglib-2.0 -lrt -lz -luuid -lutil
>> -Wl,--rpath -Wl,/usr/local/lib
>> /usr/bin/ld: -f may not be used without -shared
>
> So the problem seems to be with "-Wl,-fstack-protector-all". Where does
> it come from? QEMU or some pkg-config file?
>
> Does it work if you configure with the --disable-stack-protector option?
Yes, it can work now, i'm very suprised by how you know it is the root reason?
>
> Paolo
--
Regards,
Zhi Yong Wu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2] libcacard: fix compile error on glib2-2.12.3-4.el5
2014-09-30 15:09 ` Zhi Yong Wu
@ 2014-09-30 15:16 ` Paolo Bonzini
2014-09-30 15:26 ` Zhi Yong Wu
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2014-09-30 15:16 UTC (permalink / raw)
To: Zhi Yong Wu; +Cc: QEMU Developers, Zhi Yong Wu
Il 30/09/2014 17:09, Zhi Yong Wu ha scritto:
>> >
>> > So the problem seems to be with "-Wl,-fstack-protector-all". Where does
>> > it come from? QEMU or some pkg-config file?
>> >
>> > Does it work if you configure with the --disable-stack-protector option?
> Yes, it can work now, i'm very suprised by how you know it is the root reason?
Because it is the only -f option that is passed to the linker.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2] libcacard: fix compile error on glib2-2.12.3-4.el5
2014-09-30 15:16 ` Paolo Bonzini
@ 2014-09-30 15:26 ` Zhi Yong Wu
0 siblings, 0 replies; 7+ messages in thread
From: Zhi Yong Wu @ 2014-09-30 15:26 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU Developers, Zhi Yong Wu
On Tue, Sep 30, 2014 at 11:16 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Il 30/09/2014 17:09, Zhi Yong Wu ha scritto:
>>> >
>>> > So the problem seems to be with "-Wl,-fstack-protector-all". Where does
>>> > it come from? QEMU or some pkg-config file?
>>> >
>>> > Does it work if you configure with the --disable-stack-protector option?
>> Yes, it can work now, i'm very suprised by how you know it is the root reason?
>
> Because it is the only -f option that is passed to the linker.
heh, thanks.
>
> Paolo
--
Regards,
Zhi Yong Wu
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-09-30 15:26 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30 9:12 [Qemu-devel] [PATCH v2] libcacard: fix compile error on glib2-2.12.3-4.el5 Zhi Yong Wu
2014-09-30 9:28 ` Paolo Bonzini
2014-09-30 13:57 ` Zhi Yong Wu
2014-09-30 14:06 ` Paolo Bonzini
2014-09-30 15:09 ` Zhi Yong Wu
2014-09-30 15:16 ` Paolo Bonzini
2014-09-30 15:26 ` Zhi Yong Wu
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).