Unable to compile on Mac OS X 10.11

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Unable to compile on Mac OS X 10.11

Gabriel Gritsch
Hi all,

I am unable to compile on Mac OS X 10.11.6

Xcode command line tools are installed.

Downloaded the valgrind version 3.12.0 from official site:
http://www.valgrind.org/downloads/current.html
http://www.valgrind.org/downloads/valgrind-3.12.0.tar.bz2

./configure (without arguments) runs fine with final output:
         Maximum build arch: amd64
         Primary build arch: amd64
       Secondary build arch: x86
                   Build OS: darwin
       Primary build target: AMD64_DARWIN
     Secondary build target: X86_DARWIN
           Platform variant: vanilla
      Primary -DVGPV string: -DVGPV_amd64_darwin_vanilla=1
         Default supp files: exp-sgcheck.supp xfree-3.supp xfree-4.supp darwin10-drd.supp darwin15.supp

but then „make“ files after a while with missing symbol „___bzero“.
Otheres have that problem too but there are no answers:
https://gist.github.com/tapichu/3025307
https://gist.github.com/Jud/3001460

below is the output of last command that fials:

Making all in memcheck
Making all in .
../coregrind/link_tool_exe_darwin 0x138000000 gcc     -o memcheck-amd64-darwin  -arch x86_64 -O2 -g -std=gnu99 -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-align -Wcast-qual -Wwrite-strings -Wempty-body -Wformat -Wformat-security -Wignored-qualifiers -fno-stack-protector -fno-strict-aliasing -fno-builtin -Wno-cast-align -Wno-self-assign -Wno-tautological-compare -mmacosx-version-min=10.6 -fno-stack-protector -O2 -nodefaultlibs -nostartfiles -Wl,-u,__start -Wl,-e,__start -arch x86_64 memcheck_amd64_darwin-mc_leakcheck.o memcheck_amd64_darwin-mc_malloc_wrappers.o memcheck_amd64_darwin-mc_main.o memcheck_amd64_darwin-mc_translate.o memcheck_amd64_darwin-mc_machine.o memcheck_amd64_darwin-mc_errors.o ../coregrind/libcoregrind-amd64-darwin.a ../VEX/libvex-amd64-darwin.a -lgcc
link_tool_exe_darwin: /usr/bin/ld -static -arch x86_64 -macosx_version_min 10.6 -o memcheck-amd64-darwin -u __start -e __start -image_base 0x138000000 -stack_addr 0x134000000 -stack_size 0x800000 memcheck_amd64_darwin-mc_leakcheck.o memcheck_amd64_darwin-mc_malloc_wrappers.o memcheck_amd64_darwin-mc_main.o memcheck_amd64_darwin-mc_translate.o memcheck_amd64_darwin-mc_machine.o memcheck_amd64_darwin-mc_errors.o ../coregrind/libcoregrind-amd64-darwin.a ../VEX/libvex-amd64-darwin.a
Undefined symbols for architecture x86_64:
  "___bzero", referenced from:
      _hijack_thread_state in libcoregrind-amd64-darwin.a(libcoregrind_amd64_darwin_a-syswrap-amd64-darwin.o)
      _RRegUniverse__init in libvex-amd64-darwin.a(libvex_amd64_darwin_a-host_generic_regs.o)
ld: symbol(s) not found for architecture x86_64
make[3]: *** [memcheck-amd64-darwin] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

It would be great if someone could help me.

thank you very much!

Gabriel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to compile on Mac OS X 10.11

Philippe Waroquiers
On Thu, 2017-01-05 at 10:44 +0100, Gabriel Gritsch wrote:
> I am unable to compile on Mac OS X 10.11.6
Problem was already reported on this list the 23 of December,
a bypass/solution was given by John Reiser.
Here is a copy:


> Undefined symbols for architecture x86_64:
>
>   "___bzero", referenced from:
>
>       _hijack_thread_state in libcoregrind-amd64-darwin.a(libcoregrind_amd64_darwin_a-syswrap-amd64-darwin.o)
>
>       _RRegUniverse__init in libvex-amd64-darwin.a(libvex_amd64_darwin_a-host_generic_regs.o)

$ grep -r __bzero valgrind-3.12

===== coregrind/m_main.c
#if defined(VGO_darwin) && DARWIN_VERS == DARWIN_10_10

/* This might also be needed for > DARWIN_10_10, but I have no way
    to test for that.  Hence '==' rather than '>=' in the version
    test above. */
void __bzero ( void* s, UWord n );
void __bzero ( void* s, UWord n )
{
    (void) VG_(memset)( s, 0, n );
}

#endif
=====

So a timid developer chose "not functional" versus
"works, but perhaps a few microseconds slower".

Just change it to
        #if defined(VGO_darwin)
omitting the test of DARWIN_VERS.





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to compile on Mac OS X 10.11

Gabriel Gritsch
thank you for the quick answer - it worked.

I was unable to search the mailing list because the mentioned urls seem to be down:
http://news.gmane.org/gmane.comp.debugging.valgrind
http://search.gmane.org

thank you and best regards

Gabriel

> Am 05.01.2017 um 11:47 schrieb Philippe Waroquiers <[hidden email]>:
>
> On Thu, 2017-01-05 at 10:44 +0100, Gabriel Gritsch wrote:
>> I am unable to compile on Mac OS X 10.11.6
> Problem was already reported on this list the 23 of December,
> a bypass/solution was given by John Reiser.
> Here is a copy:
>
>
>> Undefined symbols for architecture x86_64:
>>
>>  "___bzero", referenced from:
>>
>>      _hijack_thread_state in libcoregrind-amd64-darwin.a(libcoregrind_amd64_darwin_a-syswrap-amd64-darwin.o)
>>
>>      _RRegUniverse__init in libvex-amd64-darwin.a(libvex_amd64_darwin_a-host_generic_regs.o)
>
> $ grep -r __bzero valgrind-3.12
>
> ===== coregrind/m_main.c
> #if defined(VGO_darwin) && DARWIN_VERS == DARWIN_10_10
>
> /* This might also be needed for > DARWIN_10_10, but I have no way
>    to test for that.  Hence '==' rather than '>=' in the version
>    test above. */
> void __bzero ( void* s, UWord n );
> void __bzero ( void* s, UWord n )
> {
>    (void) VG_(memset)( s, 0, n );
> }
>
> #endif
> =====
>
> So a timid developer chose "not functional" versus
> "works, but perhaps a few microseconds slower".
>
> Just change it to
> #if defined(VGO_darwin)
> omitting the test of DARWIN_VERS.
>
>
>
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to compile on Mac OS X 10.11

Philippe Waroquiers
On Thu, 2017-01-05 at 13:21 +0100, Gabriel Gritsch wrote:
> thank you for the quick answer - it worked.
>
> I was unable to search the mailing list because the mentioned urls seem to be down:
> http://news.gmane.org/gmane.comp.debugging.valgrind
> http://search.gmane.org
Yes, the gmane shutdown has still some visible effects :(.

I guess that we need to change these URLs to point at the
'born again' gmane but I am not sure to understand the current
state of this new gmane, and which URL to use to point at the search.

Philippe



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to compile on Mac OS X 10.11

siddhant bharti
This post has NOT been accepted by the mailing list yet.
In reply to this post by Philippe Waroquiers
Hello,
I am facing following errors. Could you please help me?

initially it had following error:

1)undefined symbol x86_64 ___bzero                - solved from http://valgrind.10908.n7.nabble.com/Unable-to-compile-on-Mac-OS-X-10-11-td57237.html
2)undefined symbol x86_64 __mode_t               - solved by changing __mode_t  to mode_t in my_libc.c and my_libc.h
3)undefined identifier VKI_O_LARGEFILE.    - solved by adding #define VKI_O_LARGEFILE     0100000
4)undefined identifier VKI_S_IFIFO                - solved by adding #define VKI_S_IFIFO S_IFIFO
5)undefined identifier VKI_ERESTARTSYS  - I commented this line (line no 1345 in my_libc.h)

I have tried to solve these errors and these errors are no longer being reported. 

But, now it is not compiling siting following error which I am not able to solve

Undefined symbols for architecture x86_64:
  "___error", referenced from:
      _fjalar_process_file in fjalar_amd64_darwin-readelf.o
      _fopen in fjalar_amd64_darwin-my_libc.o
      ___stdio_init_file in fjalar_amd64_darwin-my_libc.o
      _fdopen in fjalar_amd64_darwin-my_libc.o
      _fwrite in fjalar_amd64_darwin-my_libc.o
      _strtoul in fjalar_amd64_darwin-my_libc.o
      _strtol in fjalar_amd64_darwin-my_libc.o
      ...
  "___isctype", referenced from:
      _isdigit in fjalar_amd64_darwin-readelf.o
      _isxdigit in fjalar_amd64_darwin-readelf.o
  "___istype", referenced from:
      _isalnum in fjalar_amd64_darwin-readelf.o
      _isalpha in fjalar_amd64_darwin-readelf.o
      _isspace in fjalar_amd64_darwin-readelf.o
ld: symbol(s) not found for architecture x86_64
make[3]: *** [fjalar-amd64-darwin] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

The errors are occurring in my_libc.c
I have checked tried to use the library functions from ctype.h , but the error still remains. 
I am not able to locate the reason behind this error.

Java  version-
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Thank you
Regards
Siddhant Bharti

Loading...