[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apr-dev
Subject:    Configure Support for Mac Universal Builds
From:       "Jeremy Whitlock" <jcscoobyrs () gmail ! com>
Date:       2007-04-23 22:58:53
Message-ID: f16625f20704231558l126a1670y95c85a5816523b9a () mail ! gmail ! com
[Download RAW message or body]

Hi All,
    In my quest to build a Universal binary of Subversion I have found an
issue with apr-util not handling LDFLAGS settings properly.  To explain,
let's look at my problem.  When I use the following configure script call,
not all of the linker flags are being passed:

./configure --prefix=/Users/jwhitlock/dev/subversion_binary/binary/apr-util
--with-apr=/Users/jwhitlock/dev/subversion_binary/binary/apr
--with-berkeley-db=/Users/jwhitlock/dev/subversion_binary/binary/bdb
--without-pgsql --without-sqlite3 --without-sqlite2
--disable-dependency-tracking CFLAGS="-O -g -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"

What happens is the "-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" flags
are not passed and I get the following error:

ld: Undefined symbols:
_fegetround referenced from libSystem expected to be defined in
/usr/lib/system/libmathCommon.A.dylib
/usr/bin/libtool: internal link edit command failed
lipo: can't figure out the architecture type of: /var/tmp//ccPKIOat.out
make[1]: *** [libaprutil-1.la] Error 1
make: *** [all-recursive] Error 1

To prove my theory, here is the problematic libtool call:

/bin/sh /Users/jwhitlock/dev/subversion_binary/binary/apr/build-1/libtool
--silent --mode=link  gcc   -O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-arch i386 -arch ppc -DHAVE_CONFIG_H -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK
-no-cpp-precomp   -I/Users/jwhitlock/dev/subversion_binary/sources/httpd-
2.2.4/srclib/apr-util/include
-I/Users/jwhitlock/dev/subversion_binary/sources/httpd-2.2.4/srclib/apr-util/include/private
                
-I/Users/jwhitlock/dev/subversion_binary/binary/apr/include/apr-1
-I/Users/jwhitlock/dev/subversion_binary/binary/bdb/include
-I/Users/jwhitlock/dev/subversion_binary/sources/httpd-2.2.4/srclib/apr-util/xml/expat/lib
                
-version-info 2:8:2   -arch i386 -arch ppc -o libaprutil-1.la -rpath
/Users/jwhitlock/dev/subversion_binary/binary/apr-util/lib
buckets/apr_buckets_pipe.lo buckets/apr_buckets_flush.lo
buckets/apr_buckets_alloc.lo buckets/apr_buckets_pool.lo
buckets/apr_buckets_socket.lo buckets/apr_buckets_heap.lo
buckets/apr_buckets_simple.lo buckets/apr_buckets_file.lo
buckets/apr_buckets.lo buckets/apr_buckets_mmap.lo
buckets/apr_buckets_eos.lo buckets/apr_brigade.lo
buckets/apr_buckets_refcount.lo crypto/apr_sha1.lo crypto/uuid.lo
crypto/getuuid.lo crypto/apr_md5.lo crypto/apr_md4.lo dbm/apr_dbm.lo
dbm/apr_dbm_berkeleydb.lo dbm/apr_dbm_gdbm.lo dbm/apr_dbm_ndbm.lo
dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm_pair.lo dbm/sdbm/sdbm.lo
dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo encoding/apr_base64.lo
hooks/apr_hooks.lo ldap/apr_ldap_url.lo ldap/apr_ldap_option.lo
ldap/apr_ldap_init.lo misc/apr_reslist.lo misc/apu_version.lo
misc/apr_date.lo misc/apr_rmm.lo misc/apr_queue.lo uri/apr_uri.lo
xml/apr_xml.lo strmatch/apr_strmatch.lo xlate/xlate.lo dbd/apr_dbd.lo
dbd/apr_dbd_sqlite2.lo dbd/apr_dbd_sqlite3.lo dbd/apr_dbd_pgsql.lo
-lpthread -L/Users/jwhitlock/dev/subversion_binary/binary/bdb/lib
-L/Users/jwhitlock/dev/subversion_binary/sources/httpd-2.2.4/srclib/apr-util/xml/expat/lib
                
-ldb-4.5 /Users/jwhitlock/dev/subversion_binary/sources/httpd-2.2.4/srclib/apr-util/xml/expat/lib/libexpat.la
                
-liconv /Users/jwhitlock/dev/subversion_binary/binary/apr/lib/libapr-1.la-lpthread

When I add the missing libtool flags to the end of the libtool call above,
apr-util links properly as a universal library.  The better way to do this
is to update the Makefile and append the missing flags to the
APRUTIL_LDFLAGS.

Now that we are on the same page, how does one verify that this worthy of a
bug report or feature request?  I really think this should be documented
since it appears that the LDFLAGS passed to configure, or as an environment
variable for that matter, are disregarded.  Where do we go from here?

Take care,

Jeremy


[Attachment #3 (text/html)]

Hi All,<br>&nbsp;&nbsp;&nbsp; In my quest to build a Universal binary of Subversion I \
have found an issue with apr-util not handling LDFLAGS settings properly.&nbsp; To \
explain, let&#39;s look at my problem.&nbsp; When I use the following configure \
script call, not all of the linker flags are being passed: <br><br>./configure \
--prefix=/Users/jwhitlock/dev/subversion_binary/binary/apr-util \
--with-apr=/Users/jwhitlock/dev/subversion_binary/binary/apr \
--with-berkeley-db=/Users/jwhitlock/dev/subversion_binary/binary/bdb --without-pgsql \
--without-sqlite3 --without-sqlite2 --disable-dependency-tracking CFLAGS=&quot;-O -g \
-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc&quot; \
LDFLAGS=&quot;-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk&quot; <br><br>What \
happens is the &quot;-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk&quot; flags are \
not passed and I get the following error:<br><br>ld: Undefined \
symbols:<br>_fegetround referenced from libSystem expected to be defined in \
/usr/lib/system/libmathCommon.A.dylib <br>/usr/bin/libtool: internal link edit \
command failed<br>lipo: can&#39;t figure out the architecture type of: \
/var/tmp//ccPKIOat.out<br>make[1]: *** [<a \
href="http://libaprutil-1.la">libaprutil-1.la</a>] Error 1<br>make: *** \
[all-recursive] Error 1 <br><br>To prove my theory, here is the problematic libtool \
call:<br><br>/bin/sh \
/Users/jwhitlock/dev/subversion_binary/binary/apr/build-1/libtool --silent \
--mode=link&nbsp; gcc&nbsp;&nbsp; -O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-arch i386 -arch ppc -DHAVE_CONFIG_H -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK \
-no-cpp-precomp&nbsp;&nbsp; -I/Users/jwhitlock/dev/subversion_binary/sources/httpd- \
2.2.4/srclib/apr-util/include \
-I/Users/jwhitlock/dev/subversion_binary/sources/httpd-2.2.4/srclib/apr-util/include/private&nbsp; \
-I/Users/jwhitlock/dev/subversion_binary/binary/apr/include/apr-1&nbsp; \
-I/Users/jwhitlock/dev/subversion_binary/binary/bdb/include \
-I/Users/jwhitlock/dev/subversion_binary/sources/httpd- \
2.2.4/srclib/apr-util/xml/expat/lib&nbsp; -version-info 2:8:2&nbsp;&nbsp; -arch i386 \
-arch ppc -o <a href="http://libaprutil-1.la">libaprutil-1.la</a> -rpath \
/Users/jwhitlock/dev/subversion_binary/binary/apr-util/lib \
buckets/apr_buckets_pipe.lo buckets/apr_buckets_flush.lo buckets/apr_buckets_alloc.lo \
buckets/apr_buckets_pool.lo buckets/apr_buckets_socket.lo buckets/apr_buckets_heap.lo \
buckets/apr_buckets_simple.lo buckets/apr_buckets_file.lo buckets/apr_buckets.lo \
buckets/apr_buckets_mmap.lo buckets/apr_buckets_eos.lo buckets/apr_brigade.lo \
buckets/apr_buckets_refcount.lo crypto/apr_sha1.lo crypto/uuid.lo crypto/getuuid.lo \
crypto/apr_md5.lo crypto/apr_md4.lo dbm/apr_dbm.lo dbm/apr_dbm_berkeleydb.lo \
dbm/apr_dbm_gdbm.lo dbm/apr_dbm_ndbm.lo dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm_pair.lo \
dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo encoding/apr_base64.lo \
hooks/apr_hooks.lo ldap/apr_ldap_url.lo ldap/apr_ldap_option.lo ldap/apr_ldap_init.lo \
misc/apr_reslist.lo misc/apu_version.lo misc/apr_date.lo misc/apr_rmm.lo \
misc/apr_queue.lo uri/apr_uri.lo xml/apr_xml.lo strmatch/apr_strmatch.lo \
xlate/xlate.lo dbd/apr_dbd.lo dbd/apr_dbd_sqlite2.lo dbd/apr_dbd_sqlite3.lo \
dbd/apr_dbd_pgsql.lo&nbsp;&nbsp; -lpthread \
-L/Users/jwhitlock/dev/subversion_binary/binary/bdb/lib \
-L/Users/jwhitlock/dev/subversion_binary/sources/httpd- \
2.2.4/srclib/apr-util/xml/expat/lib -ldb-4.5 \
/Users/jwhitlock/dev/subversion_binary/sources/httpd-2.2.4/srclib/apr-util/xml/expat/lib/libexpat.la \
-liconv /Users/jwhitlock/dev/subversion_binary/binary/apr/lib/libapr-<a \
href="http://1.la"> 1.la</a> -lpthread<br><br>When I add the missing libtool flags to \
the end of the libtool call above, apr-util links properly as a universal \
library.&nbsp; The better way to do this is to update the Makefile and append the \
missing flags to the APRUTIL_LDFLAGS. <br><br>Now that we are on the same page, how \
does one verify that this worthy of a bug report or feature request?&nbsp; I really \
think this should be documented since it appears that the LDFLAGS passed to \
configure, or as an environment variable for that matter, are disregarded.&nbsp; \
Where do we go from here? <br><br>Take care,<br><br>Jeremy<br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic