Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006550OCamlcompiler driverpublic2014-09-10 15:562017-03-10 13:45
Assigned Toshinwell 
PlatformOSMac OS XOS Version
Product Version 
Target VersionFixed in Version 
Summary0006550: Making an empty .cmxa fails on MacOS
DescriptionThe command

  ocamlopt -a -o foo.cmxa

works on Linux, but gives an error message from "ar" on MacOSX because Darwin's "ar" command does not allow adding zero files to an archive (stupid MacOSX).
Additional InformationOne way to create an empty archive is:

  ar rc foo.a /dev/null
  ar d foo.a null

but it really hurts my sensibility to have to hack around such a problem. Does anybody have a more elegant solution?

I think I'll report this to Apple as an "ar" bug.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
doligez (administrator)
2014-10-10 15:55

Turns out that I already reported this to Apple in 2005, and they closed my report without comment.

Also, to create an empty archive that will not trigger a compiler/linker warning:

  ar rc foo.a /dev/null
  ranlib foo.a 2>/dev/null
  ar d foo.a /dev/null
xleroy (administrator)
2015-12-06 18:15

Macports and Homebrew both have a binutils package that provides the GNU sensible implementation of "ar", but it is installed under the name "gar".

How often do we need to create empty .cmxa libraries? I move to suspend this PR.
gasche (administrator)
2015-12-06 18:18

We never need to do this, but some OCaml programmers have a problem when they do something not-really-necessary that happens to do this (for example, have configure switches to decide which packages to include in a `foo.mllib` file, such that under some configurations the list ends up being empty), and do not see any issue as they test under Linux. Then some OSX user reports that their package build is broken, and pain ensues.
shinwell (developer)
2017-03-10 13:45

Moved to [^]

- Issue History
Date Modified Username Field Change
2014-09-10 15:56 doligez New Issue
2014-10-10 15:55 doligez Note Added: 0012345
2014-12-17 22:52 doligez Assigned To => doligez
2014-12-17 22:52 doligez Status new => acknowledged
2014-12-18 00:11 doligez Assigned To doligez =>
2015-03-13 21:57 doligez Target Version 4.02.2+dev / +rc1 => 4.03.0+dev / +beta1
2015-12-06 18:15 xleroy Note Added: 0015064
2015-12-06 18:18 gasche Note Added: 0015065
2016-04-12 16:02 doligez Target Version 4.03.0+dev / +beta1 => 4.03.1+dev
2017-02-16 14:01 doligez Target Version 4.03.1+dev => undecided
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-02-24 13:51 doligez Priority normal => low
2017-02-24 13:51 doligez Status acknowledged => confirmed
2017-02-24 13:51 doligez Category -OCaml general => compiler driver
2017-02-24 13:51 doligez Target Version undecided =>
2017-03-10 13:45 shinwell Note Added: 0017617
2017-03-10 13:45 shinwell Status confirmed => resolved
2017-03-10 13:45 shinwell Resolution open => duplicate
2017-03-10 13:45 shinwell Assigned To => shinwell

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker