Bug 111264

Summary: u_thread.h:64:39: error: too many arguments to function call, expected 1, have 2
Product: Mesa Reporter: Vinson Lee <vlee>
Component: OtherAssignee: Matt Turner <mattst88>
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: mattst88
Version: gitKeywords: bisected, regression
Hardware: x86-64 (AMD64)   
OS: Mac OS X (All)   
URL: https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1533
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2019-07-31 02:55:35 UTC
In file included from src/gallium/auxiliary/os/os_thread.h:42:
src/util/u_thread.h:64:39: error: too many arguments to function call, expected 1, have 2
   pthread_setname_np(pthread_self(), name);
   ~~~~~~~~~~~~~~~~~~                 ^~~~


9c411e020d164563fb6fcd92a28a435277bf0745 is the first bad commit
commit 9c411e020d164563fb6fcd92a28a435277bf0745
Author: Matt Turner <mattst88@gmail.com>
Date:   Wed Jul 24 18:26:49 2019 -0700

    util: Drop preprocessor guards for glibc-2.12
    
    glibc-2.12 was released in 2010. No one is building new Mesa against 9
    year old glibc, and removing these checks allows the code to work on
    other C libraries like musl.
    
    Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Comment 1 Ian Romanick 2019-07-31 15:58:56 UTC
Looking at the man page (http://man7.org/linux/man-pages/man3/pthread_setname_np.3.html), pthread_setname_np definitely takes two parameters.  Dare I even ask what pthreads library this is?
Comment 2 Vinson Lee 2019-07-31 17:04:49 UTC
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/pthread.h
   512  __API_AVAILABLE(macos(10.6), ios(3.2))
   513  int     pthread_setname_np(const char*);
Comment 3 Matt Turner 2019-07-31 17:43:00 UTC
Aggravatingly, Mac OS's version takes only one parameter it seems. See https://gitlab.haskell.org/ghc/ghc/issues/9684 for example of other projects running into this.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.