linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf 3.8-rc build failure:  undefined reference to `strlcpy'
@ 2013-01-29  4:22 Thomas Backlund
  2013-01-29 10:37 ` Borislav Petkov
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Backlund @ 2013-01-29  4:22 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Arnaldo Carvalho de Melo


[tmb@tmb linux-3.8-rc5]$ make -C tools/perf -s V=1 HAVE_CPLUS_DEMANGLE=1 
prefix=%{_prefix} all

...

/tmp/ccJEJv6m.o: In function `main':
:(.text+0x14): undefined reference to `strlcpy'
collect2: ld returned 1 exit status

...

This did not show up in 3.7

--
Thomas

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

* Re: perf 3.8-rc build failure:  undefined reference to `strlcpy'
  2013-01-29  4:22 perf 3.8-rc build failure: undefined reference to `strlcpy' Thomas Backlund
@ 2013-01-29 10:37 ` Borislav Petkov
  2013-01-30  2:15   ` Namhyung Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Borislav Petkov @ 2013-01-29 10:37 UTC (permalink / raw)
  To: Thomas Backlund; +Cc: Linux Kernel Mailing List, Arnaldo Carvalho de Melo

On Tue, Jan 29, 2013 at 06:22:53AM +0200, Thomas Backlund wrote:
> 
> [tmb@tmb linux-3.8-rc5]$ make -C tools/perf -s V=1
> HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} all
> 
> ...
> 
> /tmp/ccJEJv6m.o: In function `main':
> :(.text+0x14): undefined reference to `strlcpy'
> collect2: ld returned 1 exit status
> 
> ...
> 
> This did not show up in 3.7

Ditto here:

/tmp/ccC1kLwn.o: In function `main':
:(.text+0x14): undefined reference to `strlcpy'
collect2: error: ld returned 1 exit status

Someone needs to get HAVE_STRLCPY and tools/perf/util/path.c in order so
that the linker sees it, IMHO.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

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

* Re: perf 3.8-rc build failure:  undefined reference to `strlcpy'
  2013-01-29 10:37 ` Borislav Petkov
@ 2013-01-30  2:15   ` Namhyung Kim
  2013-01-30  3:28     ` Borislav Petkov
  0 siblings, 1 reply; 6+ messages in thread
From: Namhyung Kim @ 2013-01-30  2:15 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Backlund, Linux Kernel Mailing List,
	Arnaldo Carvalho de Melo, Jiri Olsa

Hi Borislav,

On Tue, 29 Jan 2013 11:37:22 +0100, Borislav Petkov wrote:
> On Tue, Jan 29, 2013 at 06:22:53AM +0200, Thomas Backlund wrote:
>> 
>> [tmb@tmb linux-3.8-rc5]$ make -C tools/perf -s V=1
>> HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} all
>> 
>> ...
>> 
>> /tmp/ccJEJv6m.o: In function `main':
>> :(.text+0x14): undefined reference to `strlcpy'
>> collect2: ld returned 1 exit status
>> 
>> ...
>> 
>> This did not show up in 3.7
>
> Ditto here:
>
> /tmp/ccC1kLwn.o: In function `main':
> :(.text+0x14): undefined reference to `strlcpy'
> collect2: error: ld returned 1 exit status
>
> Someone needs to get HAVE_STRLCPY and tools/perf/util/path.c in order so
> that the linker sees it, IMHO.

Please see my reply on another post from Thomas:

  https://lkml.org/lkml/2013/1/29/32


It's not like a build failure of perf tools, it's just a result of
feature test so should not affect the build of perf itself, right?  Why
it confuses us is that we don't show any compile message if -s option is
given to make, so I posted a patch to hide CHK and above failure message
when -s option is specified.

Thanks,
Namhyung

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

* Re: perf 3.8-rc build failure:  undefined reference to `strlcpy'
  2013-01-30  2:15   ` Namhyung Kim
@ 2013-01-30  3:28     ` Borislav Petkov
  2013-01-30  4:56       ` Namhyung Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Borislav Petkov @ 2013-01-30  3:28 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Thomas Backlund, Linux Kernel Mailing List,
	Arnaldo Carvalho de Melo, Jiri Olsa

On Wed, Jan 30, 2013 at 11:15:55AM +0900, Namhyung Kim wrote:
> Please see my reply on another post from Thomas:
> 
>   https://lkml.org/lkml/2013/1/29/32
> 
> It's not like a build failure of perf tools, it's just a result of
> feature test so should not affect the build of perf itself, right?

Doh, I see it. It is the -DHAVE_STRLCPY test, of course. And it happens
only with a V=1 build, so actually there's not a build problem.

> Why it confuses us is that we don't show any compile message if -s
> option is given to make, so I posted a patch to hide CHK and above
> failure message when -s option is specified.

Hm, trying your patch ontop of acme's perf/core still shows CHK stuff

$ make -s tools/perf
    DESCEND perf
    CHK -fstack-protector-all
    CHK -Wstack-protector
    CHK -Wvolatile-register-var
    CHK bionic
    CHK libelf
    CHK libdw
    ...


and that's because I'm doing the build from the toplevel repo and not in
perf/. If I switch to perf first, it is silent:

$ make -s
Makefile:809: No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling
Makefile:846: No numa.h found, disables 'perf bench numa mem' benchmark, please install numa-libs-devel or libnuma-dev
$

Oh, and one more thing, there's tools/scripts/Makefile.include which
looks at -s already and perf/Makefile includes it so you probably want
to put your change there so that all tools use it.

Thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

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

