[Buildroot] __mcount on ARC

Vineet Gupta Vineet.Gupta1 at synopsys.com
Tue Feb 20 20:53:34 UTC 2018

On 02/19/2018 12:58 AM, Alexey Brodkin wrote:
> Looks like ARC port of glibc only defines "_mcount" but not "__mcount", see

It used to be so before glibc commit 46e2c0e216ba ARC: Fix -pg build error which 
has been in my
glibc branch #vineet-glibc-master for quite some time and hopefully is the one 
buildroot is picking up.

The driving force here is gcc which defines what mc* call is generated, and that 
for ARC is __mcount

> ------------------------------------->8---------------------------------
> arc-linux-readelf -s libc.so.6 | grep mcount
>     124: 000b397c     4 FUNC    GLOBAL DEFAULT   11 _mcount@@GLIBC_2.26
>     423: 000df95c    44 FUNC    GLOBAL DEFAULT   11 _dl_mcount_wrapper_check@@GLIBC_2.26
>    1584: 000df944    22 FUNC    GLOBAL DEFAULT   11 _dl_mcount_wrapper@@GLIBC_2.26

On my end, I see

arc-linux-nm ./build/glibc-vineet-glibc-master/build/linkobj/libc.so | grep mcount
00070930 T __mcount

> ------------------------------------->8---------------------------------
> and https://github.com/foss-for-synopsys-dwc-arc-processors/glibc/blob/vineet-glibc-master/sysdeps/arc/machine-gmon.h#L26

Look carefully, this actually defines __mcount not _mcount

> I'm an expert in neither glibc nor gprof so not sure what is a difference between
> _mcount vs __mcount but for AArch64 thay set "strong_alias (__mcount, _mcount)" here:
> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/aarch64/mcount.c#l32
> So maybe we need to do the same for ARC.

No, we don't have to  - don't try to apply bandaid without first checking if it is 
really needed.


More information about the buildroot mailing list