Issue 18064 - FreeBSD-4.8: python/makefile.mk uses ld which fails with -pthread
Summary: FreeBSD-4.8: python/makefile.mk uses ld which fails with -pthread
Status: CLOSED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: code (show other issues)
Version: OOo 1.1 RC2
Hardware: PC FreeBSD
: P3 Trivial (vote)
Target Milestone: OOo 1.1.1
Assignee: quetschke
QA Contact: Unknown
URL:
Keywords:
Depends on:
Blocks: 18060
  Show dependency tree
 
Reported: 2003-08-09 10:13 UTC by quetschke
Modified: 2003-11-23 11:45 UTC (History)
4 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch for python/makefile.mk (1.06 KB, patch)
2003-08-09 10:14 UTC, quetschke
no flags Details | Diff
New Pyton patch, generated with dmake patch/create_patch (61.87 KB, patch)
2003-10-13 11:20 UTC, quetschke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description quetschke 2003-08-09 10:13:34 UTC
The makefile.mk uses a ld to link the libraries, but ld fails to link with
-pthread. The correct sollution is to use $(LINK) which points to the
used gcc compiler. Unfortunately gcc doesn't understand --whole-archive and
--no-whole-archive. You have to use -Wl,-whole-archive and -Wl,-no-whole-archive
instead. The following patch does this for FreeBSD, but maybe this should also
be done for the generic UNX case.
Comment 1 quetschke 2003-08-09 10:14:23 UTC
Created attachment 8361 [details]
Patch for python/makefile.mk
Comment 2 quetschke 2003-08-09 10:15:00 UTC
Target 1.1.1
Comment 3 quetschke 2003-10-10 00:17:54 UTC
Set keyword approval_pending. Please approve!
Comment 4 quetschke 2003-10-10 00:34:39 UTC
I found another problem in python.

I'm not sure why I didn't see this problem last time, but the
configure.in in the python source archive needs the following patch:

--- misc/build/Python-2.2.2/configure.in.orig       2002-10-10
17:26:46.000000000 +0200
+++ misc/build/Python-2.2.2/configure.in    2003-10-10
01:28:18.792328000 +0200
@@ -830,11 +830,11 @@
        OpenBSD*|FreeBSD*)
                if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
                then
-                       LDSHARED="cc -shared ${LDFLAGS}"
+                       LDSHARED="$(CC) -shared ${LDFLAGS}"
                else
                        LDSHARED="ld -Bshareable ${LDFLAGS}"
                fi;;
-       NetBSD*) LDSHARED="cc -shared ${LDFLAGS}";;
+       NetBSD*) LDSHARED="$(CC) -shared ${LDFLAGS}";;
        OpenUNIX*|UnixWare*)
                if test "$GCC" = "yes"
                then LDSHARED="$(CC) -shared"

This has to go into the Python-2.2.2.patch, otherwise we are linking
gcc 3.2 build object files with the system cc (propably gcc 2.95)
Comment 5 joergbudi 2003-10-11 13:42:20 UTC
Hi,

@python.diff: Sounds reasonable, I think it should be possible to 
apply it to the freebsd, irix and the general unix branch, this would 
simplify the makefile.mk a little.

@configure.in: Linking 3.2 pure-c objects with 2.95 linker is 
probably not harmful, but I agree that it would be cleaner to do this 
with the correct linker. I also would like to correct this for the 
other platforms.

I currently setup my build env for 1.1.1, this will take until Oct. 
14th probably (slow internet connection). I'll then create a new 
patch file all platforms and attach it to this issue, so that you can 
verify again. 

Hmm, as far as I understood, we will need Sander's or Martin's 
approval for commit then ?

Bye, Joerg
Comment 6 quetschke 2003-10-11 20:04:22 UTC
> @python.diff: Sounds reasonable, I think it should be possible to 
> apply it to the freebsd, irix and the general unix branch, this
> would simplify the makefile.mk a little.
Yep.

> @configure.in: Linking 3.2 pure-c objects with 2.95 linker is 
> probably not harmful, but I agree that it would be cleaner to do
> this with the correct linker. I also would like to correct this for
> the other platforms.
I already created a patch. For configure, not configure.in! And I had
to use ${CC} instead of $(CC)!
I used it for my FreeBSD tinderbox build, but I can not get to that
machine right now. I can post the patch on Monday.

> Hmm, as far as I understood, we will need Sander's or Martin's
> approval for commit then ?
Hmm, as it is your project I think you can approve my patches, and
I guess I can approve your patches as long as they are related to
build issues, or I feel they are safe.

But "one of them" has to verify our patches before they are merged
to the master work space. 

Volker
Comment 7 joergbudi 2003-10-12 21:40:18 UTC
Hi,

I need to prefix -soname and libpython.so.2 also with -Wl,  and the
additional -ldl and on linux, so we still need to have to separate
link lines for  both platforms, so I currently don't see an advantage
in changing the general unix case. 

Waiting for your configure patch.

Bye, Joerg
Comment 8 quetschke 2003-10-13 11:20:46 UTC
Created attachment 10256 [details]
New Pyton patch, generated with dmake patch/create_patch
Comment 9 joergbudi 2003-10-16 20:48:54 UTC
jbu->vq: Linux x86/windows still work fine with both patches, so go
ahead and commit (I still don't have commit access for external,
otherwise I would have done it)
Comment 10 quetschke 2003-10-18 07:34:13 UTC
Committed to ooo111fix1.
Comment 11 pavel 2003-11-23 11:45:21 UTC
Closing.