From: Anton Johansson via <qemu-devel@nongnu.org>
To: qemu-devel@nongnu.org
Cc: ale@rev.ng, ltaylorsimpson@gmail.com,
brian.cain@oss.qualcomm.com, philmd@linaro.org
Subject: [PATCH 1/2] target/hexagon: Replace `prepare` script with meson target
Date: Wed, 12 Mar 2025 20:45:46 +0100 [thread overview]
Message-ID: <20250312194547.7364-2-anjo@rev.ng> (raw)
In-Reply-To: <20250312194547.7364-1-anjo@rev.ng>
The purpose of the prepare script is to invoke `cpp` to preprocess input
to idef-parser by expanding a few select macros. On mac osx `cpp`
expands into `clang ... -traditional-cpp` which breaks macro
concatenation. Replace `cpp` with `${compiler} -E`
and replace the script with a meson custom_target.
Signed-off-by: Anton Johansson <anjo@rev.ng>
---
target/hexagon/idef-parser/prepare | 24 ------------------------
target/hexagon/meson.build | 3 ++-
2 files changed, 2 insertions(+), 25 deletions(-)
delete mode 100755 target/hexagon/idef-parser/prepare
diff --git a/target/hexagon/idef-parser/prepare b/target/hexagon/idef-parser/prepare
deleted file mode 100755
index cb3622d4f8..0000000000
--- a/target/hexagon/idef-parser/prepare
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env bash
-
-#
-# Copyright(c) 2019-2021 rev.ng Labs Srl. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-
-set -e
-set -o pipefail
-
-# Run the preprocessor and drop comments
-cpp "$@"
diff --git a/target/hexagon/meson.build b/target/hexagon/meson.build
index bb4ebaae81..abcf00ca1f 100644
--- a/target/hexagon/meson.build
+++ b/target/hexagon/meson.build
@@ -280,12 +280,13 @@ if idef_parser_enabled and 'hexagon-linux-user' in target_dirs
command: [python, files('gen_idef_parser_funcs.py'), semantics_generated, '@OUTPUT@'],
)
+ compiler = meson.get_compiler('c').get_id()
preprocessed_idef_parser_input_generated = custom_target(
'idef_parser_input.preprocessed.h.inc',
output: 'idef_parser_input.preprocessed.h.inc',
input: idef_parser_input_generated,
depend_files: [idef_parser_dir / 'macros.h.inc'],
- command: [idef_parser_dir / 'prepare', '@INPUT@', '-I' + idef_parser_dir, '-o', '@OUTPUT@'],
+ command: [compiler, '-x', 'c', '-E', '-I', idef_parser_dir, '-o', '@OUTPUT@', '@INPUT@'],
)
flex = generator(
--
2.47.1
next prev parent reply other threads:[~2025-03-12 19:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-12 19:45 [PATCH 0/2] target/hexagon: Fix macOS build Anton Johansson via
2025-03-12 19:45 ` Anton Johansson via [this message]
2025-03-12 19:45 ` [PATCH 2/2] target/hexagon: Drop `ident` postprocess step Anton Johansson via
2025-03-25 1:53 ` ltaylorsimpson
2025-03-25 3:12 ` Brian Cain
2025-03-26 12:42 ` 'Anton Johansson' via
2025-04-02 3:25 ` Brian Cain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250312194547.7364-2-anjo@rev.ng \
--to=qemu-devel@nongnu.org \
--cc=ale@rev.ng \
--cc=anjo@rev.ng \
--cc=brian.cain@oss.qualcomm.com \
--cc=ltaylorsimpson@gmail.com \
--cc=philmd@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).