tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Fix Erlang on OSX

On 30 August 2015 at 13:32, Jonathan Perkin <> wrote:
* On 2015-08-24 at 19:38 BST, Steven Williamson wrote:

> Trying to get RabbitMQ installed on OSX and the first hurdle is that Erlang
> does not appear to build.
> The build fails with errors on install, due to the strip command generating
> errors about symbols that can not be stripped as in the example error
> below. I edited the build scripts so that the specific file does not get
> strip run, and the build fails with the same error on another file and so
> on...
> Iv'e attached a patch which fixes the issue (Setting INSTALL_UNSTRIPPED).
> With this Erlang builds and installs without error.

I've committed these, thanks!

No problem!

> Is this the correct fix though ? arguably it looks like on OSX strip by
> default attempts to strip too many symbols, should binaries be stripped at
> all on install by default ?

Yes possibly, I set INSTALL_UNSTRIPPED=yes by default on our SmartOS
builds but not on OSX.  I will test a full bulk build with strip
disabled to see how many extra packages we get before deciding whether
it should be disabled by default.

I had been speaking to Greg Troxel about this, as I mentioned it might be fixable by changing the flags used when strip is called.

The root cause of the issue appears to be that OSX strip behaves differently to strip on most other OS's.

Calling strip on a binary on OSX with no other arguments attempts to strip all symbols by default. This then leads to an error return code and output to stdout about relocatable symbols that can not be stripped. OSX strip will with default options attempt to strip everything but will always refuse to strip relocatable symbols and reports these as an error.

The result is any object file with relocatable symbols will error on install with the OSX defaults.

If strip is run with the `-u` and `-r` flags on OSX, keep global and relocatable symbols, the strip command runs fine and just strips local symbols.

Strip however is never called directly, so there is no easy way to supply the flags. Instead the -s option is passed to `install`, and `install` execs strip when installing the file.

Looking at pkgsrc, implementing a wrapper for strip might be a solution so we can fudge the correct flags when strip is called on OSX ? Im unfamiliar with the internals of pkgsrc so unsure if that is the purpose of wrappers of if this is ultimately a good solution.

Personally I would vote that the default on OSX is changed to INSTALL_UNSTRIPPED. As the symbols are useful for debugging anyway, packages won't hit this issue in the future, and this is simpler than implementing a wrapper.



Jonathan Perkin  -  Joyent, Inc.  -

Home | Main Index | Thread Index | Old Index