Bug 14260 - apple ld doesn't support -z
Summary: apple ld doesn't support -z
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: All Mac OS X (All)
: low normal
Assignee: Havoc Pennington
QA Contact: John (J5) Palmieri
URL:
Whiteboard:
Keywords:
: 14625 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-26 12:02 UTC by Benjamin Reed
Modified: 2008-03-04 10:20 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Fix GNU ld assumption (1.14 KB, patch)
2008-01-26 12:02 UTC, Benjamin Reed
Details | Splinter Review
various Mac OS X build fixes (1.89 KB, patch)
2008-01-28 10:27 UTC, Benjamin Reed
Details | Splinter Review

Description Benjamin Reed 2008-01-26 12:02:08 UTC
Created attachment 13960 [details] [review]
Fix GNU ld assumption

since dbus 1.0 some LDFLAGS have changed in dbus, and as such, ./configure no longer passes on Mac OS X.

This patch wraps the -z option in a check for with_gnu_ld.
Comment 1 Benjamin Reed 2008-01-28 10:27:11 UTC
Created attachment 13992 [details] [review]
various Mac OS X build fixes

fix the GNU ld issue from the previous patch, also include the _NSGetEnviron fix for using *environ which had accidentally snuck into my launchd patches for bug #14259 instead.
Comment 2 Colin Walters 2008-02-12 20:13:27 UTC
First part of the patch looks fine.  

As for the second part - is it really that gross? =)  

Do you have any references offhand for other projects which have a similar configure.in construct?
Comment 3 Benjamin Reed 2008-02-13 05:07:58 UTC
Yes, it really is.  :P

_environ as a symbol only exists at runtime (it's part of the crt0.o that's linked into executables) so unless you want to link without resolving all symbols (which is discouraged on OSX) it's the easiest way to add emulation for the way the rest of the world uses *environ.

If you google around for _NSGetEnviron you get a lot of hits for this same bit of code, it's pretty much the standard way folks do this on OSX now.

http://www.open-mpi.org/community/lists/devel/2007/05/1593.php
http://www.mail-archive.com/fink-commits@lists.sourceforge.net/msg54196.html
http://www.cocoabuilder.com/archive/message/xcode/2006/5/2/6095

...and so on.
Comment 4 John (J5) Palmieri 2008-02-28 08:27:31 UTC
looks good for inclusion in the next point release.
Comment 5 John (J5) Palmieri 2008-03-04 07:27:26 UTC
*** Bug 14625 has been marked as a duplicate of this bug. ***
Comment 6 John (J5) Palmieri 2008-03-04 08:13:07 UTC
something is wrong with the with_gnu_ld check on my version of autoconf.  It
only evaluates to 'yes' if I pass --with-gnu-ld to configure.  The strange
thing is it sets with_gnu_ld=$lt_cv_prog_gnu_ld in configure (I verified both
are set with an echo) but if I echo $with_gnu_ld at the spot you make the check
$lt_cv_prog_gnu_ld=yes but $with_gnu_ld evaluates to an empty string. Doing
more checking
Comment 7 John (J5) Palmieri 2008-03-04 10:10:33 UTC
Figured it out.  AM_PROG_LIBTOOL moved to the top.  And I made the test more robust to actually check if the flag works not if we are using the GNU linker. Please check latest git on OS X and close this bug if fixed.

Comment 8 Benjamin Reed 2008-03-04 10:20:03 UTC
Yeah, the new tests work great, and make finished:

checking whether /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld supports "-z,relro"... no

Thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.