gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error while compiling on FreeBSD


From: Riccardo Mottola
Subject: Re: Error while compiling on FreeBSD
Date: Sun, 21 Dec 2014 23:03:44 +0100
User-agent: Mozilla/5.0 (X11; OpenBSD i386; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26.1

Hi,

my tests were on FreeBSD 10, but I also have 8.x and 9.x available, I will test soon.

Lundberg, Johannes wrote:
My understand is that for respective OS we have

Darwin:
pthread_setname_np with one parameter

Linux
pthread_setname_np with two parameters

FreeBSD
pthread_set_name_np with two parameters

I don't know about NetBSD. Maybe a case has to added for that.

For a system that has both pthread_setname_np and pthread_set_name_np the
behavior is undefined. (in my first patch)

We have a problem on OpenBSD too

NSThread.m: In function '-[NSThread _setName:]':
NSThread.m:810:7: warning: passing argument 1 of 'pthread_set_name_np' from incompatible pointer type [enabled by default]
       result = PTHREAD_SETNAME(pthread_self(),
       ^
In file included from NSThread.m:89:0:
/usr/include/pthread_np.h:48:6: note: expected 'pthread_t'


This the manpage on OpenBSD:
NAME
     pthread_set_name_np - set the name of a thread

SYNOPSIS
     #include <pthread.h>
     #include <pthread_np.h>

     void
     pthread_set_name_np(pthread_t thread, const char *name);

the test which runs successfully is:
configure:13718: checking for pthread_set_name_np
configure:13774: egcc -o conftest -g -O2 -I/Local/Library/Headers -I/Local/Library/Headers -I/System/Library/Headers -I/usr/local/include -L/Local/Library /Libraries -L/Local/Library/Libraries -L/System/Library/Libraries -L/usr/local/lib conftest.c -lpthread >&5
configure:13781: $? = 0
configure:13803: result: yes
configure:13944: checking whether objc really works
configure:13974: egcc -o conftest -g -O2 -I/Local/Library/Headers -I/Local/Library/Headers -I/System/Library/Headers -I/usr/local/include -fgnu-runtime -x objective-c -L/Local/Library/Libraries -L/Local/Library/Libraries -L/System/Library/Libraries -L/usr/local/lib conftest.c -lpthread -Wl,-E -Wl,-R/usr/loc al/lib -shared-libgcc -pthread -fexceptions -fgnu-runtime -L/home/multix/GNUstep/Library/Libraries -L/Local/Library/Libraries -L/System/Library/Libraries -L
/usr/local/lib -lobjc -lm     >&5
In file included from ./config/config.objc.m:2:0,
                 from conftest.c:101:
./config/objc-common.g:30:1: warning: cannot find interface declaration for 'NXConstantString' [enabled by default]
 - (const char*) cString
 ^
/usr/local/lib/libobjc.so.5.0: warning: strcpy() is almost always misused, please use strlcpy() /usr/local/lib/libobjc.so.5.0: warning: sprintf() is often misused, please use snprintf()
configure:13978: $? = 0
configure:13984: ./conftest
configure:13988: $? = 0
configure:14008: result: yes

how can I get from above which check is run? The relevant section is:

AC_CHECK_FUNCS(pthread_set_name_np)
if test $ac_cv_func_pthread_set_name_np == yes; then
  AC_DEFINE(PTHREAD_SETNAME(a,b), pthread_set_name_np(b),
    [Description: Define set name function for pthread])
else
  AC_CACHE_CHECK(
    [for pthread_setname_np() variant],
    [gs_cv_pthread_setname_np],
    [AC_LINK_IFELSE(
      [AC_LANG_PROGRAM([#include <pthread.h>],
        [pthread_setname_np(pthread_self(), "name");])],
        [gs_cv_pthread_setname_np=glibc],
        [AC_LINK_IFELSE(
          [AC_LANG_PROGRAM([#include <pthread.h>],
            [pthread_setname_np(pthread_self(), "%s", "name");])],
             [gs_cv_pthread_setname_np=netbsd],
             [gs_cv_pthread_setname_np=none])])])
  case $gs_cv_pthread_setname_np in
    glibc)
      AC_DEFINE(PTHREAD_SETNAME(a,b), pthread_setname_np(a,b),
        [Description: Define set name function for pthread])
      ;;
    netbsd)
      AC_DEFINE(PTHREAD_SETNAME(a,b), pthread_setname_np(a,"%s",b),
        [Description: Define set name function for pthread])
      ;;
  esac
fi

what is the =netbsd and =none part? What's the special part here for netbsd, which freebsd or openbsd perhaps need?

Riccardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]