Issue 466 - configure script adds -lc_r on FreeBSD instead of using -pthread
Summary: configure script adds -lc_r on FreeBSD instead of using -pthread
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-02-26 01:23 UTC by john.birrell@cai.com
Modified: 2014-08-01 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description john.birrell@cai.com 2000-02-26 01:23:23 UTC
Full_Name: John Birrell
Version: Built from latest cvsup
OS: FreeBSD 4.0-CURRENT
URL: 
Submission from: (NULL) (139.130.51.31)


On FreeBSD, gcc will link against the libc_r (the threaded version of libc)
*instead* of libc iff you use the -pthread argument when linking.
If you use -lc_r instead, gcc will link the program against *both*
libc and libc_r. This will end in tears (core dump).

I'm not a fan of GNU configure so I have no (good) idea about how
to get the configure script to do the right thing.
Comment 1 Kurt Zeilenga 2000-02-26 03:47:35 UTC
At 01:23 AM 2/26/00 GMT, jb@cimlogic.com.au wrote:
>Full_Name: John Birrell
>Version: Built from latest cvsup
>OS: FreeBSD 4.0-CURRENT
>URL: 
>Submission from: (NULL) (139.130.51.31)
>
>
>On FreeBSD, gcc will link against the libc_r (the threaded version of libc)
>*instead* of libc iff you use the -pthread argument when linking.

It should be using -pthread under FreeBSD.  I don't have 4.0-Current
loaded at the moment (though I did a couple of months ago) and did
have any problems with -pthread detection.  Then, again, a lot can
change in a couple of months).  I did just now confirm the configure
does work under 3.4-STABLE for what's that is worth.

Can you provide the relevant details from config.log?

Also note that numerous environmental factors/variables impact
proper detection (noted in INSTALL and doc/install/configure).

Also, do you have (or have had) any portion of LinuxThreads on your
system?  If so, check for conflicting headers and libraries anywhere
in your header/library paths.

	Kurt
Comment 2 Kurt Zeilenga 2000-02-26 03:52:01 UTC
This corrects a typo in previous followup.  Sorry for the
confusion and the duplicatation.

At 01:23 AM 2/26/00 GMT, jb@cimlogic.com.au wrote:
>Full_Name: John Birrell
>Version: Built from latest cvsup
>OS: FreeBSD 4.0-CURRENT
>URL: 
>Submission from: (NULL) (139.130.51.31)
>
>
>On FreeBSD, gcc will link against the libc_r (the threaded version of libc)
>*instead* of libc iff you use the -pthread argument when linking.

It should be using -pthread under FreeBSD.  I don't have 4.0-Current
loaded at the moment (though I did a couple of months ago) and did *NOT*
have any problems with -pthread detection.  Then, again, a lot can
change in a couple of months).  I did just now confirmed the configure
does work under 3.4-STABLE for what's that is worth.

Can you provide the relevant details from config.log?

Also note that numerous environmental factors/variables impact
proper detection (noted in INSTALL and doc/install/configure).

Also, do you have (or have had) any portion of LinuxThreads on your
system?  If so, check for conflicting headers and libraries anywhere
in your header/library paths.

	Kurt
Comment 3 john.birrell@cai.com 2000-02-26 04:04:12 UTC
On Fri, Feb 25, 2000 at 07:47:35PM -0800, Kurt D. Zeilenga wrote:
> It should be using -pthread under FreeBSD.  I don't have 4.0-Current
> loaded at the moment (though I did a couple of months ago) and did
> have any problems with -pthread detection.  Then, again, a lot can
> change in a couple of months).  I did just now confirm the configure
> does work under 3.4-STABLE for what's that is worth.
> 
> Can you provide the relevant details from config.log?

I just checked config.log and I notice that the test for -pthread
is failing due to a problem with the FreeBSD-current version of libc_r
which has a missing weak symbol for longjmp. Sorry for wasting your
time.

-- 
John Birrell - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/
               john.birrell@cai.com john.birrell@opendirectory.com.au
Comment 4 Kurt Zeilenga 2000-02-29 10:20:39 UTC
changed notes
changed state Open to Closed
Comment 5 OpenLDAP project 2014-08-01 21:06:10 UTC
FreeBSD 4.0-current bug