On 11/19/2014 01:04 PM, Qianqian Fang wrote:
hi list
I have been compiling a binary with static linking (-static,
-static-libgcc) to
enable wide deployment without worrying about library dependencies.
This has been working well for me for all platforms (Linux, Mac &
Windows), until the roll-out of OSX Yosemite. Users of my binaries
received "Cannot enforce a hard page-zero" error on Yosemite, and
the process got killed. A more expanded discussion can be found here
never mind. it turned out it was not gcc/g++'s fault. I used UPX to
compress the binaries after the compilation, it was UPX that striped
the __PAGEZERO segment. after decompressing the binary, it runs
fine on Yosemite. I filed a bug against UPX here:
http://sourceforge.net/p/upx/bugs/238/
Qianqian
https://www.marshut.net/kshmnx/statically-linked-binaries-killed-by-signal-9-on-yosemite.html
my questions are,
1) how can I add a hard page-zero segment to a statically
linked binary using gcc/g++?
2) what's the suggested best practices when deploying a binary
on a Mac (minimizing dependency hell while maximize
forward/backward OS compatibility)?
thanks for your feedback!
Qianqian