* Re: perf 3.8-rc build failure:  undefined reference to `strlcpy'
  2013-01-30  3:28     ` Borislav Petkov
@ 2013-01-30  4:56       ` Namhyung Kim
  2013-01-30  5:42         ` Borislav Petkov
  0 siblings, 1 reply; 6+ messages in thread
From: Namhyung Kim @ 2013-01-30  4:56 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Backlund, Linux Kernel Mailing List,
	Arnaldo Carvalho de Melo, Jiri Olsa

On Wed, 30 Jan 2013 04:28:31 +0100, Borislav Petkov wrote:
> On Wed, Jan 30, 2013 at 11:15:55AM +0900, Namhyung Kim wrote:
>> Please see my reply on another post from Thomas:
>> 
>>   https://lkml.org/lkml/2013/1/29/32
>> 
>> It's not like a build failure of perf tools, it's just a result of
>> feature test so should not affect the build of perf itself, right?
>
> Doh, I see it. It is the -DHAVE_STRLCPY test, of course. And it happens
> only with a V=1 build, so actually there's not a build problem.
>
>> Why it confuses us is that we don't show any compile message if -s
>> option is given to make, so I posted a patch to hide CHK and above
>> failure message when -s option is specified.
>
> Hm, trying your patch ontop of acme's perf/core still shows CHK stuff
>
> $ make -s tools/perf
>     DESCEND perf
>     CHK -fstack-protector-all
>     CHK -Wstack-protector
>     CHK -Wvolatile-register-var
>     CHK bionic
>     CHK libelf
>     CHK libdw
>     ...
>
>
> and that's because I'm doing the build from the toplevel repo and not in
> perf/. If I switch to perf first, it is silent:
>
> $ make -s
> Makefile:809: No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling
> Makefile:846: No numa.h found, disables 'perf bench numa mem' benchmark, please install numa-libs-devel or libnuma-dev
> $

That's because the toplevel Makefile resets MAKEFLAGS in the middle:

Makefile:1330
  # Clear a bunch of variables before executing the submake
  tools/: FORCE
  	$(Q)mkdir -p $(objtree)/tools
  	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/
  
  tools/%: FORCE
  	$(Q)mkdir -p $(objtree)/tools
  	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/ $*


So why should it be reset in the first place?

>
> Oh, and one more thing, there's tools/scripts/Makefile.include which
> looks at -s already and perf/Makefile includes it so you probably want
> to put your change there so that all tools use it.

Are you suggesting that moving "try-cc" to the Makefile.include?

Thanks,
Namhyung

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

* Re: perf 3.8-rc build failure:  undefined reference to `strlcpy'
  2013-01-30  4:56       ` Namhyung Kim
@ 2013-01-30  5:42         ` Borislav Petkov
  0 siblings, 0 replies; 6+ messages in thread
From: Borislav Petkov @ 2013-01-30  5:42 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Thomas Backlund, Linux Kernel Mailing List,
	Arnaldo Carvalho de Melo, Jiri Olsa

On Wed, Jan 30, 2013 at 01:56:34PM +0900, Namhyung Kim wrote:
> That's because the toplevel Makefile resets MAKEFLAGS in the middle:

That was me: ea01fa9f63aef

> 
> Makefile:1330
>   # Clear a bunch of variables before executing the submake

and I added this because there was a problem AFAICR. And why I added it,
is not documented in the patch commit message, crap.

>   tools/: FORCE
>   	$(Q)mkdir -p $(objtree)/tools
>   	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/
>   
>   tools/%: FORCE
>   	$(Q)mkdir -p $(objtree)/tools
>   	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/ $*
>
> So why should it be reset in the first place?

Oh yeah, it was some interaction with the toplevel Makefile that caused
issues. Here's one, if you remove MAKEFLAGS= above and dump it in the
target, here's what you get:

$ make -j9 tools/perf_clean
MAKEFLAGS: --no-print-directory -Rr --jobserver-fds=5,7 -j -I /w/kernel/linux-2.6
    DESCEND perf
make[2]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
    SUBDIR ../lib/traceevent/
*.o *~ libtraceevent.a libtraceevent.so *.a *.so ep_version.h .*.d
/bin/sh: 1: *.o: not found
make[4]: *** [clean] Error 127
make[3]: *** [sub-make] Error 2
make[2]: *** [/w/kernel/linux-2.6/tools/perf/libtraceevent.a-clean] Error 2
make[1]: *** [perf_clean] Error 2
make: *** [tools/perf_clean] Error 2

The "rm -f" is missing at the beginning of the line because kbuild does
remove build files differently.

If you leave it in, it works fine:

    DESCEND perf
    SUBDIR ../lib/traceevent/
rm -f *.o *~ libtraceevent.a libtraceevent.so *.a *.so ep_version.h .*.d
...

> > Oh, and one more thing, there's tools/scripts/Makefile.include which
> > looks at -s already and perf/Makefile includes it so you probably want
> > to put your change there so that all tools use it.
> 
> Are you suggesting that moving "try-cc" to the Makefile.include?

Forget it, I got confused with the QUIET_* thingies in
<tools/scripts/Makefile.include>

Thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

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

end of thread, other threads:[~2013-01-30  5:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-29  4:22 perf 3.8-rc build failure: undefined reference to `strlcpy' Thomas Backlund
2013-01-29 10:37 ` Borislav Petkov
2013-01-30  2:15   ` Namhyung Kim
2013-01-30  3:28     ` Borislav Petkov
2013-01-30  4:56       ` Namhyung Kim
2013-01-30  5:42         ` Borislav Petkov

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 NNTP newsgroup(s).