Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#24589 closed defect (fixed)

zlib 1.2.5 parallel build sometimes fails with an ld error

Reported by: mooreja557@… Owned by: landonf (Landon Fuller)
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), thedoobs@…, 0xced (Cédric Luthi)
Port: zlib

Description

moorej-mbp:openvistacis-0 moorej$ sudo port -d install zlib
DEBUG: Found port in file:///opt/local/var/macports/sources/rsync.macports.org/release/ports/archivers/zlib
DEBUG: Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/release/ports/archivers/zlib
DEBUG: OS Platform: darwin
DEBUG: OS Version: 10.3.0
DEBUG: Mac OS X Version: 10.6
DEBUG: System Arch: i386
DEBUG: setting option os.universal_supported to yes
DEBUG: org.macports.load registered provides 'load', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.unload registered provides 'unload', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.distfiles registered provides 'distfiles', a pre-existing procedure. Target override will not be provided
DEBUG: adding the default universal variant
DEBUG: Reading variant descriptions from /opt/local/var/macports/sources/rsync.macports.org/release/ports/_resources/port1.0/variant_descriptions.conf
DEBUG: Requested variant darwin is not provided by port zlib.
DEBUG: Requested variant i386 is not provided by port zlib.
DEBUG: Requested variant macosx is not provided by port zlib.
--->  Computing dependencies for zlib
DEBUG: Executing org.macports.main (zlib)
DEBUG: Skipping completed org.macports.fetch (zlib)
DEBUG: Skipping completed org.macports.checksum (zlib)
DEBUG: setting option extract.cmd to /usr/bin/bzip2
DEBUG: Skipping completed org.macports.extract (zlib)
DEBUG: Skipping completed org.macports.patch (zlib)
DEBUG: Skipping completed org.macports.configure (zlib)
--->  Building zlib
DEBUG: Executing org.macports.build (zlib)
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.6'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zlib/work/zlib-1.2.5" && /usr/bin/make -j2 all'
/usr/bin/gcc-4.2 -O2 -arch x86_64 -o example example.o -L. libz.a
/usr/bin/gcc-4.2 -O2 -arch x86_64 -o minigzip minigzip.o -L. libz.a
collect2: ld terminated with signal 11 [Segmentation fault]
ObjectFileAddressSpace::buildRelocatedMap() unexpected relocation at r_address=0x6E695F00
ObjectFileAddressSpace::buildRelocatedMap() unexpected relocation at r_address=0x63614265
ObjectFileAddressSpace::buildRelocatedMap() unexpected relocation at r_address=0x5F005F74
ObjectFileAddressSpace::buildRelocatedMap() unexpected relocation at r_address=0x00636F6C
ObjectFileAddressSpace::buildRelocatedMap() unexpected relocation at r_address=0x00656572
ObjectFileAddressSpace::buildRelocatedMap() unexpected relocation at r_address=0x6574616C
ObjectFileAddressSpace::buildRelocatedMap() unexpected relocation at r_address=0x00646E45
ObjectFileAddressSpace::buildRelocatedMap() unexpected relocation at r_address=0x6574616C
ObjectFileAddressSpace::buildRelocatedMap() unexpected relocation at r_address=0x6E695F00
make: *** [example] Error 1
make: *** Waiting for unfinished jobs....
collect2: ld terminated with signal 11 [Segmentation fault]
ObjectFileAddressSpace::buildRelocatedMap() unexpected relocation at r_address=0x5F7A675F
make: *** [minigzip] Error 1
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zlib/work/zlib-1.2.5" && /usr/bin/make -j2 all " returned error 2
DEBUG: Backtrace: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zlib/work/zlib-1.2.5" && /usr/bin/make -j2 all " returned error 2
    while executing
"command_exec build"
    (procedure "portbuild::build_main" line 9)
    invoked from within
"$procedure $targetname"
Warning: the following items did not execute (for zlib): org.macports.activate org.macports.build org.macports.destroot org.macports.install
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>
moorej-mbp:openvistacis-0 moorej$ 

Change History (11)

comment:1 Changed 14 years ago by mooreja557@…

Cc: mooreja557@… added

Cc Me!

comment:2 Changed 14 years ago by gigib82@…

Got the same error with buildmakejobs > 1, compiled ok with buildmakejobs = 1

comment:3 Changed 14 years ago by jmroot (Joshua Root)

Cc: ryandesign@… added; mooreja557@… removed
Keywords: zlib removed
Owner: changed from macports-tickets@… to landonf@…
Port: zlib added

Please remember to fill in the Port field and cc the maintainers, and note that you do not need to be in cc when you are the reporter.

What version of Xcode are you using? The upgrade went fine for me with 4 build jobs, and parallel build doesn't seem like the sort of thing that would cause a segfault in ld.

comment:4 Changed 14 years ago by mooreja557@…

I'm currently running Xcode 3.2.1 (1613).

comment:5 Changed 14 years ago by thedoobs@…

Cc: thedoobs@… added

Cc Me!

comment:6 Changed 14 years ago by mooreja557@…

Upgraded to 3.2.2 still have the same error.

comment:7 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Do you have the binutils port installed? If so, deactivate or uninstall it first.

comment:8 Changed 14 years ago by 0xced (Cédric Luthi)

Same problem here. I manually did

cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zlib/work/zlib-1.2.5"
sudo make all

Notice: make all, without the -j2 option. Then I ran sudo port -v install zlib to finish the installation.

comment:9 Changed 14 years ago by 0xced (Cédric Luthi)

Cc: cedric.luthi@… added

Cc Me!

comment:10 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed
Summary: zlib-1.2.5 fails to buildzlib 1.2.5 parallel build sometimes fails with an ld error

I tested building zlib with buildmakejobs=2 several times. Usually it succeeded, but sometimes it didn't. I did not see the specific error reported above, but I did see these failures which look similar:

ar rc libz.a adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o 
/usr/bin/gcc-4.2 -dynamiclib -install_name /opt/local/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.5 -O2 -arch x86_64 -fPIC -o libz.1.2.5.dylib adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo  -lc -L/opt/local/lib -arch x86_64 -L. libz.a
ld: in libz.a, file too small
collect2: ld returned 1 exit status
make: *** [libz.1.2.5.dylib] Error 1
make: *** Waiting for unfinished jobs....
ar rc libz.a adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o 
/usr/bin/gcc-4.2 -dynamiclib -install_name /opt/local/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.5 -O2 -arch x86_64 -fPIC -o libz.1.2.5.dylib adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo  -lc -L/opt/local/lib -arch x86_64 -L. libz.a
/usr/bin/gcc-4.2 -O2 -arch x86_64 -o example example.o -L. libz.a
collect2: ld terminated with signal 10 [Bus error]
make: *** [libz.1.2.5.dylib] Error 1
make: *** Waiting for unfinished jobs....

I disabled the parallel build in r66834 and reported the problem to the developers of zlib.

comment:11 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Upstream provided a patch which I applied in r66848.

Note: See TracTickets for help on using tickets.