Hi,

plain gcc compiler issue is solved, please consider my patch to valgrind (attached).

From the directory that CONTAINS original valgrind-3.8.0 directory run the command:
patch -p0 < plain_gcc_osx.patch

I use gcc-4.7 installed by macports to /opt/local/bin/gcc-mp-4.7
It recognizes Mac "-arch" compiler flags

After patching configure like this (for example):
./configure CC=/opt/local/bin/gcc-mp-4.7 --prefix=/opt/valgrind --enable-only64bit

After installation valgrind is accessible from prefix directory. For me it works.

The issue was caused by using __private_extern__, which is now replaced with equivalent __attribute__((visibility("hidden")))

Anton
diff -rupN valgrind-3.8.0/coregrind/m_syscall.c 
valgrind-3.8.0_patched/coregrind/m_syscall.c
--- valgrind-3.8.0/coregrind/m_syscall.c        2012-08-05 18:04:16.000000000 
+0200
+++ valgrind-3.8.0_patched/coregrind/m_syscall.c        2012-11-08 
17:22:43.000000000 +0100
@@ -456,7 +456,7 @@ asm(
    nb here, sizeof(UWord) == sizeof(UInt)
 */
 
-__private_extern__ ULong 
+__attribute__((visibility("hidden"))) ULong 
 do_syscall_unix_WRK ( UWord a1, UWord a2, UWord a3, /* 4(esp)..12(esp) */
                       UWord a4, UWord a5, UWord a6, /* 16(esp)..24(esp) */
                       UWord a7, UWord a8, /* 28(esp)..32(esp) */
@@ -476,7 +476,7 @@ asm(".private_extern _do_syscall_unix_WR
     "    1:  ret                      \n"
     );
 
-__private_extern__ UInt 
+__attribute__((visibility("hidden"))) UInt 
 do_syscall_mach_WRK ( UWord a1, UWord a2, UWord a3, /* 4(esp)..12(esp) */
                       UWord a4, UWord a5, UWord a6, /* 16(esp)..24(esp) */
                       UWord a7, UWord a8, /* 28(esp)..32(esp) */
@@ -489,7 +489,7 @@ asm(".private_extern _do_syscall_mach_WR
     "        ret                      \n"
     );
 
-__private_extern__ UInt 
+__attribute__((visibility("hidden"))) UInt 
 do_syscall_mdep_WRK ( UWord a1, UWord a2, UWord a3, /* 4(esp)..12(esp) */
                       UWord a4, UWord a5, UWord a6, /* 16(esp)..24(esp) */
                       UWord a7, UWord a8, /* 28(esp)..32(esp) */
@@ -522,7 +522,7 @@ asm(
    nb here, sizeof(UWord) == sizeof(ULong)
 */
 
-__private_extern__ UWord 
+__attribute__((visibility("hidden"))) UWord 
 do_syscall_unix_WRK ( UWord a1, UWord a2, UWord a3, /* rdi, rsi, rdx */
                       UWord a4, UWord a5, UWord a6, /* rcx, r8,  r9 */
                       UWord a7, UWord a8,           /* 8(rsp), 16(rsp) */
@@ -546,7 +546,7 @@ asm(".private_extern _do_syscall_unix_WR
     "        retq                     \n"  /* return 1st result word */
     );
 
-__private_extern__ UWord 
+__attribute__((visibility("hidden"))) UWord 
 do_syscall_mach_WRK ( UWord a1, UWord a2, UWord a3, /* rdi, rsi, rdx */
                       UWord a4, UWord a5, UWord a6, /* rcx, r8,  r9 */
                       UWord a7, UWord a8,           /* 8(rsp), 16(rsp) */
diff -rupN valgrind-3.8.0/coregrind/m_syswrap/syswrap-darwin.c 
valgrind-3.8.0_patched/coregrind/m_syswrap/syswrap-darwin.c
--- valgrind-3.8.0/coregrind/m_syswrap/syswrap-darwin.c 2012-08-05 
18:04:11.000000000 +0200
+++ valgrind-3.8.0_patched/coregrind/m_syswrap/syswrap-darwin.c 2012-11-08 
17:22:42.000000000 +0100
@@ -410,7 +410,7 @@ static OpenPort *info_for_port(mach_port
 
 // Give a port a name, without changing its refcount
 // GrP fixme don't override name if it already has a specific one
-__private_extern__ void assign_port_name(mach_port_t port, const char *name)
+__attribute__((visibility("hidden"))) void assign_port_name(mach_port_t port, 
const char *name)
 {
    OpenPort *i;
    if (!port) return;
diff -rupN valgrind-3.8.0/coregrind/vg_preloaded.c 
valgrind-3.8.0_patched/coregrind/vg_preloaded.c
--- valgrind-3.8.0/coregrind/vg_preloaded.c     2012-08-05 18:04:16.000000000 
+0200
+++ valgrind-3.8.0_patched/coregrind/vg_preloaded.c     2012-11-08 
17:22:40.000000000 +0100
@@ -100,7 +100,7 @@ void * VG_NOTIFY_ON_LOAD(ifunc_wrapper) 
 
 /* This string will be inserted into crash logs, so crashes while 
    running under Valgrind can be distinguished from other crashes. */
-__private_extern__ char *__crashreporter_info__ = "Instrumented by Valgrind " 
VERSION;
+__attribute__((visibility("hidden"))) char *__crashreporter_info__ = 
"Instrumented by Valgrind " VERSION;
 
 /* ---------------------------------------------------------------------
    Darwin environment cleanup
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to