From patchwork Sat Feb 2 19:43:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 157351 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2032982jaa; Sat, 2 Feb 2019 11:43:41 -0800 (PST) X-Google-Smtp-Source: ALg8bN5n6/ZPx29FXvtA1p8Mty/nPd7iAY0Lfm55Or4SE4+A+fs/vwBdAr0QiACAs7zGkWB6A+ki X-Received: by 2002:a17:902:9a98:: with SMTP id w24mr45055960plp.213.1549136621386; Sat, 02 Feb 2019 11:43:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549136621; cv=none; d=google.com; s=arc-20160816; b=vTWpbIvILwForkHgXEM10ZCUpwqd5V/EWYFKc5vPqA+d3AsNarfaXcZIiwzf50A3U/ sIU4ZFi5jre955//HrFYa59kj3AEMMogUp0olfSPZsB2m4gUDEEvBqXr+priQT3x90mk hAMT/e50Sf49X0QnahZWt5l1sMAqIfwn9dpEUU1yr7Mr+MtxzY7JT/fHkCNm1ew7yxlP w6qduXZ3JY1RnJZF66go20q8R1Y51sxqs6Fnn9y0E4mMt2f+wNaw//iwLBkvyBpsbRTs YPKByk2NlzbsuBzxpTOghzGW5PLXOzbG+enDL0p6UMg+xMgfxX55hp0J3+3e8emocbOm KCHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=BzZch3rjaN9Cbi6bimltCV5gON3rHDtPcajOJVHaGA8=; b=D0tsQty1NIYg3gTykaRixy5rCBH3krOEvwkrfNqvBw4FOja8qZGy5ztLhS9YeuDO5G Nq94DPmmOnGtnTAFCJ+MuQJmdb8DgJb5y8tcJQIr9jk7wzhoVWoTpXYTrXrsQUhrmYgG glim5VzzZwLe75YZUja4GRueu2M2dwpLYbpoYrVDmJbn/LuoAjcy53YNlDkoCtkROZqg uHs+dskPADt3fTfw6Q6x6n7Wiho8/QXBN2H6uv/1V7KDgAu6ModnEtvYutAUA2Snim7O AoSu0oxc4PvaPq/bQBhdkACyNS5Re0jX0d/P2Ze1BM4z4XTN/I9zTpfw1Uz6dcVqCXMs 7ABA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="BZ/OGYny"; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id l96si11258603plb.292.2019.02.02.11.43.40; Sat, 02 Feb 2019 11:43:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="BZ/OGYny"; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id CDCB57C34B; Sat, 2 Feb 2019 19:43:37 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by mail.openembedded.org (Postfix) with ESMTP id 1A09C7C346 for ; Sat, 2 Feb 2019 19:43:35 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id d9so1028435pgl.1 for ; Sat, 02 Feb 2019 11:43:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qy3xsuvThMeYTlyiWh19BThnwCwUoeN6fmZCq5WnZiw=; b=BZ/OGYnybIUQc4u5HcoW/Q8/wDX09/myOq9RtW0w1Et/6zzfjSa/2soe6XWtDu4hde yRQZBfHnZRugZFDj0zQrNCyQDfHaXhLhUrMXTrJWL8+r9/wizmjSZiORQfC3sxce0aY8 pQU19zm1jBK/TTC9K1+SO4C/jxZ4bI+BHYD06RLpqNIkvVI8fZruM8Lsoam22Ndcuwid QYue8Lpu/06Y2DYCdi14mKghGWqoZs6CXDqZIURYk/lmVn27QhkbeCX2/ti5H/sbz7ea 3nWBLXsg2oetVnqZnmV5Kpi/UjwtGm64LheUNatfy2UpXoyqonkTIHPUkyKp+G/ppLHi Zabg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qy3xsuvThMeYTlyiWh19BThnwCwUoeN6fmZCq5WnZiw=; b=i1DS4jKH7aeJZPqBub6TTmuVPVt9OA1ON76GfgMcPXzN5EZ9PYgeL7XCYZRDkpaGan 9gnm7zt2F/eKPb3cVqmQvJI0C08jra9NFX63nJRebFfUYcjKh2s0J8tT5A76HHkvTmPR te78OeRxGkMxhh6zgiy/x8VX9LXvkXOIyJN8X+aE/JU9n+aTiKRvICwBVN/SRjJH9Gxm AnWjqnRAI3pHwT/6MYPB+aaaHACB0aurYiEFzpO34pOFgnSO2c0jfkp3nEIUeOXJaHfQ sS6Ep1Ei38QC++rAPlLEiQsMJfb0GzyN6XiSc2+U7GGKiGk1Fl1gqfz8mJJlVUO1uusQ 1OPQ== X-Gm-Message-State: AJcUukc9qnbhMAqQkaeu9cpOju+2YAC3ytdG8u5Y23U9DoZpDMQdlKUs hHLCqknD3fHI0YI7rXbOmUsC4rDK X-Received: by 2002:aa7:824f:: with SMTP id e15mr43643189pfn.192.1549136616521; Sat, 02 Feb 2019 11:43:36 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:8500:6bc6::1609]) by smtp.gmail.com with ESMTPSA id j21sm15541962pfn.175.2019.02.02.11.43.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Feb 2019 11:43:35 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Sat, 2 Feb 2019 11:43:25 -0800 Message-Id: <20190202194326.42388-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [OE-core] [PATCH V2 1/2] multilib_header: Place a #include guard to avoid infinite inclusion of headers X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org In cases where extra preprocessing tools are used such as clang-tidy e.g. and these tools are not passed the knowledge about architecture then a corner case comes where we enter into include loop for bits/wordsize.h, since this template does explicitly include bits/wordsize.h so it synthesized a guard out of file name e.g. bits/wordsize.h -> __OE_BITS_WORDSIZE_H__ and emits the guard at beginning of file Signed-off-by: Khem Raj --- V2: - No Changes, just rebased meta/classes/multilib_header.bbclass | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.20.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/classes/multilib_header.bbclass b/meta/classes/multilib_header.bbclass index e03f5b13b2..2036dc8594 100644 --- a/meta/classes/multilib_header.bbclass +++ b/meta/classes/multilib_header.bbclass @@ -33,10 +33,13 @@ oe_multilib_header() { continue fi stem=$(echo $each_header | sed 's#\.h$##') + include_guard=$(echo $each_header | tr '/.' '_' | tr '[a-z]' '[A-Z]' | sed 's/^/__OE_/' | sed 's/$/__/') # if mips64/n32 set ident to n32 mv ${D}/${includedir}/$each_header ${D}/${includedir}/${stem}-${ident}.h - - sed -e "s#ENTER_HEADER_FILENAME_HERE#${stem}#g" ${COREBASE}/scripts/multilib_header_wrapper.h > ${D}/${includedir}/$each_header + echo "#ifndef $include_guard" > ${D}/${includedir}/$each_header + echo "#define $include_guard" >> ${D}/${includedir}/$each_header + sed -e "s#ENTER_HEADER_FILENAME_HERE#${stem}#g" ${COREBASE}/scripts/multilib_header_wrapper.h >> ${D}/${includedir}/$each_header + echo "#endif /* $include_guard */" >> ${D}/${includedir}/$each_header done }