Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#18481 closed defect (fixed)

bzip2: universal build fails with 4 architectures

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: bzip2

Description

$ sudo port -d install bzip2 +universal build.jobs=1
DEBUG: Found port in file:///Users/rschmidt/macports/dports/archivers/bzip2
DEBUG: Changing to port directory: /Users/rschmidt/macports/dports/archivers/bzip2
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.distfiles registered provides 'distfiles', a pre-existing procedure. Target override will not be provided
DEBUG: universal variant already exists, so not adding the default one
DEBUG: Requested variant i386 is not provided by port bzip2.
DEBUG: Requested variant macosx is not provided by port bzip2.
DEBUG: Executing variant darwin provides darwin
DEBUG: Executing variant universal provides universal
DEBUG: Executing org.macports.main (bzip2)
--->  Fetching bzip2
DEBUG: Executing org.macports.fetch (bzip2)
--->  Verifying checksum(s) for bzip2
DEBUG: Executing org.macports.checksum (bzip2)
--->  Checksumming bzip2-1.0.5.tar.gz
DEBUG: Correct (md5) checksum for bzip2-1.0.5.tar.gz
DEBUG: Correct (sha1) checksum for bzip2-1.0.5.tar.gz
DEBUG: Correct (rmd160) checksum for bzip2-1.0.5.tar.gz
--->  Extracting bzip2
DEBUG: Executing org.macports.extract (bzip2)
--->  Extracting bzip2-1.0.5.tar.gz
DEBUG: setting option extract.args to /opt/local/var/macports/distfiles/bzip2/bzip2-1.0.5.tar.gz
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.4'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_rschmidt_macports_dports_archivers_bzip2/work" && gzip -dc /opt/local/var/macports/distfiles/bzip2/bzip2-1.0.5.tar.gz | /usr/bin/gnutar --no-same-owner -xf -'
DEBUG: Executing org.macports.patch (bzip2)
--->  Applying patches to bzip2
--->  Applying /Users/rschmidt/macports/dports/archivers/bzip2/files/patch-Makefile-man.diff
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.4'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_rschmidt_macports_dports_archivers_bzip2/work/bzip2-1.0.5" && patch -p0'
patching file Makefile
Hunk #1 succeeded at 72 (offset 12 lines).
Hunk #2 succeeded at 83 (offset 12 lines).
Hunk #3 succeeded at 99 with fuzz 2 (offset 12 lines).
--->  Applying /Users/rschmidt/macports/dports/archivers/bzip2/files/patch-Makefile-links.diff
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.4'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_rschmidt_macports_dports_archivers_bzip2/work/bzip2-1.0.5" && patch -p0'
patching file Makefile
Hunk #1 succeeded at 90 with fuzz 2.
--->  Applying /Users/rschmidt/macports/dports/archivers/bzip2/files/patch-Makefile-dylib.diff
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.4'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_rschmidt_macports_dports_archivers_bzip2/work/bzip2-1.0.5" && patch -p0'
patching file Makefile
Hunk #3 succeeded at 98 with fuzz 2.
Hunk #4 succeeded at 123 with fuzz 1.
DEBUG: Executing proc-post-org.macports.patch-patch-0
--->  Configuring bzip2
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing org.macports.configure (bzip2)
DEBUG: Executing proc-post-org.macports.configure-configure-0
DEBUG: Executing proc-post-org.macports.configure-configure-1
--->  Building bzip2
DEBUG: Executing org.macports.build (bzip2)
DEBUG: port allows a parallel build
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.4'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_rschmidt_macports_dports_archivers_bzip2/work/bzip2-1.0.5" && nice -n 10 make all PREFIX="/opt/local"'

If compilation produces errors, or a large number of warnings,
please read README.COMPILATION.PROBLEMS -- you might be able to
adjust the flags in this Makefile to improve matters.

Also in README.COMPILATION.PROBLEMS are some hints that may help
if your build produces an executable which is unable to correctly
handle so-called 'large files' -- files of size 2GB or more.

