valgrind-macos icon indicating copy to clipboard operation
valgrind-macos copied to clipboard

Compilation error on 10.15.7 (both brew and manual compilation)

Open PKua007 opened this issue 4 years ago • 4 comments

Hi!

I have tried to install valgrind on macOS Catalina 10.15.7, both using brew and manually cloning and compiling. In both cases I am getting the same 2 errors:

m_syswrap/syswrap-darwin.c:3242:9: error: use of undeclared identifier 'ATTR_CMNEXT_CLONEID'
      { ATTR_CMNEXT_CLONEID,      sizeof(uint64_t) },
        ^
m_syswrap/syswrap-darwin.c:3243:9: error: use of undeclared identifier 'ATTR_CMNEXT_EXT_FLAGS'
      { ATTR_CMNEXT_EXT_FLAGS,    sizeof(uint64_t) },
        ^

gcc --version gives:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

For both installation methods I followed the instructions from https://stackoverflow.com/a/61359781/7146406. I am more than happy to share more information if needed.

Cheers!

PKua007 avatar Apr 15 '21 13:04 PKua007

Hi @PKua007, I don't have a macOS 10.15 computer around anymore, but I'll try take a look.

LouisBrunner avatar Apr 18 '21 15:04 LouisBrunner

Hey, I also run 10.15.7, but it compiled successfully for me (I used brew). My output of gcc --version gives:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Note that I have clang 12 and the full Xcode installation. Maybe try updating llvm using brew first, if that doesn't help, try again after installing Xcode.

Hpixpoke avatar Apr 23 '21 22:04 Hpixpoke

I also same question too.

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

AsteriskZuo avatar Sep 29 '21 07:09 AsteriskZuo

I found a memory leak detection tool similar to valgrind —— leaks. in terminal: $ leaks 91030

Process:         rust-analyzer-x86_64-apple-darwin [91030]
Path:            /Users/USER/Library/Application Support/Code/*/rust-analyzer-x86_64-apple-darwin
Load Address:    0x10c83d000
Identifier:      rust-analyzer-x86_64-apple-darwin
Version:         ???
Code Type:       X86-64
Platform:        macOS
Parent Process:  rust-analyzer-x86_64-apple-darwin [90996]

Date/Time:       2021-09-29 15:15:22.764 +0800
Launch Time:     2021-09-28 19:49:42.091 +0800
OS Version:      Mac OS X 10.15.7 (19H1419)
Report Version:  7
Analysis Tool:   /Applications/Xcode.app/Contents/Developer/usr/bin/leaks
Analysis Tool Version:  Xcode 12.4 (12D4e)
----

leaks Report Version: 4.0
Process 91030: 531 nodes malloced for 75 KB
Process 91030: 0 leaks for 0 total leaked bytes.

ref

AsteriskZuo avatar Sep 29 '21 07:09 AsteriskZuo

Closing this due to inactivity. Please reopen with more details and/or a reproducible example if the issue persists.

The GitHub action I use to validate this project builds correctly on macOS 10.15, so knowing your version of Xcode would be useful (xcrun --sdk macosx --show-sdk-version).

LouisBrunner avatar Jan 02 '23 22:01 LouisBrunner

Hi, sorry for abandoning the issue. I no longer have access to 10.15 machine. If I find any issues on a newer version I will submit a new issue. You can leave it closed, thanks for taking your time!

PKua007 avatar Jan 03 '23 11:01 PKua007