diff mbox series

[v2,45/52] tcg: Define IN_TCG

Message ID 20230523135322.678948-46-richard.henderson@linaro.org
State New
Headers show
Series tcg: Build once for system, once for user | expand

Commit Message

Richard Henderson May 23, 2023, 1:53 p.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/region.c      | 2 ++
 tcg/tcg-common.c  | 2 ++
 tcg/tcg-op-gvec.c | 2 ++
 tcg/tcg-op-ldst.c | 2 ++
 tcg/tcg-op-vec.c  | 2 ++
 tcg/tcg-op.c      | 2 ++
 tcg/tcg.c         | 2 ++
 7 files changed, 14 insertions(+)

Comments

Philippe Mathieu-Daudé May 23, 2023, 4:45 p.m. UTC | #1
On 23/5/23 15:53, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   tcg/region.c      | 2 ++
>   tcg/tcg-common.c  | 2 ++
>   tcg/tcg-op-gvec.c | 2 ++
>   tcg/tcg-op-ldst.c | 2 ++
>   tcg/tcg-op-vec.c  | 2 ++
>   tcg/tcg-op.c      | 2 ++
>   tcg/tcg.c         | 2 ++
>   7 files changed, 14 insertions(+)
> 
> diff --git a/tcg/region.c b/tcg/region.c
> index bef4c4756f..34ac124081 100644
> --- a/tcg/region.c
> +++ b/tcg/region.c
> @@ -22,6 +22,8 @@
>    * THE SOFTWARE.
>    */
>   
> +#define IN_TCG
> +
>   #include "qemu/osdep.h"
>   #include "qemu/units.h"
>   #include "qemu/madvise.h"
> diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c
> index 35e7616ae9..678ab482f7 100644
> --- a/tcg/tcg-common.c
> +++ b/tcg/tcg-common.c
> @@ -22,6 +22,8 @@
>    * THE SOFTWARE.
>    */
>   
> +#define IN_TCG
> +
>   #include "qemu/osdep.h"
>   #include "tcg/tcg.h"

[...]

Could this be enforced via meson instead? Smth like:

   static_library(tcgcommon.fa,
                  [tcgcommon_ss.sources()],
                  c_args: [-DIN_TCG], ...)
Philippe Mathieu-Daudé May 23, 2023, 4:50 p.m. UTC | #2
On 23/5/23 18:45, Philippe Mathieu-Daudé wrote:
> On 23/5/23 15:53, Richard Henderson wrote:
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>   tcg/region.c      | 2 ++
>>   tcg/tcg-common.c  | 2 ++
>>   tcg/tcg-op-gvec.c | 2 ++
>>   tcg/tcg-op-ldst.c | 2 ++
>>   tcg/tcg-op-vec.c  | 2 ++
>>   tcg/tcg-op.c      | 2 ++
>>   tcg/tcg.c         | 2 ++
>>   7 files changed, 14 insertions(+)
>>
>> diff --git a/tcg/region.c b/tcg/region.c
>> index bef4c4756f..34ac124081 100644
>> --- a/tcg/region.c
>> +++ b/tcg/region.c
>> @@ -22,6 +22,8 @@
>>    * THE SOFTWARE.
>>    */
>> +#define IN_TCG
>> +
>>   #include "qemu/osdep.h"
>>   #include "qemu/units.h"
>>   #include "qemu/madvise.h"
>> diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c
>> index 35e7616ae9..678ab482f7 100644
>> --- a/tcg/tcg-common.c
>> +++ b/tcg/tcg-common.c
>> @@ -22,6 +22,8 @@
>>    * THE SOFTWARE.
>>    */
>> +#define IN_TCG
>> +
>>   #include "qemu/osdep.h"
>>   #include "tcg/tcg.h"
> 
> [...]
> 
> Could this be enforced via meson instead? Smth like:
> 
>    static_library(tcgcommon.fa,
>                   [tcgcommon_ss.sources()],
>                   c_args: [-DIN_TCG], ...)
> 

