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

Bug#475101: obsolete linuxthreads requirement



Russ Allbery <rra@debian.org> writes:
> Kurt Roeckx <kurt@roeckx.be> writes:

>> So it looks to me that _REENTRANT is only used to make some functions
>> like getlogin_r available.

> I believe that's correct, and the discussion at the last DebConf reached
> the same conclusion.  I think this bit in Policy is obsolete.  I already
> closed a Lintian bug about it a while back.

> You may separately need _REENTRANT to get prototypes, but using the right
> feature test macros to get prototypes is a completely different issue and
> I don't think we need to leave this in Policy just for that (otherwise,
> we'd need to talk about GNU_SOURCE and whatnot as well, and I don't see a
> need to go there right now).

>> I think that libraries in Debian should never change behaviour based on
>> _REENTRANT.  If a library can be build to either support threads or not,
>> it should be compiled to support threads.  It might also want to provide
>> one that does and one that doesn't so that you can link to either one,
>> but I would like to discourage that, and the default library should be
>> the one that supports threads.  And if it does provide 2 libraries, the
>> header files for both should be the same and not depend on _REENTRANT.

> I think I agree.  Could someone propose a wording change to Policy to say
> what we really mean here rather than focusing on _REENTRANT?

Here's an attempt at that.  I'm not sure if this says everything that
needs to be said, but I'm not sure what else to say.

I considered saying, as Kurt does above, that two libraries could be
provided, one with thread support and one without, but this poses some
serious problems because both libraries could be loaded into the same
process space and then conflict.  Doing this properly requires symbol
versioning or some other similar mechanism, and at that point I think
we're getting into something that's too difficult and specific to describe
in Policy.  I think I'd rather just let the "should" rather than "must"
provide wiggle-room for that.

Objections or seconds?

diff --git a/policy.sgml b/policy.sgml
index bad28af..1ffe148 100644
--- a/policy.sgml
+++ b/policy.sgml
@@ -7225,10 +7225,10 @@ INSTALL = install -s # (or use strip on the files in debian/tmp)
           for C files) will need to be compiled twice, for the normal
           case. 
         </p>
+
 	<p>
-	  You must specify the gcc option <tt>-D_REENTRANT</tt>
-	  when building a library (either static or shared) to make
-	  the library compatible with LinuxThreads.
+	  Libraries should be built with threading support and to be
+	  thread-safe if the library supports this.
 	</p>
 
         <p>

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>



Reply to: