public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/25994] New: inproper order of PATH set cause wrong unexpected gcc used
@ 2020-05-15  6:50 xuchunmei at linux dot alibaba.com
  2020-05-15 12:40 ` [Bug translator/25994] " fche at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: xuchunmei at linux dot alibaba.com @ 2020-05-15  6:50 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=25994

            Bug ID: 25994
           Summary: inproper order of PATH set cause wrong unexpected gcc
                    used
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: xuchunmei at linux dot alibaba.com
  Target Milestone: ---

Created attachment 12541
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12541&action=edit
add default "/usr/bin:/bin" after $PATH

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, such as /opt/rh/devtoolset-9/root/usr/bin/gcc.

As I think the default /usr/bin:/bin should be added after $PATH.

I add an attachment to fix it, please have a review.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug translator/25994] inproper order of PATH set cause wrong unexpected gcc used
  2020-05-15  6:50 [Bug translator/25994] New: inproper order of PATH set cause wrong unexpected gcc used xuchunmei at linux dot alibaba.com
@ 2020-05-15 12:40 ` fche at redhat dot com
  2020-05-16  2:25 ` xuchunmei at linux dot alibaba.com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2020-05-15 12:40 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=25994

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fche at redhat dot com

--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
The problem is that for systemtap to build kernel modules compatible with the
system kernel, it must use the same compiler.  Jumping between major versions
can create incompatible modules, whether enforced by symbol versioning type
metadata, or undetected inconsistencies in kernel struct declarations.

Any idea where those -fpatchable-function-entry=2 cflags are coming from? 
Maybe we can nuke those from within stap more properly.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug translator/25994] inproper order of PATH set cause wrong unexpected gcc used
  2020-05-15  6:50 [Bug translator/25994] New: inproper order of PATH set cause wrong unexpected gcc used xuchunmei at linux dot alibaba.com
  2020-05-15 12:40 ` [Bug translator/25994] " fche at redhat dot com
@ 2020-05-16  2:25 ` xuchunmei at linux dot alibaba.com
  2020-05-16  3:34 ` xuchunmei at linux dot alibaba.com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: xuchunmei at linux dot alibaba.com @ 2020-05-16  2:25 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=25994

--- Comment #2 from xuchunmei <xuchunmei at linux dot alibaba.com> ---
(In reply to Frank Ch. Eigler from comment #1)
> The problem is that for systemtap to build kernel modules compatible with
> the system kernel, it must use the same compiler.  Jumping between major
> versions can create incompatible modules, whether enforced by symbol
> versioning type metadata, or undetected inconsistencies in kernel struct
> declarations.
> 
> Any idea where those -fpatchable-function-entry=2 cflags are coming from? 
> Maybe we can nuke those from within stap more properly.

yes, My kernel is build with devtoolset-9-gcc, and systemtap is also build with
devtoolset-9, when I use systemtap I want to use gcc which is
/opt/rh/devtoolset-9/root/usr/bin/gcc not /usr/bin/gcc.

the "-fpatchable-function-entry=2" is from arch/arm64/Makefile:

ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_REGS),y)
  KBUILD_CPPFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY
  CC_FLAGS_FTRACE := -fpatchable-function-entry=2
endif

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug translator/25994] inproper order of PATH set cause wrong unexpected gcc used
  2020-05-15  6:50 [Bug translator/25994] New: inproper order of PATH set cause wrong unexpected gcc used xuchunmei at linux dot alibaba.com
  2020-05-15 12:40 ` [Bug translator/25994] " fche at redhat dot com
  2020-05-16  2:25 ` xuchunmei at linux dot alibaba.com
@ 2020-05-16  3:34 ` xuchunmei at linux dot alibaba.com
  2020-05-16  9:51 ` fche at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: xuchunmei at linux dot alibaba.com @ 2020-05-16  3:34 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=25994

xuchunmei <xuchunmei at linux dot alibaba.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xuchunmei at linux dot alibaba.com

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug translator/25994] inproper order of PATH set cause wrong unexpected gcc used
  2020-05-15  6:50 [Bug translator/25994] New: inproper order of PATH set cause wrong unexpected gcc used xuchunmei at linux dot alibaba.com
                   ` (2 preceding siblings ...)
  2020-05-16  3:34 ` xuchunmei at linux dot alibaba.com
@ 2020-05-16  9:51 ` fche at redhat dot com
  2020-05-16 10:44 ` xuchunmei at linux dot alibaba.com
  2020-07-03  3:01 ` xuchunmei at linux dot alibaba.com
  5 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2020-05-16  9:51 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=25994

--- Comment #3 from Frank Ch. Eigler <fche at redhat dot com> ---
> yes, My kernel is build with devtoolset-9-gcc

Ahh, interesting.

Try: 
   # scl enable .... bash
   # stap -B CC=/opt/rh/...../bin/gcc  <options>

The -B option passes through kbuild make options.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug translator/25994] inproper order of PATH set cause wrong unexpected gcc used
  2020-05-15  6:50 [Bug translator/25994] New: inproper order of PATH set cause wrong unexpected gcc used xuchunmei at linux dot alibaba.com
                   ` (3 preceding siblings ...)
  2020-05-16  9:51 ` fche at redhat dot com
@ 2020-05-16 10:44 ` xuchunmei at linux dot alibaba.com
  2020-07-03  3:01 ` xuchunmei at linux dot alibaba.com
  5 siblings, 0 replies; 7+ messages in thread
From: xuchunmei at linux dot alibaba.com @ 2020-05-16 10:44 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=25994

--- Comment #4 from xuchunmei <xuchunmei at linux dot alibaba.com> ---
(In reply to Frank Ch. Eigler from comment #3)
> > yes, My kernel is build with devtoolset-9-gcc
> 
> Ahh, interesting.
> 
> Try: 
>    # scl enable .... bash
>    # stap -B CC=/opt/rh/...../bin/gcc  <options>
> 
> The -B option passes through kbuild make options.

ok,I try it, and it works, thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug translator/25994] inproper order of PATH set cause wrong unexpected gcc used
  2020-05-15  6:50 [Bug translator/25994] New: inproper order of PATH set cause wrong unexpected gcc used xuchunmei at linux dot alibaba.com
                   ` (4 preceding siblings ...)
  2020-05-16 10:44 ` xuchunmei at linux dot alibaba.com
@ 2020-07-03  3:01 ` xuchunmei at linux dot alibaba.com
  5 siblings, 0 replies; 7+ messages in thread
From: xuchunmei at linux dot alibaba.com @ 2020-07-03  3:01 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=25994

xuchunmei <xuchunmei at linux dot alibaba.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #5 from xuchunmei <xuchunmei at linux dot alibaba.com> ---
it is not a problem, can use -B option to set kbuild make options

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-03  3:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15  6:50 [Bug translator/25994] New: inproper order of PATH set cause wrong unexpected gcc used xuchunmei at linux dot alibaba.com
2020-05-15 12:40 ` [Bug translator/25994] " fche at redhat dot com
2020-05-16  2:25 ` xuchunmei at linux dot alibaba.com
2020-05-16  3:34 ` xuchunmei at linux dot alibaba.com
2020-05-16  9:51 ` fche at redhat dot com
2020-05-16 10:44 ` xuchunmei at linux dot alibaba.com
2020-07-03  3:01 ` xuchunmei at linux dot alibaba.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).