From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by sourceware.org (Postfix) with ESMTPS id B829B386F457 for ; Fri, 15 May 2020 06:29:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B829B386F457 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R191e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01f04397; MF=xuchunmei@linux.alibaba.com; NM=1; PH=DS; RN=2; SR=0; TI=SMTPD_---0TybDZRw_1589524125; Received: from localhost(mailfrom:xuchunmei@linux.alibaba.com fp:SMTPD_---0TybDZRw_1589524125) by smtp.aliyun-inc.com(127.0.0.1); Fri, 15 May 2020 14:28:59 +0800 From: Chunmei Xu To: smakarov@redhat.com Cc: systemtap@sourceware.org Subject: [PATCH] add default "/usr/bin:/bin" after $PATH Date: Fri, 15 May 2020 14:28:45 +0800 Message-Id: <1589524125-58854-1-git-send-email-xuchunmei@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 06:29:07 -0000 my use case is like this, I install gcc-4.8.5 and devtoolset-9-gcc, while I set the PATH by "source /opt/rh/devtoolset-9/enable" to use gcc-9, but when I use "stap test.stap", I always get compile errors for "gcc: error: unrecognized command line option ‘-fpatchable-function-entry=2’", the option ‘-fpatchable-function-entry=2’ is not supported by gcc-4.8.5 but supported by gcc-9. The stap process building always use gcc-4.8.5 from /usr/bin not from the first path of PATH. As I think the default /usr/bin:/bin should be added after $PATH. Signed-off-by: Chunmei Xu --- buildrun.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buildrun.cxx b/buildrun.cxx index 12abe78..371da96 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -95,13 +95,14 @@ run_make_cmd(systemtap_session& s, vector& make_cmd, static vector make_any_make_cmd(systemtap_session& s, const string& dir, const string& target) { - string newpath("PATH=/usr/bin:/bin"); + string newpath("PATH="); const char *oldpath = getenv("PATH"); if (oldpath != NULL) { - newpath += ':'; newpath += oldpath; + newpath += ':'; } + newpath += "/usr/bin:/bin"; vector make_cmd { -- 1.8.3.1