Opened 10 years ago
Closed 9 years ago
#46943 closed defect (worksforme)
py27-gobject3 fails to build on MacOS 10.5.8 PPC; can fix problem with -fPIC
Reported by: | paulccobb@… | Owned by: | neverpanic (Clemens Lang) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.3.3 |
Keywords: | leopard powerpc lack-of-interest | Cc: | |
Port: | py-gobject3 |
Description (last modified by mf2k (Frank Schima))
I found a few days ago that in trying to upgrade py27-gobject3 from 3.12.1_0 to 3.14.0_0, the build failed with the following error in main.log:
ld: absolute addressing (perhaps -mdynamic-no-pic) used in _pygobject_constructv from .libs/_gi_la-gobjectmodule.o not allowed in slidable image. Use '-read_only_relocs suppress' to enable text relocs collect2: ld returned 1 exit status
I can't claim to be an expert on MacPorts or on PowerPC build issues, but I've tried to understand what's going wrong, and offer the following info in case it helps.
I found by experiment in the work/pygobject-3.14.0 directory (under macports/build) that if I insert the switch '-fPIC' in the CFLAGS for each Makefile, that makes the problem go away. As far as I understand the issue, PowerPC compilation has historically assumed -mdynamic_no_pic as the default; so if the rest of the build process wants pic, it has to be enabled explicitly.
In case they're useful, I've attached two files that each capture the output of a 'make' run, invoked in the work/pygobject-3.14.0 directory without args: the first one ends with the build error, while the second has the -fPIC switch present in all Makefiles and appears to run to completion.
Attachments (3)
Change History (9)
Changed 10 years ago by paulccobb@…
Changed 10 years ago by paulccobb@…
Attachment: | make-fPIC.log added |
---|
Second file: make output log, showing presence of '-fPIC' option, build error apparently gone
comment:1 Changed 10 years ago by mf2k (Frank Schima)
Keywords: | leopard powerpc added |
---|---|
Owner: | changed from macports-tickets@… to cal@… |
Port: | py-gobject3 added |
In the future, please use WikiFormatting, fill in the Port field and Cc the port maintainers (port info --maintainers py27-gobject3
), if any.
comment:2 Changed 10 years ago by mf2k (Frank Schima)
Description: | modified (diff) |
---|
Changed 10 years ago by neverpanic (Clemens Lang)
Attachment: | Portfile-powerpc-ticket-46943.diff added |
---|
Patch against the Portfile that attempts to fix this issue
comment:3 Changed 10 years ago by neverpanic (Clemens Lang)
I've attached a patch against the Portfile. Can you test whether this fixes the issue for you? Unfortunately, I don't have a PowerPC box ready to test this myself.
comment:4 Changed 10 years ago by neverpanic (Clemens Lang)
Status: | new → assigned |
---|
comment:5 Changed 10 years ago by neverpanic (Clemens Lang)
Sorry that patch has a syntax error, this one is the right one:
-
Portfile
48 48 --disable-silent-rules 49 49 configure.cppflags-append \ 50 50 -I${python.prefix}/include 51 platform darwin { 52 # PowerPC builds fail because -mdynamic_no_pic is the default, #46943 53 if {([variant_isset universal] && ("ppc" in ${universal_archs} || "ppc64" in ${universal_archs})) 54 || (![variant_isset universal] && [string match "ppc*" ${build_arch}])} { 55 configure.cflags-append -fPIC 56 } 57 } 51 58 52 59 build.cmd [portbuild::build_getmaketype] 53 60 build.target
comment:6 Changed 9 years ago by neverpanic (Clemens Lang)
Keywords: | lack-of-interest added |
---|---|
Resolution: | → worksforme |
Status: | assigned → closed |
Closing due to missing response. Please re-open if you can confirm this fixes your issue.
First file: make output log showing build error