2

I am to compile the Poly/ML Standard ML compiler on the MobaXterm v11.1 cygwin-based distribution. Upon make, I get

/bin/sh ./libtool  --tag=CC   --mode=link gcc  -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2  -Wall -fexceptions   -o libffi_convenience.la  src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo      src/x86/ffi.lo src/x86/win32.lo
libtool: link: ar cru .libs/libffi_convenience.a src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi.o src/x86/.libs/win32.o
ar: unknown option -- u
BusyBox v1.22.1 (2015-11-10 11:07:12    ) multi-call binary.

Here I have binutils/ar version 2.29.1.

On a Fedora box with binutils/ar version 2.22.52 the compilation goes through.

I downloaded binutils 2.22.52 to my MobaXterm and tried to compile it but I got the same error message as above:

ar cru libintl.a bindtextdom.o dcgettext.o dgettext.o gettext.o finddomain.o loadmsgcat.o localealias.o textdomain.o l10nflist.o explodename.o dcigettext.o dcngettext.o dngettext.o ngettext.o plural.o plural-exp.o localcharset.o relocatable.o localename.o log.o osdep.o intl-compat.o
ar: unknown option -- u

I see two possible causes of this:

  • the u option of ar become deprecated between version 2.22.52 and 2.29.1
  • MobaXterm uses Busybox which includes a limited version of ar

What is a real explanation and how can I install an ar that understands the u option?

Florian Weimer
  • 32,022
  • 3
  • 48
  • 92
Gergely
  • 6,879
  • 6
  • 25
  • 35
  • 1
    It seems that you are calling `ar` that is part of BusyBox 1.22.1, and it is stripped of some functionality. You need to make sure that you call correct ar executable. Perhaps change your makefile to call it by full path. – mvp Mar 11 '19 at 08:29
  • ar is just a symbolic link to Busybox in /bin -- the makefiles are quite difficult since make invokes configure as well, I take a look at it – Gergely Mar 11 '19 at 08:44

1 Answers1

2

In the libffi directory of the polyml source distribution I edited configure with AR_FLAGS=cr and then make in that directory went through and then make in the main polyml directory went through.

Fortunately, the u option has no real effect on the produced files, only on compile time:

   u   Normally, ar r... inserts all files listed into the archive.  If you would like to insert only
       those of the files you list that are newer than existing members of the same names, use this
       modifier.  The u modifier is allowed only for the operation r (replace).  In particular, the
       combination qu is not allowed, since checking the timestamps would lose any speed advantage
       from the operation q.
Gergely
  • 6,879
  • 6
  • 25
  • 35