[ 
https://issues.apache.org/jira/browse/LUCY-195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13159597#comment-13159597
 ] 

Marvin Humphrey commented on LUCY-195:
--------------------------------------

I bit the bullet and installed a VirtualBox OpenBSD instance, and was
immediately able to duplicate the problem.  A one-letter change solves it:

{noformat}
-        my $link_flags = $Config{osname} =~ /openbsd/i ? '-pthread ' : '';
+        my $link_flags = $Config{osname} =~ /openbsd/i ? '-lpthread ' : '';
{noformat}

This approach appears to contradict the OpenBSD man page for 
[pthreads|http://www.openbsd.org/cgi-bin/man.cgi?query=pthreads&sektion=3]:

{noformat}
     In OpenBSD, threads are implemented in a user-level library.  A program
     using these routines must be linked with the -pthread option.
{noformat}

Whatever.  The -pthread vs. -lpthread situation is a big mess -- it's not just
us who's confused.  Here's a thread about libclamav which draws the same
conclusion -- use -lpthread instead of -pthread:

http://kerneltrap.org/mailarchive/openbsd-misc/2009/2/16/4958354/thread#mid-4958354
{quote}
-pthread won't link libpthread into shared objects, while -lpthread
will.  use -pthread when linking the executables that will load
libclamav.
{quote}

Hopefully after this patch we can stop thinking about it.


                
> Revisit pthreads linking on OpenBSD.
> ------------------------------------
>
>                 Key: LUCY-195
>                 URL: https://issues.apache.org/jira/browse/LUCY-195
>             Project: Lucy
>          Issue Type: Bug
>          Components: Perl bindings
>    Affects Versions: 0.2.2 (incubating)
>            Reporter: Marvin Humphrey
>            Assignee: Marvin Humphrey
>            Priority: Minor
>             Fix For: 0.3.0 (incubating)
>
>
> In LUCY-157, we added '-pthread' to the linker flags on OpenBSD.  This does
> not seem to have sufficed, as we are still getting missing symbol errors
> for pthread_mutex_lock, etc.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to