Just noticed that in the last patch of this series (52/52):
https://lore.kernel.org/qemu-devel/20230523135322.678948-53-richard.henderson@linaro.org/
Richard Henderson May 24, 2023, 12:26 a.m. UTC | #3
On 5/23/23 09:45, Philippe Mathieu-Daudé wrote:
> On 23/5/23 15:53, Richard Henderson wrote:
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>   tcg/region.c      | 2 ++
>>   tcg/tcg-common.c  | 2 ++
>>   tcg/tcg-op-gvec.c | 2 ++
>>   tcg/tcg-op-ldst.c | 2 ++
>>   tcg/tcg-op-vec.c  | 2 ++
>>   tcg/tcg-op.c      | 2 ++
>>   tcg/tcg.c         | 2 ++
>>   7 files changed, 14 insertions(+)
>>
>> diff --git a/tcg/region.c b/tcg/region.c
>> index bef4c4756f..34ac124081 100644
>> --- a/tcg/region.c
>> +++ b/tcg/region.c
>> @@ -22,6 +22,8 @@
>>    * THE SOFTWARE.
>>    */
>> +#define IN_TCG
>> +
>>   #include "qemu/osdep.h"
>>   #include "qemu/units.h"
>>   #include "qemu/madvise.h"
>> diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c
>> index 35e7616ae9..678ab482f7 100644
>> --- a/tcg/tcg-common.c
>> +++ b/tcg/tcg-common.c
>> @@ -22,6 +22,8 @@
>>    * THE SOFTWARE.
>>    */
>> +#define IN_TCG
>> +
>>   #include "qemu/osdep.h"
>>   #include "tcg/tcg.h"
> 
> [...]
> 
> Could this be enforced via meson instead? Smth like:
> 
>    static_library(tcgcommon.fa,
>                   [tcgcommon_ss.sources()],
>                   c_args: [-DIN_TCG], ...)

Actually, it's rubbish now.  I think this was meant for exec/poison.h, but I'm not 
currently using it there.

r~
diff mbox series

Patch

diff --git a/tcg/region.c b/tcg/region.c
index bef4c4756f..34ac124081 100644
--- a/tcg/region.c
+++ b/tcg/region.c
@@ -22,6 +22,8 @@ 
  * THE SOFTWARE.
  */
 
+#define IN_TCG
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qemu/madvise.h"
diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c
index 35e7616ae9..678ab482f7 100644
--- a/tcg/tcg-common.c
+++ b/tcg/tcg-common.c
@@ -22,6 +22,8 @@ 
  * THE SOFTWARE.
  */
 
+#define IN_TCG
+
 #include "qemu/osdep.h"
 #include "tcg/tcg.h"
 
diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c
index 95a588d6d2..0ecde731f4 100644
--- a/tcg/tcg-op-gvec.c
+++ b/tcg/tcg-op-gvec.c
@@ -17,6 +17,8 @@ 
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#define IN_TCG
+
 #include "qemu/osdep.h"
 #include "tcg/tcg.h"
 #include "tcg/tcg-temp-internal.h"
diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c
index f32c0fda35..dc8dcd8b4f 100644
--- a/tcg/tcg-op-ldst.c
+++ b/tcg/tcg-op-ldst.c
@@ -22,6 +22,8 @@ 
  * THE SOFTWARE.
  */
 
+#define IN_TCG
+
 #include "qemu/osdep.h"
 #include "tcg/tcg.h"
 #include "tcg/tcg-temp-internal.h"
diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c
index 35d67eeda0..6c70178e9e 100644
--- a/tcg/tcg-op-vec.c
+++ b/tcg/tcg-op-vec.c
@@ -17,6 +17,8 @@ 
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#define IN_TCG
+
 #include "qemu/osdep.h"
 #include "tcg/tcg.h"
 #include "tcg/tcg-temp-internal.h"
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 8c1ad49c4e..16ff61c65d 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -22,6 +22,8 @@ 
  * THE SOFTWARE.
  */
 
+#define IN_TCG
+
 #include "qemu/osdep.h"
 #include "exec/exec-all.h"
 #include "tcg/tcg.h"
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 7d0449f6a9..38321d6d54 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -22,6 +22,8 @@ 
  * THE SOFTWARE.
  */
 
+#define IN_TCG
+
 #include "qemu/osdep.h"
 
 /* Define to jump the ELF file used to communicate with GDB.  */