Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-04-11 03:21:37


On Monday 10 April 2006 23:14, Doug Gregor wrote:
> The Darwin linker on Mac OS 10.4.x mangles executables when the "-s"
> option is used to strip out debugging symbols. The result is an
> executable that always fails like this:
>
> # Getting test case results out of "/Volumes/scratch/dgregor/
> BoostRegressionTesting/results/bjam.log"...
> dyld: lazy symbol binding failed: lazy pointer not found
> dyld: lazy pointer not found
>
> The fix is quite trivial: use the separate "strip" program instead of
> tacking the "-s" option onto the linker command line. The following
> simple patch makes this change. With it, I'm able to build a proper
> process_jam_log and, with any luck, get regression tests up and
> running for Mac OS X with BBv2.

Hi Doug,

there's something wrong with darwin.jam indeed. The comment in gcc.jam, rule
init-link-flags says that -s will only work if the application is linked
statically, however darwing.jam passes -s without -static. And anyway,
unconditionally using -static is not a good idea.

I have applied a modificaton of your patch, that uses conditional inside
Boost.Build to decide if strip command should be invoked, as opposed to
conditional in shell command.

BTW, do you know if this behaviour of "-s" is a bug in Darwin tools, or
there's some explanation?

The patch as I've committed follows, let me know if this works for you -- I've
did some "bjam -n" testing but can't be 100% sure without real OSX.

Thanks,
Volodya

RCS file: /cvsroot/boost/boost/tools/build/v2/tools/darwin.jam,v
retrieving revision 1.18
diff -u -r1.18 darwin.jam
--- darwin.jam 21 Feb 2006 08:18:22 -0000 1.18
+++ darwin.jam 11 Apr 2006 06:11:46 -0000
@@ -39,6 +39,8 @@
     }

     gcc.init-link-flags darwin darwin $(condition) ;
+
+ flags darwin.link NEED_STRIP $(condition)/<debug-symbols>off : "" ;
 }

 feature framework : : free ;
@@ -56,7 +58,8 @@

 actions link bind LIBRARIES
 {
- $(CONFIG_COMMAND) $(ST_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)"
"$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK)
$(OPTIONS)
+ $(CONFIG_COMMAND) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)"
-l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK) $(OPTIONS)
+ $(NEED_STRIP)strip $(NEED_STRIP)"$(<)"
 }

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build V2: http://boost.org/boost-build2

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk