Re: [OE-core] [PATCH] qemu: always define unknown_lock_type

2020-09-16 Thread Yu, Mingli



On 9/15/20 6:26 PM, Ross Burton wrote:

On Mon, 14 Sep 2020 at 16:23, Khem Raj  wrote:


perhaps you are not using one of -O option ?


-Og passed to the compiler as DEBUG_BUILD = "1" defined in local.conf.


Does qemu work when built with -Og


This is the pertinent question.  If qemu doesn't run after
un-upstreamable patches when built with -Og, what's the point?
Debuggable code that you can't execute serves no purpose.

If qemu *needs* to be optimised to actually execute then override
DEBUG_BUILD to optimise at the lowest usable level.


Thanks! Will sent a patch to override DEBUG_BUILD for qemu.



Ross





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#142601): 
https://lists.openembedded.org/g/openembedded-core/message/142601
Mute This Topic: https://lists.openembedded.org/mt/76748224/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] qemu: always define unknown_lock_type

2020-09-15 Thread Ross Burton
On Mon, 14 Sep 2020 at 16:23, Khem Raj  wrote:

> > > perhaps you are not using one of -O option ?
> >
> > -Og passed to the compiler as DEBUG_BUILD = "1" defined in local.conf.
>
> Does qemu work when built with -Og

This is the pertinent question.  If qemu doesn't run after
un-upstreamable patches when built with -Og, what's the point?
Debuggable code that you can't execute serves no purpose.

If qemu *needs* to be optimised to actually execute then override
DEBUG_BUILD to optimise at the lowest usable level.

Ross
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142580): 
https://lists.openembedded.org/g/openembedded-core/message/142580
Mute This Topic: https://lists.openembedded.org/mt/76748224/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH] qemu: always define unknown_lock_type

2020-09-14 Thread Joe Slater
Your patch makes the error always occur at run time.  We can preserve the 
intent of producing an error at link time with the attached patch which was NOT 
accepted upstream.  I think they do not like the name QLNULL.  In any event, it 
does work for all optimizations and applies to the latest master branch of qemu.

Joe

-Original Message-
From: openembedded-core@lists.openembedded.org 
 On Behalf Of Khem Raj
Sent: Monday, September 14, 2020 8:23 AM
To: Yu, Mingli 
Cc: Ross Burton ; OE-core 

Subject: Re: [OE-core] [PATCH] qemu: always define unknown_lock_type

On Sun, Sep 13, 2020 at 11:29 PM Yu, Mingli  wrote:
>
>
>
> On 9/14/20 2:02 PM, Khem Raj wrote:
> >
> >
> > On 9/13/20 10:44 PM, Yu, Mingli wrote:
> >>
> >>
> >> On 9/14/20 1:26 PM, Khem Raj wrote:
> >>>
> >>>
> >>> On 9/13/20 6:50 PM, Yu, Mingli wrote:
> >>>>
> >>>>
> >>>> On 9/10/20 6:41 PM, Ross Burton wrote:
> >>>>> On Thu, 10 Sep 2020 at 04:03, Yu, Mingli 
> >>>>> 
> >>>>> wrote:
> >>>>>> +Upstream-Status: Submitted [qemu-devel mailing list]
> >>>>>
> >>>>> https://lists.nongnu.org/archive/cgi-bin/namazu.cgi?query=unknow
> >>>>> n_lock_type=Search%21=qemu-devel=20=no
> >>>>> rmal=score
> >>>>>
> >>>>>
> >>>>> doesn't find this patch, can you link to it please?
> >>>>>
> >>>>
> >>>> Hi Ross,
> >>>>
> >>>> The link is
> >>>> https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873
> >>>> .html,
> >>>> will include the link in V2.
> >>>
> >>> are you compiling without __OPTIMIZE__ defined ? qemu may not work
> >>
> >> Hi Khem,
> >>
> >> I didn't especially customize something for __OPTIMIZE__,  could 
> >> you help guide where to define it?
> >
> > perhaps you are not using one of -O option ?
>
> -Og passed to the compiler as DEBUG_BUILD = "1" defined in local.conf.

Does qemu work when built with -Og


0001-lockable-use-QLNULL-for-a-null-lockable.patch
Description: 0001-lockable-use-QLNULL-for-a-null-lockable.patch
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142544): 
https://lists.openembedded.org/g/openembedded-core/message/142544
Mute This Topic: https://lists.openembedded.org/mt/76748224/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH] qemu: always define unknown_lock_type

