Bug 400164

Summary: helgrind test encounters mips x-compiler warnings and assembler error
Product: [Developer tools] valgrind Reporter: Randy MacLeod <rwmacleod>
Component: helgrindAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: mips32r2
Priority: NOR    
Version: 3.14 SVN   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Patch: Make local functions static to avoid assembler error

Description Randy MacLeod 2018-10-22 18:33:31 UTC
Created attachment 115832 [details]
Patch: Make local functions static to avoid assembler error

SUMMARY

When building valgrind for Yocto-2.6 and using the musl libc rather than glibc,
a file in helgrind encounters an assembler error when building for qemumips/qemumips64.

STEPS TO REPRODUCE

On any desktop Linux system such as Ubuntu-18.04,
0. sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
 build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
 xz-utils debianutils iputils-ping libsdl1.2-dev xterm
1. git clone git://git.pokylinux.org/poky.git
2. cd poky.git
3. git checkout bc98a1e89dcd7b3f59f99e4382439d9028ba4db2
4. mkdir ../proj; cd ../proj
5. . ../poky.git/oe-init-build-env vg-bug
6. MACHINE=qemumips TCLIBC=musl bitbake valgrind

OBSERVED RESULT

the valgrind build fails an error:

several warnings:
 ../../../valgrind-3.14.0/helgrind/tests/annotate_hbefore.c:360:6: warning: no previous prototype for 'do_signal' [-Wmissing-prototypes]
    |  void do_signal ( UWord* w )
    |       ^~~~~~~~~
    

error:
    
    /tmp/cce22iiw.s: Assembler messages:
    /tmp/cce22iiw.s:446: Error: symbol `exit_0' is already defined
    /tmp/cce22iiw.s:448: Error: symbol `exit' is already defined
    /tmp/cce22iiw.s:915: Error: symbol `exit_0' is already defined
    /tmp/cce22iiw.s:917: Error: symbol `exit' is already defined


EXPECTED RESULT

valgrind builds without error.


SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: N/A
KDE Frameworks Version: N/A 
Qt Version: N/A

ADDITIONAL INFORMATION

Patch attached.
Comment 1 Petar Jovanovic 2019-03-25 18:56:36 UTC
I hope this is fixed with

https://sourceware.org/git/?p=valgrind.git;a=commit;h=d6da48fe5ac2e94fe28184ff334cd6b2283ef9a6

Randy, can you confirm?
Comment 2 Randy MacLeod 2023-11-08 23:13:01 UTC
Yes, that works Petar. I'm in the middle of updating the Yocto valgrind recipe to 3.22.0 so I'm finally dropping our local patch!
Thanks.