09-03-2015 10:50 PM
My makefile uses Linux "ar" and I can't get it to work.
If I use the default ar (Busybox)
/usr/bin/ar x86_64-obj/libxos.a x86_64-obj/DirApi.o
/usr/bin/ar: invalid option -- '8'
BusyBox v1.22.1 (2015-05-14 16:32:23 CDT) multi-call binary.
Usage: ar [-o] [-v] [-p] [-t] [-x] ARCHIVE FILES
Extract or list FILES from an ar archive
-o Preserve original dates
-p Extract to stdout
-t List
-x Extract
-v Verbose
I am trying to create the archive (not my makefile but that looks right to me) not extract or list files.
If I symlink to gcc-ar (found two ar commands using ls /usr/bin/*ar )
gcc-ar: error trying to exec 'ar': execvp: Argument list too long
One doesn't make archives, the other has issues.
How should I make a .a file?
Solved! Go to Solution.
09-04-2015 07:50 AM
Try running
ar cr x86_64-obj/libxos.a x86_64-obj/DirApi.o
09-04-2015 09:16 AM
Apparently there is no "r" nor a "c" option on my machine. Is it possible that I do not have right version of "ar" installed?
09-04-2015 09:19 AM
/usr/bin/arm-nilrt-linux-gnueabi-ar has it on my machine. Verify that /usr/bin/ar points to it or run it using the full path.
09-04-2015 10:03 AM
Thanks, that pointed the way. I succeeded in building my .a file.
I did something just like this for the 9033 which is Intel (not ARM)
/usr/bin/ar -> /usr/x86_64-nilrt-linux/bin/ar
It also helped to hunt down the "ar" command in the makefile. the one I inherited is replete with pointless indirection and redefinition. I ended up using
make MAKE_VERVBOSE=1 SHELL="/bin/bash -x" -d target
to prove that it was getting the right switches (it wasn't)
There are a handful of other commands in that x86 directory. I'll keep those in mind in case something else isn't working.