2020-09-14 Thread Khem Raj
On Sun, Sep 13, 2020 at 11:29 PM Yu, Mingli  wrote:
>
>
>
> On 9/14/20 2:02 PM, Khem Raj wrote:
> >
> >
> > On 9/13/20 10:44 PM, Yu, Mingli wrote:
> >>
> >>
> >> On 9/14/20 1:26 PM, Khem Raj wrote:
> >>>
> >>>
> >>> On 9/13/20 6:50 PM, Yu, Mingli wrote:
> 
> 
>  On 9/10/20 6:41 PM, Ross Burton wrote:
> > On Thu, 10 Sep 2020 at 04:03, Yu, Mingli 
> > wrote:
> >> +Upstream-Status: Submitted [qemu-devel mailing list]
> >
> > https://lists.nongnu.org/archive/cgi-bin/namazu.cgi?query=unknown_lock_type=Search%21=qemu-devel=20=normal=score
> >
> >
> > doesn't find this patch, can you link to it please?
> >
> 
>  Hi Ross,
> 
>  The link is
>  https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html,
>  will include the link in V2.
> >>>
> >>> are you compiling without __OPTIMIZE__ defined ? qemu may not work
> >>
> >> Hi Khem,
> >>
> >> I didn't especially customize something for __OPTIMIZE__,  could you
> >> help guide where to define it?
> >
> > perhaps you are not using one of -O option ?
>
> -Og passed to the compiler as DEBUG_BUILD = "1" defined in local.conf.

Does qemu work when built with -Og
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142538): 
https://lists.openembedded.org/g/openembedded-core/message/142538
Mute This Topic: https://lists.openembedded.org/mt/76748224/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH] qemu: always define unknown_lock_type

2020-09-14 Thread Yu, Mingli



On 9/14/20 2:02 PM, Khem Raj wrote:



On 9/13/20 10:44 PM, Yu, Mingli wrote:



On 9/14/20 1:26 PM, Khem Raj wrote:



On 9/13/20 6:50 PM, Yu, Mingli wrote:



On 9/10/20 6:41 PM, Ross Burton wrote:

On Thu, 10 Sep 2020 at 04:03, Yu, Mingli 
wrote:

+Upstream-Status: Submitted [qemu-devel mailing list]


https://lists.nongnu.org/archive/cgi-bin/namazu.cgi?query=unknown_lock_type=Search%21=qemu-devel=20=normal=score


doesn't find this patch, can you link to it please?



Hi Ross,

The link is
https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html,
will include the link in V2.


are you compiling without __OPTIMIZE__ defined ? qemu may not work


Hi Khem,

I didn't especially customize something for __OPTIMIZE__,  could you
help guide where to define it?


perhaps you are not using one of -O option ?


-Og passed to the compiler as DEBUG_BUILD = "1" defined in local.conf.

Thanks,





Thanks,


without it.



Thanks,


Ross





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142494): 
https://lists.openembedded.org/g/openembedded-core/message/142494
Mute This Topic: https://lists.openembedded.org/mt/76748224/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH] qemu: always define unknown_lock_type

2020-09-14 Thread Khem Raj


On 9/13/20 10:44 PM, Yu, Mingli wrote:
> 
> 
> On 9/14/20 1:26 PM, Khem Raj wrote:
>>
>>
>> On 9/13/20 6:50 PM, Yu, Mingli wrote:
>>>
>>>
>>> On 9/10/20 6:41 PM, Ross Burton wrote:
 On Thu, 10 Sep 2020 at 04:03, Yu, Mingli 
 wrote:
> +Upstream-Status: Submitted [qemu-devel mailing list]

 https://lists.nongnu.org/archive/cgi-bin/namazu.cgi?query=unknown_lock_type=Search%21=qemu-devel=20=normal=score


 doesn't find this patch, can you link to it please?

>>>
>>> Hi Ross,
>>>
>>> The link is
>>> https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html,
>>> will include the link in V2.
>>
>> are you compiling without __OPTIMIZE__ defined ? qemu may not work
> 
> Hi Khem,
> 
> I didn't especially customize something for __OPTIMIZE__,  could you
> help guide where to define it?

perhaps you are not using one of -O option ?

> 
> Thanks,
> 
>> without it.
>>
>>>
>>> Thanks,
>>>
 Ross

>>>
>>> 
>>>


pEpkey.asc
Description: application/pgp-keys
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142493): 
https://lists.openembedded.org/g/openembedded-core/message/142493
Mute This Topic: https://lists.openembedded.org/mt/76748224/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH] qemu: always define unknown_lock_type

2020-09-13 Thread Yu, Mingli



On 9/14/20 1:26 PM, Khem Raj wrote:



On 9/13/20 6:50 PM, Yu, Mingli wrote:



On 9/10/20 6:41 PM, Ross Burton wrote:

On Thu, 10 Sep 2020 at 04:03, Yu, Mingli  wrote:

+Upstream-Status: Submitted [qemu-devel mailing list]


https://lists.nongnu.org/archive/cgi-bin/namazu.cgi?query=unknown_lock_type=Search%21=qemu-devel=20=normal=score