/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch ppc -arch x86_64 -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c blocksort.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch ppc -arch x86_64 -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c huffman.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch ppc -arch x86_64 -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c crctable.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch ppc -arch x86_64 -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c randtable.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch ppc -arch x86_64 -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c compress.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch ppc -arch x86_64 -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c decompress.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch ppc -arch x86_64 -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c bzlib.c
rm -f libbz2.a
ar cq libbz2.a blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o
ranlib libbz2.a
rm -f libbz2.dylib
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch ppc -arch x86_64 -arch ppc64 -dynamiclib blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o -o libbz2.1.0.5.dylib \
        -install_name /opt/local/lib/libbz2.1.0.dylib \
        -compatibility_version 1.0 -current_version 1.0.5
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch ppc -arch x86_64 -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c bzip2.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch ppc -arch x86_64 -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64  -o bzip2 bzip2.o -L. -lbz2
ld64 warning: in /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libbz2.dylib, missing required architecture x86_64 in file
Undefined symbols for architecture x86_64:
  _BZ2_bzRead, referenced from:
      _uncompress in bzip2.o
      _testf in bzip2.o
  _BZ2_bzWriteOpen, referenced from:
      _compress in bzip2.o
  _BZ2_bzReadClose, referenced from:
      _uncompress in bzip2.o
      _uncompress in bzip2.o
      _testf in bzip2.o
      _testf in bzip2.o
  _BZ2_bzlibVersion, referenced from:
      _license in bzip2.o
      _usage in bzip2.o
  _BZ2_bzWrite, referenced from:
      _compress in bzip2.o
  _BZ2_bzReadOpen, referenced from:
      _uncompress in bzip2.o
      _testf in bzip2.o
  _BZ2_bzReadGetUnused, referenced from:
      _uncompress in bzip2.o
      _testf in bzip2.o
  _BZ2_bzWriteClose64, referenced from:
      _compress in bzip2.o
      _compress in bzip2.o
ld64-62.1 failed: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
ld64 warning: in /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libbz2.dylib, missing required architecture ppc64 in file
Undefined symbols for architecture ppc64:
  _BZ2_bzRead, referenced from:
      _uncompress in bzip2.o
      _testf in bzip2.o
  _BZ2_bzWriteOpen, referenced from:
      _compress in bzip2.o
  _BZ2_bzReadClose, referenced from:
      _uncompress in bzip2.o
      _uncompress in bzip2.o
      _testf in bzip2.o
      _testf in bzip2.o
  _BZ2_bzlibVersion, referenced from:
      _license in bzip2.o
      _usage in bzip2.o
  _BZ2_bzWrite, referenced from:
      _compress in bzip2.o
  _BZ2_bzReadOpen, referenced from:
      _uncompress in bzip2.o
      _testf in bzip2.o
  _BZ2_bzReadGetUnused, referenced from:
      _uncompress in bzip2.o
      _testf in bzip2.o
  _BZ2_bzWriteClose64, referenced from:
      _compress in bzip2.o
      _compress in bzip2.o
ld64-62.1 failed: symbol(s) not found for architecture ppc64
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//cc5lTIXq.out (No such file or directory)
make: *** [bzip2] Error 1

Hey now. Why are we looking at /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libbz2.dylib at all?

Change History (6)

comment:1 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: mcalhoun@… added
Status: newassigned

r45435 caused this because now "-L. -lbz2" fails to find the new library in the worksrcpath because now only libbz2.1.0.5.dylib is built and there is no file or link called just libbz2.dylib which is what "-lbz2" needs.

comment:2 Changed 16 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

r46773 is probably the revision in question.
Should be fixed in r46782.

comment:3 in reply to:  2 ; Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to mcalhoun@…:

r46773 is probably the revision in question.

Um, yes.

Should be fixed in r46782.

Unfortunately, no.

Doing 6 tests (3 compress, 3 uncompress) ...
If there's a problem, things might stop at this point.
 
DYLD_LIBRARY_PATH=. ./bzip2 -1  < sample1.ref > sample1.rb2
dyld: Library not loaded: /mp/lib/libbz2.1.0.dylib
  Referenced from: /mp/var/macports/build/_Users_rschmidt_macports_dports_archivers_bzip2/work/bzip2-1.0.5/./bzip2
  Reason: no suitable image found.  Did find:
        /usr/lib/libbz2.1.0.dylib: no matching architecture in universal wrapper
make: *** [test] Error 133

Error: Status 1 encountered during processing.

comment:4 in reply to:  3 ; Changed 16 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to ryandesign@…:

Replying to mcalhoun@…:

Should be fixed in r46782.

Unfortunately, no.

At least the error was in another place.
That is progress of a sort.

r46833 is a second attempt.

By the way, it is difficult to for me to catch these problems since /usr/lib/libbz2.dylib is a 4-architecture universal.
The testing phase seems to happily (but incorrectly) use it.

comment:5 in reply to:  4 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Replying to mcalhoun@…:

r46833 is a second attempt.

Ok, now I get:

