caldo43 / naclports

Automatically exported from code.google.com/p/naclports
0 stars 0 forks source link

bzip2 fails to install on a fresh naclports clone #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. gclient config
2. gclient sync
3. make bzip2

What is the expected output? What do you see instead?
Expected is:
touch out/sentinels/bits32/libraries/bzip2-1.0.6

Actual Output #1
--->8----
######################################################################
Untaring bzip2-1.0.6.tgz
######################################################################
rm -f *.o libbz2.a bzip2 bzip2recover \
    sample1.rb2 sample2.rb2 sample3.rb2 \
    sample1.tst sample2.tst sample3.tst
/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/i686-nacl-gc
c -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c huffman.c
/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/i686-nacl-gc
c -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c crctable.c
/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/i686-nacl-gc
c -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c randtable.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.

/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/i686-nacl-gc
c -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c blocksort.c
/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/i686-nacl-gc
c -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c compress.c
/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/i686-nacl-gc
c -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c decompress.c
/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/i686-nacl-gc
c -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c bzlib.c
rm -f libbz2.a
/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/i686-nacl-ar
 cq libbz2.a blocksort.o huffman.o crctable.o randtable.o compress.o 
decompress.o bzlib.o
/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/i686-nacl-ra
nlib libbz2.a
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c bzip2.c
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64  -o bzip2 bzip2.o -L. -lbz2
ld: warning: ignoring file ./libbz2.a, file was built for archive which is not 
the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
  "_BZ2_bzWriteOpen", referenced from:
      _compress in bzip2.o
  "_BZ2_bzWrite", referenced from:
      _compress in bzip2.o
  "_BZ2_bzWriteClose64", referenced from:
      _compress in bzip2.o
  "_BZ2_bzReadOpen", referenced from:
      _testf in bzip2.o
      _uncompress in bzip2.o
  "_BZ2_bzRead", referenced from:
      _testf in bzip2.o
      _uncompress in bzip2.o
  "_BZ2_bzReadGetUnused", referenced from:
      _testf in bzip2.o
      _uncompress in bzip2.o
  "_BZ2_bzReadClose", referenced from:
      _testf in bzip2.o
      _uncompress in bzip2.o
  "_BZ2_bzlibVersion", referenced from:
      _main in bzip2.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [bzip2] Error 1
make: *** [out/sentinels/bits32/libraries/bzip2-1.0.6] Error 2
---8<----

Actual Output #2, where we pass the CC et al to try and nacl-link it
--->8----
/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/i686-nacl-gc
c -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c bzip2.c
bzip2.c: In function ‘notAStandardFile’:
bzip2.c:986: warning: implicit declaration of function ‘lstat’
bzip2.c: In function ‘applySavedTimeInfoToOutputFile’:
bzip2.c:1059: warning: implicit declaration of function ‘utime’
/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/i686-nacl-gc
c -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64  -o bzip2 bzip2.o -L. -lbz2
bzip2.o: In function `applySavedFileAttrToOutputFile':
/Volumes/naclports/naclports/src/out/repository-i686/bzip2-1.0.6/bzip2.c:1070: 
undefined reference to `fchmod'
/Volumes/naclports/naclports/src/out/repository-i686/bzip2-1.0.6/bzip2.c:1073: 
undefined reference to `fchown'
bzip2.o: In function `applySavedTimeInfoToOutputFile':
/Volumes/naclports/naclports/src/out/repository-i686/bzip2-1.0.6/bzip2.c:1059: 
undefined reference to `utime'
bzip2.o: In function `notAStandardFile':
/Volumes/naclports/naclports/src/out/repository-i686/bzip2-1.0.6/bzip2.c:986: 
undefined reference to `lstat'
bzip2.o: In function `countHardLinks':
/Volumes/naclports/naclports/src/out/repository-i686/bzip2-1.0.6/bzip2.c:1003: 
undefined reference to `lstat'
bzip2.o: In function `notAStandardFile':
/Volumes/naclports/naclports/src/out/repository-i686/bzip2-1.0.6/bzip2.c:986: 
undefined reference to `lstat'
bzip2.o: In function `countHardLinks':
/Volumes/naclports/naclports/src/out/repository-i686/bzip2-1.0.6/bzip2.c:1003: 
undefined reference to `lstat'
/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/../lib/gcc/x
86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libcrt_common.a(lib_a-sign
alr.o): In function `_kill_r':
signalr.c:(.text+0x3c): undefined reference to `kill'
/Volumes/naclports/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/../lib/gcc/x
86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libcrt_common.a(lib_a-unli
nkr.o): In function `_unlink_r':
unlinkr.c:(.text+0x1c): undefined reference to `unlink'
collect2: ld returned 1 exit status
make[1]: *** [bzip2] Error 1
make: *** [out/sentinels/bits32/libraries/bzip2-1.0.6] Error 2
---8<----

What version of the product are you using? On what operating system?
native_client_sdk_0_5_1052

I have tried that same "fresh setup" on Fedora 15 x64 and OSX Lion with the 
same results.

Please provide any additional information below.

Please find attached one solution to the problem. I tried passing it 
LDFLAGS=-lnosys in hopes that the stub library would allow it to link, but no.

Original issue reported on code.google.com by mdaniel on 6 Oct 2011 at 7:29

Attachments:

GoogleCodeExporter commented 8 years ago
I'm think this change fixed this:

https://codereview.chromium.org/8205008

Original comment by sbc@google.com on 1 Feb 2013 at 7:58