arm-linux-ar: illegal option -- z

1.6k views Asked by At

when i want to cross-build libz,there is an error accur,and i search with google,but can't find the answer.Please help me. Also i find a website,but i can't understand this well. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=444727

The code:

root@ubuntu:/home/topeet/Desktop/zlib-1.2.5# make
arm-linux-ar 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 
arm-linux-ar: illegal option -- z
Usage: arm-linux-ar [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...
       arm-linux-ar -M [<mri-script]
 commands:
  d            - delete file(s) from the archive
  m[ab]        - move file(s) in the archive
  p            - print file(s) found in the archive
  q[f]         - quick append file(s) to the archive
  r[ab][f][u]  - replace existing or insert new file(s) into the archive
  t            - display contents of archive
  x[o]         - extract file(s) from the archive
 command specific modifiers:
  [a]          - put file(s) after [member-name]
  [b]          - put file(s) before [member-name] (same as [i])
  [N]          - use instance [count] of name
  [f]          - truncate inserted file names
  [P]          - use full path names when matching
  [o]          - preserve original dates
  [u]          - only replace files that are newer than current archive contents
 generic modifiers:
  [c]          - do not warn if the library had to be created
  [s]          - create an archive index (cf. ranlib)
  [S]          - do not build a symbol table
  [v]          - be verbose
  [V]          - display the version number
  @<file>      - read options from <file>
 emulation options: 
  No emulation specific options
arm-linux-ar: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big srec symbolsrec tekhex binary ihex
make: *** [libz.a] Error 1
1

There are 1 answers

1
QianFan Zhao On

I think it's arm-linux-ar's bug. I don't know where is the param '--z'.

But we can link this by ourself: (add options 'rcs')

arm-linux-ar rcs 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 

after that, make install.