Bug 92002 - PR_SET_NAME undeclared compilation error (internal glib)
Summary: PR_SET_NAME undeclared compilation error (internal glib)
Status: RESOLVED FIXED
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: pkg-config
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-14 16:26 UTC by felix.almeida
Modified: 2015-09-26 19:18 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description felix.almeida 2015-09-14 16:26:32 UTC
When pkg-config-0.28 is configured with "--with-internal-glib" the following error occurs on systems running older Kernels that don't have PR_SET_NAME defined for prctl(2):

[...]
  CC       gthread-posix.lo
gthread-posix.c: In function `g_system_thread_set_name':
gthread-posix.c:1175: error: `PR_SET_NAME' undeclared (first use in this function)
gthread-posix.c:1175: error: (Each undeclared identifier is reported only once
gthread-posix.c:1175: error: for each function it appears in.)

I believe that the following patch can fix it (at least it worked for me here on a RHEL4 system running kernel 2.6.9-100.ELsmp):

*** glib/glib/gthread-posix.c.orig      2015-09-14 12:18:16.000000000 -0400
--- glib/glib/gthread-posix.c   2015-09-14 12:18:35.000000000 -0400
***************
*** 1171,1177 ****
  void
  g_system_thread_set_name (const gchar *name)
  {
! #ifdef HAVE_SYS_PRCTL_H
    prctl (PR_SET_NAME, name, 0, 0, 0, 0);
  #endif
  }
--- 1171,1177 ----
  void
  g_system_thread_set_name (const gchar *name)
  {
! #if HAVE_SYS_PRCTL_H && defined PR_SET_NAME
    prctl (PR_SET_NAME, name, 0, 0, 0, 0);
  #endif
  }
Comment 1 Dan Nicholson 2015-09-26 19:18:11 UTC
Thanks for the patch. This was actually fixed in upstream glib quite a while ago (https://git.gnome.org/browse/glib/commit/?id=23a2136fb5dd860a57a9bd46e61099ea4da99447). That fix is included in the updated glib snapshot in git master (http://cgit.freedesktop.org/pkg-config/tree/glib/glib/gthread-posix.c#n1187).

Closing as resolved and will be in the next release.


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.