From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 76AFEA00C5; Fri, 11 Feb 2022 12:37:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 696CD42740; Fri, 11 Feb 2022 12:37:50 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 4D96C40150 for ; Fri, 11 Feb 2022 12:37:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644579469; x=1676115469; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8FUrxHihYvW2eE2cm0zr9oJWqxATExOlKTJtDNGEVtg=; b=bxIBjHUhFCCM44uSptzyx13imCAKjI4pq/y0o22Q8YCWMFA9ASCZhjiN 5b1d9JKV++yzzKfa1+Yi2aw5P2WSOqZJ8sYbisCqnaV1ZNy7Tq+mUsxct 1HWcK2QdJGW2kT0lgqtVCGpuejA+E5718TJcr/jFWVHMBm67kxO2TKsPQ f9tOD9dTxN/YORJzwfpY51abNbOWERLbYuja6SVzZc3oB5f5tPY7Ubrr0 qH41Ox2u6vjYf0xtNo188l3UE6hJPjxHA7DUQcEtQRODatBjo9UGZz6Ma bn9Csa2NW2WVmCP06E7LQpE6ZxfI1Ki8zOynV09BtuYAztCEgnVIuyo93 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="312998505" X-IronPort-AV: E=Sophos;i="5.88,360,1635231600"; d="scan'208";a="312998505" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2022 03:37:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,360,1635231600"; d="scan'208";a="542053240" Received: from unknown (HELO silpixa00399126.ir.intel.com) ([10.237.223.192]) by orsmga008.jf.intel.com with ESMTP; 11 Feb 2022 03:37:44 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Aaron Conole , Michael Santana Subject: [PATCH v5 2/2] buildtools/chkincs: test headers for C++ compatibility Date: Fri, 11 Feb 2022 11:36:41 +0000 Message-Id: <20220211113641.755308-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220211113641.755308-1-bruce.richardson@intel.com> References: <20220204174209.440207-1-bruce.richardson@intel.com> <20220211113641.755308-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add support for checking each of our headers for issues when included in a C++ file. Signed-off-by: Bruce Richardson --- .ci/linux-build.sh | 1 + .github/workflows/build.yml | 2 +- buildtools/chkincs/main.cpp | 4 ++++ buildtools/chkincs/meson.build | 18 ++++++++++++++++++ devtools/test-meson-builds.sh | 3 ++- 5 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 buildtools/chkincs/main.cpp diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index c10c1a8ab5..67d68535e0 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -74,6 +74,7 @@ fi if [ "$BUILD_32BIT" = "true" ]; then OPTS="$OPTS -Dc_args=-m32 -Dc_link_args=-m32" + OPTS="$OPTS -Dcpp_args=-m32 -Dcpp_link_args=-m32" export PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig" fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6cf997d6ee..d30cfd08d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,7 +116,7 @@ jobs: libdw-dev - name: Install i386 cross compiling packages if: env.BUILD_32BIT == 'true' - run: sudo apt install -y gcc-multilib + run: sudo apt install -y gcc-multilib g++-multilib - name: Install aarch64 cross compiling packages if: env.AARCH64 == 'true' run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross diff --git a/buildtools/chkincs/main.cpp b/buildtools/chkincs/main.cpp new file mode 100644 index 0000000000..d25bb8852a --- /dev/null +++ b/buildtools/chkincs/main.cpp @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2021 Intel Corporation + */ +int main(void) { return 0; } diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build index 7ea136ff95..790f700619 100644 --- a/buildtools/chkincs/meson.build +++ b/buildtools/chkincs/meson.build @@ -27,3 +27,21 @@ executable('chkincs', sources, include_directories: includes, dependencies: deps, install: false) + +# run tests for c++ builds also +if not add_languages('cpp', required: false) + subdir_done() +endif + +gen_cpp_files = generator(gen_c_file_for_header, + output: '@BASENAME@.cpp', + arguments: ['@INPUT@', '@OUTPUT@']) + +cpp_sources = files('main.cpp') +cpp_sources += gen_cpp_files.process(dpdk_chkinc_headers) + +executable('chkincs-cpp', cpp_sources, + cpp_args: ['-include', 'rte_config.h', cflags], + include_directories: includes, + dependencies: deps, + install: false) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 4ed61328b9..c07fd16fdc 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -246,7 +246,8 @@ if check_cc_flags '-m32' ; then export PKG_CONFIG_LIBDIR='/usr/lib/pkgconfig' fi target_override='i386-pc-linux-gnu' - build build-32b cc ABI -Dc_args='-m32' -Dc_link_args='-m32' + build build-32b cc ABI -Dc_args='-m32' -Dc_link_args='-m32' \ + -Dcpp_args='-m32' -Dcpp_link_args='-m32' target_override= unset PKG_CONFIG_LIBDIR fi -- 2.32.0