doesn't find this patch, can you link to it please?



Hi Ross,

The link is
https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html,
will include the link in V2.


are you compiling without __OPTIMIZE__ defined ? qemu may not work


Hi Khem,

I didn't especially customize something for __OPTIMIZE__,  could you 
help guide where to define it?


Thanks,


without it.



Thanks,


Ross





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142492): 
https://lists.openembedded.org/g/openembedded-core/message/142492
Mute This Topic: https://lists.openembedded.org/mt/76748224/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH] qemu: always define unknown_lock_type

2020-09-13 Thread Khem Raj


On 9/13/20 6:50 PM, Yu, Mingli wrote:
> 
> 
> On 9/10/20 6:41 PM, Ross Burton wrote:
>> On Thu, 10 Sep 2020 at 04:03, Yu, Mingli  wrote:
>>> +Upstream-Status: Submitted [qemu-devel mailing list]
>>
>> https://lists.nongnu.org/archive/cgi-bin/namazu.cgi?query=unknown_lock_type=Search%21=qemu-devel=20=normal=score
>>
>> doesn't find this patch, can you link to it please?
>>
> 
> Hi Ross,
> 
> The link is
> https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html,
> will include the link in V2.

are you compiling without __OPTIMIZE__ defined ? qemu may not work
without it.

> 
> Thanks,
> 
>> Ross
>>
> 
> 
> 


pEpkey.asc
Description: application/pgp-keys
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142491): 
https://lists.openembedded.org/g/openembedded-core/message/142491
Mute This Topic: https://lists.openembedded.org/mt/76748224/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH] qemu: always define unknown_lock_type

2020-09-13 Thread Yu, Mingli



On 9/10/20 6:41 PM, Ross Burton wrote:

On Thu, 10 Sep 2020 at 04:03, Yu, Mingli  wrote:

+Upstream-Status: Submitted [qemu-devel mailing list]


https://lists.nongnu.org/archive/cgi-bin/namazu.cgi?query=unknown_lock_type=Search%21=qemu-devel=20=normal=score
doesn't find this patch, can you link to it please?



Hi Ross,

The link is 
https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html, 
will include the link in V2.


Thanks,


Ross

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142483): 
https://lists.openembedded.org/g/openembedded-core/message/142483
Mute This Topic: https://lists.openembedded.org/mt/76748224/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH] qemu: always define unknown_lock_type

2020-09-10 Thread Ross Burton
On Thu, 10 Sep 2020 at 04:03, Yu, Mingli  wrote:
> +Upstream-Status: Submitted [qemu-devel mailing list]

https://lists.nongnu.org/archive/cgi-bin/namazu.cgi?query=unknown_lock_type=Search%21=qemu-devel=20=normal=score
doesn't find this patch, can you link to it please?

Ross
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142357): 
https://lists.openembedded.org/g/openembedded-core/message/142357
Mute This Topic: https://lists.openembedded.org/mt/76748224/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCH] qemu: always define unknown_lock_type

2020-09-09 Thread Yu, Mingli
From: Mingli Yu 

When use gcc 10.1.0 and debug build is enabled, there comes
below build failure:
| /usr/lib/gcc/x86_64-wrs-linux/10.1.0/../../../../x86_64-wrs-linux/bin/ld.bfd: 
/mnt/build/tmp/work/x86_64-linux/qemu-system-native/5.1.0-r0/qemu-5.1.0/fsdev/qemu-fsdev-throttle.c:25:
 undefined reference to `unknown_lock_type'
 | 
/usr/lib/gcc/x86_64-wrs-linux/10.1.0/../../../../x86_64-wrs-linux/bin/ld.bfd: 
../fsdev/qemu-fsdev-throttle.o: in function `fsdev_co_throttle_request':
 | 
/mnt/build/tmp/work/x86_64-linux/qemu-system-native/5.1.0-r0/qemu-5.1.0/fsdev/qemu-fsdev-throttle.c:103:
 undefined reference to `unknown_lock_type'
 | 
/usr/lib/gcc/x86_64-wrs-linux/10.1.0/../../../../x86_64-wrs-linux/bin/ld.bfd: 
../fsdev/qemu-fsdev-throttle.o:/mnt/build/tmp/work/x86_64-linux/qemu-system-native/5.1.0-r0/qemu-5.1.0/fsdev/qemu-fsdev-throttle.c:103:
 more undefined references to `unknown_lock_type' follow
 | collect2: error: ld returned 1 exit status

So always define unknown_lock_type to fix the above error.

Signed-off-by: Mingli Yu 
---
 meta/recipes-devtools/qemu/qemu.inc   |  1 +
 ...le.h-always-define-unknown_lock_type.patch | 48 +++
 meta/recipes-devtools/qemu/qemu_5.1.0.bb  |  5 --
 3 files changed, 49 insertions(+), 5 deletions(-)
 create mode 100644 
meta/recipes-devtools/qemu/qemu/0001-lockable.h-always-define-unknown_lock_type.patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc 
b/meta/recipes-devtools/qemu/qemu.inc
index 5599382a92..d0d4cb7add 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -30,6 +30,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://0001-Add-enable-disable-udev.patch \
   file://0001-qemu-Do-not-include-file-if-not-exists.patch \
   file://find_datadir.patch \
+  file://0001-lockable.h-always-define-unknown_lock_type.patch \
   "
 UPSTREAM_CHECK_REGEX = "qemu-(?P\d+(\.\d+)+)\.tar"
 
diff --git 
a/meta/recipes-devtools/qemu/qemu/0001-lockable.h-always-define-unknown_lock_type.patch
 
b/meta/recipes-devtools/qemu/qemu/0001-lockable.h-always-define-unknown_lock_type.patch
new file mode 100644
index 00..053ddd4fcc
--- /dev/null
+++ 
b/meta/recipes-devtools/qemu/qemu/0001-lockable.h-always-define-unknown_lock_type.patch
@@ -0,0 +1,48 @@
+From 8c234bb39eb293a44ca58e15303a359bb782931f Mon Sep 17 00:00:00 2001
+From: Mingli Yu 
+Date: Wed, 9 Sep 2020 08:41:27 +
+Subject: [PATCH] lockable.h: always define unknown_lock_type
+
+There comes below build failure when use gcc 10.1.0 and
+"-Og" passed to compiler.
+ | 
/usr/lib/gcc/x86_64-wrs-linux/10.1.0/../../../../x86_64-wrs-linux/bin/ld.bfd: 
/mnt/build/tmp/work/x86_64-linux/qemu-system-native/5.1.0-r0/qemu-5.1.0/fsdev/qemu-fsdev-throttle.c:25:
 undefined reference to `unknown_lock_type'
+ | 
/usr/lib/gcc/x86_64-wrs-linux/10.1.0/../../../../x86_64-wrs-linux/bin/ld.bfd: 
../fsdev/qemu-fsdev-throttle.o: in function `fsdev_co_throttle_request':
+ | 
/mnt/build/tmp/work/x86_64-linux/qemu-system-native/5.1.0-r0/qemu-5.1.0/fsdev/qemu-fsdev-throttle.c:103:
 undefined reference to `unknown_lock_type'
+ | 
/usr/lib/gcc/x86_64-wrs-linux/10.1.0/../../../../x86_64-wrs-linux/bin/ld.bfd: 
../fsdev/qemu-fsdev-throttle.o:/mnt/build/tmp/work/x86_64-linux/qemu-system-native/5.1.0-r0/qemu-5.1.0/fsdev/qemu-fsdev-throttle.c:103:
 more undefined references to `unknown_lock_type' follow
+ | collect2: error: ld returned 1 exit status
+
+So always define unknown_lock_type to fix the above error.
+
+Upstream-Status: Submitted [qemu-devel mailing list]
+
+Signed-off-by: Mingli Yu 
+---
+ include/qemu/lockable.h | 7 +--
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/include/qemu/lockable.h b/include/qemu/lockable.h
+index b620023141..e792ed9a69 100644
+--- a/include/qemu/lockable.h
 b/include/qemu/lockable.h
+@@ -25,17 +25,12 @@ struct QemuLockable {
+ };
+ 
+ /* This function gives an error if an invalid, non-NULL pointer type is passed
+- * to QEMU_MAKE_LOCKABLE.  For optimized builds, we can rely on dead-code 
elimination
+- * from the compiler, and give the errors already at link time.
++ * to QEMU_MAKE_LOCKABLE.
+  */
+-#if defined(__OPTIMIZE__) && !defined(__SANITIZE_ADDRESS__)
+-void unknown_lock_type(void *);
+-#else
+ static inline void unknown_lock_type(void *unused)
+ {
+ abort();
+ }
+-#endif
+ 
+ static inline __attribute__((__always_inline__)) QemuLockable *
+ qemu_make_lockable(void *x, QemuLockable *lockable)
+-- 
+2.26.2
+
diff --git a/meta/recipes-devtools/qemu/qemu_5.1.0.bb 
b/meta/recipes-devtools/qemu/qemu_5.1.0.bb
index 9b09490269..a4018cc448 100644
--- a/meta/recipes-devtools/qemu/qemu_5.1.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_5.1.0.bb
@@ -10,11 +10,6 @@ DEPENDS = "glib-2.0 zlib pixman bison-native"
 
 RDEPENDS_${PN}_class-target += "bash"
 
-# Does not compile for -Og because that level does not clean up dead-code.
-# See lockable.h.
-#
-DEBUG_BUILD = "0"
-