Opened 9 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)

make.log (130.1 KB) - added by paulccobb@… 9 years ago.
First file: make output log showing build error
make-fPIC.log (153.7 KB) - added by paulccobb@… 9 years ago.
Second file: make output log, showing presence of '-fPIC' option, build error apparently gone
Portfile-powerpc-ticket-46943.diff (738 bytes) - added by neverpanic (Clemens Lang) 9 years ago.
Patch against the Portfile that attempts to fix this issue

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by paulccobb@…

Attachment: make.log added

First file: make output log showing build error

Changed 9 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 9 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 9 years ago by mf2k (Frank Schima)

Description: modified (diff)

Changed 9 years ago by neverpanic (Clemens Lang)

Patch against the Portfile that attempts to fix this issue

comment:3 Changed 9 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 9 years ago by neverpanic (Clemens Lang)

Status: newassigned

comment:5 Changed 9 years ago by neverpanic (Clemens Lang)

Sorry that patch has a syntax error, this one is the right one:

  • Portfile

     
    4848                            --disable-silent-rules
    4949    configure.cppflags-append \
    5050                            -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    }
    5158
    5259    build.cmd               [portbuild::build_getmaketype]
    5360    build.target

comment:6 Changed 9 years ago by neverpanic (Clemens Lang)

Keywords: lack-of-interest added
Resolution: worksforme
Status: assignedclosed

Closing due to missing response. Please re-open if you can confirm this fixes your issue.

Note: See TracTickets for help on using tickets.