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 889AAA00BE; Thu, 10 Feb 2022 16:43:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 205DA42775; Thu, 10 Feb 2022 16:43:17 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 45FC442755 for ; Thu, 10 Feb 2022 16:43:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644507790; x=1676043790; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A9RJREu6ajd6nuB1RfmPeub0zL5omlbywiJF2p6BwWk=; b=Qm4NoyTpmHnMrTWwvF4RGophd6o0dsJ7AK4Sk5xH+RkOQ5crm8E8lYJu biKXr7oOT3xsp+KfnRClAesAXnLUOYq/r1nn3rasOQ+415kZMOI462ayZ +8Ry2875XxKgVhuB7ShOlLhI5tPw+kzdtaNPSevbeNa5HKDR4pDy5p21j C1JxRNPReVoEueMQJBcl0WB+BAO+jDHxSKuKYZIrnRj6EgF/BzlESowSt +fm3F4HJwN03qgbAnJl7j1J9IwkTkoqNCw88ACNnNmVmOMJkfSs6dYk9k SUW0atIIm33P98vx7fUYzAv4EMEPusBhwQyUS3GkfXpA/KWf6hrLS97oj A==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="247101218" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="247101218" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 07:43:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="485723508" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by orsmga006.jf.intel.com with ESMTP; 10 Feb 2022 07:43:07 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Aaron Conole , Michael Santana Subject: [PATCH v4 7/7] buildtools/chkincs: test headers for C++ compatibility Date: Thu, 10 Feb 2022 15:42:39 +0000 Message-Id: <20220210154239.587185-8-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210154239.587185-1-bruce.richardson@intel.com> References: <20220204174209.440207-1-bruce.richardson@intel.com> <20220210154239.587185-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 | 20 ++++++++++++++++++++ devtools/test-meson-builds.sh | 3 ++- 5 files changed, 28 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 5ffca89761..beabcd55d8 100644 --- a/buildtools/chkincs/meson.build +++ b/buildtools/chkincs/meson.build @@ -28,3 +28,23 @@ executable('chkincs', sources, dependencies: deps, link_whole: dpdk_static_libraries + dpdk_drivers, 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], + link_args: dpdk_extra_ldflags, + include_directories: includes, + dependencies: deps, + link_whole: dpdk_static_libraries + dpdk_drivers, + 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