From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out30-45.freemail.mail.aliyun.com (out30-45.freemail.mail.aliyun.com [115.124.30.45]) by sourceware.org (Postfix) with ESMTPS id 051D538708E6 for ; Fri, 15 May 2020 06:57:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 051D538708E6 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R161e4; 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=3; SR=0; TI=SMTPD_---0TybLdmw_1589525852; Received: from xuchunmei.local(mailfrom:xuchunmei@linux.alibaba.com fp:SMTPD_---0TybLdmw_1589525852) by smtp.aliyun-inc.com(127.0.0.1); Fri, 15 May 2020 14:57:32 +0800 Subject: Re: [PATCH] add default "/usr/bin:/bin" after $PATH From: Chunmei Xu To: smakarov@redhat.com, fche@redhat.com Cc: systemtap@sourceware.org References: <1589524125-58854-1-git-send-email-xuchunmei@linux.alibaba.com> Message-ID: <116bafda-a536-af36-5d88-e9b504c87c51@linux.alibaba.com> Date: Fri, 15 May 2020 14:57:32 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <1589524125-58854-1-git-send-email-xuchunmei@linux.alibaba.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-21.6 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:57:46 -0000 I submit a bug at: https://sourceware.org/bugzilla/show_bug.cgi?id=25994 在 2020/5/15 下午2:28, Chunmei Xu 写道: > 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 > {