From be44ee078fa5d5470dddd097db0d97fadfc754ff Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 11 Feb 2015 16:19:32 +0200 Subject: Update Mac OS X binary build --- binary/darwin/NOTES | 14 +++++---- binary/darwin/build-dist | 18 +++++------ binary/darwin/build-gcc | 17 ++++++---- binary/darwin/gcc-4.5.1-plugin-support.patch | 46 ---------------------------- binary/darwin/gcc-configure | 13 ++++---- binary/darwin/libcutl-configure | 11 ++----- binary/darwin/odb-configure | 9 +++--- binary/darwin/test/clang-cxx11 | 30 ++++++++++++++++++ 8 files changed, 69 insertions(+), 89 deletions(-) delete mode 100644 binary/darwin/gcc-4.5.1-plugin-support.patch create mode 100644 binary/darwin/test/clang-cxx11 (limited to 'binary') diff --git a/binary/darwin/NOTES b/binary/darwin/NOTES index bc3fd87..c035d4c 100644 --- a/binary/darwin/NOTES +++ b/binary/darwin/NOTES @@ -1,8 +1,10 @@ -* Newer versions of GCC (e.g., 4.7.3) support plugins on OS X out of the - box, so no patch is necessary. +* -fno-devirtualize GCC 4.9.x ICE workaround. -* Have to use previous GCC build (4.5.1) for libcutl/ODB compilation because - of some problems 4.7.3 has with older as. See build-dist PATH settings. +* GCC builds itself 64-bit for some reason. Probably because I don't specify + target and by default it is now 64-bit? I suspect that if I specify the + x86_64-apple-darwin10 target, then it will default to 64-bit target? + Probably will be switching to x86_64-apple-darwin10-only target in the + next release. - Because of that, we have to manually add 4.7.3 plugin headers to CPPFLAGS - (see odb-configure). +* Using lipo to merge libstdc++ so that standard ODB "relative library path" + mechanism works. diff --git a/binary/darwin/build-dist b/binary/darwin/build-dist index ccbe0a7..434ba82 100755 --- a/binary/darwin/build-dist +++ b/binary/darwin/build-dist @@ -14,7 +14,7 @@ function error () rebuild=n -arch=i686-apple-darwin8 +arch=i686-apple-darwin10 rebuild=n while [ $# -gt 0 ]; do @@ -44,9 +44,7 @@ mver=`echo $over | sed -e 's%\([0-9]*\.[0-9]*\).*%\1%'` install_root="/tmp/odb-$over-$cpu-macosx" -# Using older version of GCC (newer one have trouble with old as). -# -export PATH=/$arch-4.5.1/bin:$PATH +export PATH=/$arch/bin:$PATH # Clean everything up if we are rebuilding. # @@ -95,7 +93,7 @@ if [ $rebuild = y ]; then ../libcutl-configure fi -make +make -j 4 cd .. # Build odb plugin @@ -106,7 +104,7 @@ if [ $rebuild = y ]; then ../odb-configure p $arch $install_root fi -make +make -j 2 make install-strip cd .. @@ -118,7 +116,7 @@ if [ $rebuild = y ]; then ../odb-configure d $arch $install_root fi -make -C odb odb +make -j 2 -C odb odb cp odb/odb $install_root/bin/ cd .. @@ -130,7 +128,7 @@ if [ $rebuild = y ]; then ../libodb-configure $install_root/lib/odb/$arch fi -make +make -j 4 cd odb make install-data cd ../.. @@ -143,7 +141,7 @@ if [ $rebuild = y ]; then ../libodb-boost-configure $install_root/lib/odb/$arch fi -make +make -j 4 make install-data cd .. @@ -155,7 +153,7 @@ if [ $rebuild = y ]; then ../libodb-qt-configure $install_root/lib/odb/$arch fi -make +make -j 4 make install-data cd .. diff --git a/binary/darwin/build-gcc b/binary/darwin/build-gcc index 93ffb41..874ad9d 100755 --- a/binary/darwin/build-gcc +++ b/binary/darwin/build-gcc @@ -12,7 +12,7 @@ function error () echo "$*" 1>&2 } -arch=i686-apple-darwin8 +arch=i686-apple-darwin10 rebuild=n while [ $# -gt 0 ]; do @@ -37,10 +37,6 @@ out_root=`pwd` mkdir -p gcc-build -# Need gcc-4.2. -# -export PATH=/usr/local/bin:$PATH - # Clean everything up if we are rebuilding. # if [ $rebuild = y ]; then @@ -62,4 +58,13 @@ make -C $arch/libstdc++-v3 install-strip cd .. -#cp ../gcc/gcc/config/darwin-sections.def /$arch/lib/gcc/$arch/4.5.1/plugin/include/ +# Make a fat binary for libstdc++ (libgcc_s already seems to be fat). +# +cd /$arch/lib +mkdir -p i386 +mv libstdc++.6.dylib i386/ +lipo -create i386/libstdc++.6.dylib x86_64/libstdc++.6.dylib -output libstdc++.6.dylib + +# Clean it up a bit. +# +rm -f /$arch/bin/$arch-* diff --git a/binary/darwin/gcc-4.5.1-plugin-support.patch b/binary/darwin/gcc-4.5.1-plugin-support.patch deleted file mode 100644 index 9bd7c9f..0000000 --- a/binary/darwin/gcc-4.5.1-plugin-support.patch +++ /dev/null @@ -1,46 +0,0 @@ -Index: gcc/configure.ac -=================================================================== ---- gcc/configure.ac (revision 161355) -+++ gcc/configure.ac (working copy) -@@ -4544,15 +4544,23 @@ - pluginlibs= - if test x"$enable_plugin" = x"yes"; then - -+ case "${host}" in -+ *-*-darwin*) -+ export_sym_check="$gcc_cv_nm -g" -+ ;; -+ *) -+ export_sym_check="$gcc_cv_objdump -T" -+ ;; -+ esac - AC_MSG_CHECKING([for exported symbols]) - echo "int main() {return 0;} int foobar() {return 0;}" > conftest.c - ${CC} ${CFLAGS} ${LDFLAGS} conftest.c -o conftest > /dev/null 2>&1 -- if $gcc_cv_objdump -T conftest | grep foobar > /dev/null; then -+ if $export_sym_check conftest | grep foobar > /dev/null; then - : # No need to use a flag - else - AC_MSG_CHECKING([for -rdynamic]) - ${CC} ${CFLAGS} ${LDFLAGS} -rdynamic conftest.c -o conftest > /dev/null 2>&1 -- if $gcc_cv_objdump -T conftest | grep foobar > /dev/null; then -+ if $export_sym_check conftest | grep foobar > /dev/null; then - plugin_rdynamic=yes - pluginlibs="-rdynamic" - else -@@ -4572,7 +4580,14 @@ - - # Check that we can build shared objects with -fPIC -shared - saved_LDFLAGS="$LDFLAGS" -- LDFLAGS="$LDFLAGS -fPIC -shared" -+ case "${host}" in -+ *-*-darwin*) -+ LDFLAGS="$LDFLAGS -fPIC -shared -undefined dynamic_lookup" -+ ;; -+ *) -+ LDFLAGS="$LDFLAGS -fPIC -shared" -+ ;; -+ esac - AC_MSG_CHECKING([for -fPIC -shared]) - AC_TRY_LINK( - [extern int X;],[return X == 0;], diff --git a/binary/darwin/gcc-configure b/binary/darwin/gcc-configure index fe758e3..a7e324d 100755 --- a/binary/darwin/gcc-configure +++ b/binary/darwin/gcc-configure @@ -1,15 +1,17 @@ #! /bin/sh -../../gcc/configure \ +../gcc/configure \ --disable-bootstrap \ --enable-languages=c,c++ \ ---disable-multiarch \ +--enable-multiarch \ +--enable-targets=i386,x86_64 \ +--enable-multilib \ --enable-shared \ --disable-libssp \ --disable-libgomp \ --disable-nls \ ---disable-multilib \ --disable-libstdcxx-pch \ +--disable-libstdcxx-debug \ --prefix=/$1 \ --enable-plugin \ --build=$1 \ @@ -17,8 +19,5 @@ --target=$1 \ --enable-cxx-flags=-fPIC \ CFLAGS=-O2 CXXFLAGS=-O2 \ -CFLAGS_FOR_TARGET="-O2 -fno-common" CXXFLAGS_FOR_TARGET="-O2 -fno-common" \ +CFLAGS_FOR_TARGET="-O2" CXXFLAGS_FOR_TARGET="-O2" \ CC=gcc-4.2 CXX=g++-4.2 - - -# LDFLAGS="-s" -s interferes with plugin test diff --git a/binary/darwin/libcutl-configure b/binary/darwin/libcutl-configure index 621d50b..315897b 100755 --- a/binary/darwin/libcutl-configure +++ b/binary/darwin/libcutl-configure @@ -1,14 +1,7 @@ #! /bin/sh -libcxx=`g++ --print-file-name libstdc++.a` -libgcc=`g++ --print-file-name libgcc.a` -libgcc_eh=`g++ --print-file-name libgcc_eh.a` - ./configure \ --disable-shared \ --with-pic \ -CC="gcc -nodefaultlibs" \ -CFLAGS=-O2 \ -CXX="g++ -nodefaultlibs" \ -CXXFLAGS=-O2 \ -LIBS="$libcxx $libgcc $libgcc_eh -lSystem" +CFLAGS="-m64 -O2" \ +CXXFLAGS="-m64 -O2" diff --git a/binary/darwin/odb-configure b/binary/darwin/odb-configure index b199f2f..0e8af7c 100755 --- a/binary/darwin/odb-configure +++ b/binary/darwin/odb-configure @@ -1,9 +1,9 @@ #! /bin/sh if test "$1" = "d"; then - libcxx=`g++ --print-file-name libstdc++.a` - libgcc=`g++ --print-file-name libgcc.a` - libgcc_eh=`g++ --print-file-name libgcc_eh.a` + libcxx=`g++ -m64 --print-file-name libstdc++.a` + libgcc=`g++ -m64 --print-file-name libgcc.a` + libgcc_eh=`g++ -m64 --print-file-name libgcc_eh.a` cxx="g++ -nodefaultlibs" libs="$libcxx $libgcc $libgcc_eh -lSystem" @@ -19,5 +19,4 @@ fi --with-options-file=../etc/odb/default.options \ --prefix=$3 \ --libexecdir=$3/lib \ -CXX="$cxx" CXXFLAGS=-O2 LIBS="$libs" \ -CPPFLAGS="-I`/$2/bin/g++ --print-file-name plugin`/include" +CXX="$cxx" LIBS="$libs" CXXFLAGS="-m64 -O2 -fno-devirtualize" diff --git a/binary/darwin/test/clang-cxx11 b/binary/darwin/test/clang-cxx11 new file mode 100644 index 0000000..a365a76 --- /dev/null +++ b/binary/darwin/test/clang-cxx11 @@ -0,0 +1,30 @@ +SQLITE=$HOME/sqlite +MYSQL=$HOME/mysqlclient-5.1.51-osx10.4-i686 +PGSQL=$HOME/pgsql-8.4.8 +ORACLE=$HOME/oracle + +sqlite_build_options= +sqlite_use_options= + +mysql_build_options= +mysql_use_options="--with-mysql-host=192.168.0.2 --with-mysql-client=$MYSQL/bin/mysql" + +pgsql_build_options= +pgsql_use_options="--with-pgsql-host=192.168.0.2 --with-pgsql-client=$PGSQL/bin/psql" + +oracle_build_options="--with-oci=$ORACLE" +oracle_use_options="--with-oracle-host=192.168.0.2 --with-oracle-service=xe --with-oracle-client=$ORACLE/sqlplus" + +with_qt=n +with_boost=n + +CC=clang +CXX=clang++ +CPPFLAGS="-I$SQLITE -I$MYSQL/include -I$PGSQL/include" +CXXFLAGS="-m32 -std=c++11 -O2 -W -Wall -Wno-unknown-pragmas" +LDFLAGS="-m32 -L$SQLITE -L$MYSQL/lib -L$PGSQL/lib" + +export DYLD_LIBRARY_PATH=$SQLITE:$DYLD_LIBRARY_PATH +export DYLD_LIBRARY_PATH=$MYSQL/lib:$DYLD_LIBRARY_PATH +export DYLD_LIBRARY_PATH=$PGSQL/lib:$DYLD_LIBRARY_PATH +export DYLD_LIBRARY_PATH=$ORACLE:$DYLD_LIBRARY_PATH -- cgit v1.1