--->  Building bzip2
DEBUG: Executing org.macports.build (bzip2)
DEBUG: port allows a parallel build
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.4'
DEBUG: Assembled command: 'cd "/mp/var/macports/build/_Users_rschmidt_macports_dports_archivers_bzip2/work/bzip2-1.0.5" && nice -n 10 make -j3 all PREFIX="/mp"'
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch x86_64 -arch ppc -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c huffman.c

If compilation produces errors, or a large number of warnings,
please read README.COMPILATION.PROBLEMS -- you might be able to
adjust the flags in this Makefile to improve matters.

Also in README.COMPILATION.PROBLEMS are some hints that may help
if your build produces an executable which is unable to correctly
handle so-called 'large files' -- files of size 2GB or more.

/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch x86_64 -arch ppc -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c blocksort.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch x86_64 -arch ppc -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c crctable.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch x86_64 -arch ppc -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c randtable.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch x86_64 -arch ppc -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c compress.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch x86_64 -arch ppc -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c decompress.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch x86_64 -arch ppc -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c bzlib.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch x86_64 -arch ppc -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c bzip2.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch x86_64 -arch ppc -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c bzip2recover.c
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch x86_64 -arch ppc -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64  -o bzip2recover bzip2recover.o
rm -f libbz2.a
ar cq libbz2.a blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o
ranlib libbz2.a
rm -f libbz2.dylib
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch x86_64 -arch ppc -arch ppc64 -dynamiclib blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o -o libbz2.1.0.5.dylib \
        -install_name /mp/lib/libbz2.1.0.dylib \
        -compatibility_version 1.0 -current_version 1.0.5
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -arch x86_64 -arch ppc -arch ppc64 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64  -o bzip2 bzip2.o -L. -lbz2
ld64 warning: in /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libbz2.dylib, missing required architecture x86_64 in file
Undefined symbols for architecture x86_64:
  _BZ2_bzRead, referenced from:
      _uncompress in bzip2.o
      _testf in bzip2.o
  _BZ2_bzWriteOpen, referenced from:
      _compress in bzip2.o
  _BZ2_bzReadClose, referenced from:
      _uncompress in bzip2.o
      _uncompress in bzip2.o
      _testf in bzip2.o
      _testf in bzip2.o
  _BZ2_bzlibVersion, referenced from:
      _license in bzip2.o
      _usage in bzip2.o
  _BZ2_bzWrite, referenced from:
      _compress in bzip2.o
  _BZ2_bzReadOpen, referenced from:
      _uncompress in bzip2.o
      _testf in bzip2.o
  _BZ2_bzReadGetUnused, referenced from:
      _uncompress in bzip2.o
      _testf in bzip2.o
  _BZ2_bzWriteClose64, referenced from:
      _compress in bzip2.o
      _compress in bzip2.o
ld64-62.1 failed: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
ld64 warning: in /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libbz2.dylib, missing required architecture ppc64 in file
Undefined symbols for architecture ppc64:
  _BZ2_bzRead, referenced from:
      _uncompress in bzip2.o
      _testf in bzip2.o
  _BZ2_bzWriteOpen, referenced from:
      _compress in bzip2.o
  _BZ2_bzReadClose, referenced from:
      _uncompress in bzip2.o
      _uncompress in bzip2.o
      _testf in bzip2.o
      _testf in bzip2.o
  _BZ2_bzlibVersion, referenced from:
      _license in bzip2.o
      _usage in bzip2.o
  _BZ2_bzWrite, referenced from:
      _compress in bzip2.o
  _BZ2_bzReadOpen, referenced from:
      _uncompress in bzip2.o
      _testf in bzip2.o
  _BZ2_bzReadGetUnused, referenced from:
      _uncompress in bzip2.o
      _testf in bzip2.o
  _BZ2_bzWriteClose64, referenced from:
      _compress in bzip2.o
      _compress in bzip2.o
ld64-62.1 failed: symbol(s) not found for architecture ppc64
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccWMrcFz.out (No such file or directory)
make: *** [bzip2] Error 1
make: *** Waiting for unfinished jobs....
ln -s libbz2.1.0.5.dylib libbz2.1.0.dylib
make: *** Waiting for unfinished jobs....
ln -s libbz2.1.0.5.dylib libbz2.dylib
make: *** Waiting for unfinished jobs....

Note that it's creating the symlinks after it's already tried to test the thing. So this is a parallel build issue that's a result of the additions that have been patched in to build a shared library in the first place, and I'm surprised I never ran into this issue before. Fixed in r46841. And now everything builds nicely! Thank you for your help.

comment:6 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.