public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Re: Help with Building toolchain with crosstool-ng on Mac OS X 10.6.2   (Snow Leopard)
@ 2010-02-01  2:26 tvb377
  2010-02-02 15:18 ` Building toolchain with crosstool-ng on Mac OS X 10.6.2 (SL) - libtool error Uwe Papengut
  2010-02-02 18:16 ` Help with Building toolchain with crosstool-ng on Mac OS X 10.6.2 (Snow Leopard) Yann E. MORIN
  0 siblings, 2 replies; 4+ messages in thread
From: tvb377 @ 2010-02-01  2:26 UTC (permalink / raw)
  To: Yann E. MORIN, crossgcc; +Cc: uwe.papengut

[-- Attachment #1: Type: text/plain, Size: 2311 bytes --]

> > I recently made a patch for using crosstool-ng on mac and freebsd.
> > I will rework the cosmetics according to Yann's comments this month.
> 
> Titus, I think you are the one that can handle this stuff, as you have a

Uwe, Yann, all

here is the reworked patch for crosstool-ng on FreeBSD and MacOS against a current (31 January 23:00 CET) version.
And two new READMEs (instead of docs/MacOS-X.txt).

Almost all patch parts revolve around GNU/BSD incompatibilities.
I try to explain what I did:
- enlarge the list of configurable tools that ctng uses (for usage of GNU tools).
- also make sure that the configured tools actually get used.
- make all calls to stat(1) dependent to `uname -s` or replace the call.
- replace all calls to readlink(1GNU) with compatible variants.
  This makes the usage of wrapper.c mandatory on MacOS because there is no way known to me emulating readlink -m without a lengthy shell script.
- uname -o is not portable. use -s when -o fails
- a bug in the sed-expression that sets the nanoseconds to 0 for a date(1) not handling %N

Notable other reasons besides GNU/BSD are:
- have to compile mpfr with --disable-thread-safe on darwin.
- "You did not specify the build system. That's OK, I can guess...":
  Under MacOS 10.6 gcc reports itself as "i686-apple-..."
  However, it's default behaviour is to generate 64bit objects.
  This clashes with some configure scripts that require "x86_64-..." for configuring for a 64bit host.
  Using CT_DoConfigGuess does the job correctly.
  Why not use that in general?
BTW, the above two changes are the only changes actually for BUILDING the toolchain, and not for porting ctng itself.
- the compiler command line options for compiling wrapper.c crashes gcc on MacOS (and IMHO were a little bit overdone for the complexity of wrapper.c).
- you should not link statically on MacOS (wrapper.c command line again)
- under Darwin, use DYLD_LIBRARY_PATH in wrapper.c
- added printenv to the build.log (I found that helpful).

I can now compile gcc4.4.2 for powerpc for linux/glibc under Linux, BSD, and MacOS.
I only shortly grepped through scripts not necessary for this configuration, so more incompatibilities may arise. However, they should be easy to fix in this manner.

Hope this helps.
Further comments are welcome.

Regards
Titus

[-- Attachment #2: ct-ng-bsdpatch.txt --]
[-- Type: text/plain, Size: 11253 bytes --]

diff -r 160fc94ed49f Makefile.in
--- a/Makefile.in	Sun Jan 31 23:04:35 2010 +0100
+++ b/Makefile.in	Mon Feb 01 02:33:37 2010 +0100
@@ -52,6 +52,11 @@
 grep   := @@grep@@
 make   := @@make@@
 sed    := @@sed@@
+libtool:= @@libtool@@
+objcopy:= @@objcopy@@
+objdump:= @@objdump@@
+readelf:= @@readelf@@
+patch  := @@patch@@
 
 ###############################################################################
 # Sanity checks
@@ -139,6 +144,11 @@
 	  echo "export grep=$(grep)";       \
 	  echo "export make=$(make)";       \
 	  echo "export sed=$(sed)";         \
+	  echo "export libtool=$(libtool)"; \
+	  echo "export objcopy=$(objcopy)"; \
+	  echo "export objdump=$(objdump)"; \
+	  echo "export readelf=$(readelf)"; \
+	  echo "export patch=$(patch)";     \
 	 ) >paths.mk
 
 #--------------------------------------
diff -r 160fc94ed49f configure
--- a/configure	Sun Jan 31 23:04:35 2010 +0100
+++ b/configure	Mon Feb 01 02:33:37 2010 +0100
@@ -160,7 +160,7 @@
                 printf "Checking for '${item}'... "
                 where="$( gcc -print-file-name="${item}" )"
                 if [ "${where}" != "${item}" ]; then
-                    where="$( readlink -e "${where}" )"
+                    where="$( readlink "${where}" )"
                     status=yes
                     break;
                 fi
@@ -346,17 +346,17 @@
              ver='^GNU Make (3.[89][[:digit:]]|[4-9])'  \
              err="GNU 'make' 3.80 or above was not found"
 has_or_abort prog=gcc
-has_or_abort prog="awk gawk" ver='^GNU Awk' err="GNU 'awk' was not found"
+has_or_abort prog="gawk awk" ver='^GNU Awk' err="GNU 'awk' was not found"
 has_or_abort prog=bison
 has_or_abort prog=flex
 has_or_abort prog=makeinfo
 has_or_abort prog=automake                                                      \
              ver='\(GNU automake\) (1\.[[:digit:]]{2,}|[2-9][[:digit:]]*\.)'    \
              err="'automake' 1.10 or above was not found"
-has_or_abort prog=libtool                                                                           \
+has_or_abort prog=libtool var=libtool                                                               \
              ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)'   \
              err="'libtool' 1.5.26 or above was not found"
-has_or_abort prog=stat ver='GNU coreutils'
+has_or_abort prog=stat
 has_or_abort prog="aria2c curl wget"
 has_or_abort prog=cvs
 has_or_abort prog=patch
@@ -365,6 +365,10 @@
 has_or_abort prog=bzip2
 has_or_abort prog=lzma
 has_or_abort prog=readlink
+has_or_abort prog=objcopy var=objcopy
+has_or_abort prog=objdump var=objdump
+has_or_abort prog=readelf var=readelf
+has_or_abort prog=patch var=patch
 
 has_or_abort inc="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h"    \
              err="'ncurses' headers files were not found"
diff -r 160fc94ed49f samples/samples.mk
--- a/samples/samples.mk	Sun Jan 31 23:04:35 2010 +0100
+++ b/samples/samples.mk	Mon Feb 01 02:33:37 2010 +0100
@@ -5,10 +5,10 @@
 CT_TOP_SAMPLES := $(patsubst $(CT_TOP_DIR)/samples/%/crosstool.config,%,$(wildcard $(CT_TOP_DIR)/samples/*/crosstool.config))
 CT_LIB_SAMPLES := $(filter-out $(CT_TOP_SAMPLES),$(patsubst $(CT_LIB_DIR)/samples/%/crosstool.config,%,$(wildcard $(CT_LIB_DIR)/samples/*/crosstool.config)))
 CT_SAMPLES := $(shell echo $(sort $(CT_TOP_SAMPLES) $(CT_LIB_SAMPLES))  \
-                      |sed -r -e 's/ /\n/g;'                            \
-                      |sed -r -e 's/(.*),(.*)/\2,\1/;'                  \
+                      |$(sed) -r -e 's/ /\n/g;'                            \
+                      |$(sed) -r -e 's/(.*),(.*)/\2,\1/;'                  \
                       |LC_ALL=C sort                                    \
-                      |sed -r -e 's/(.*),(.*)/\2,\1/;'                  \
+                      |$(sed) -r -e 's/(.*),(.*)/\2,\1/;'                  \
                )
 
 # ----------------------------------------------------------
diff -r 160fc94ed49f scripts/build/companion_libs/mpfr.sh
--- a/scripts/build/companion_libs/mpfr.sh	Sun Jan 31 23:04:35 2010 +0100
+++ b/scripts/build/companion_libs/mpfr.sh	Mon Feb 01 02:33:37 2010 +0100
@@ -75,6 +75,7 @@
     case "${CT_HOST}" in
         *cygwin*)   mpfr_opt="--disable-thread-safe";;
         *mingw*)    mpfr_opt="--disable-thread-safe";;
+        *darwin*)   mpfr_opt="--disable-thread-safe";;
         *)          mpfr_opt="--enable-thread-safe";;
     esac
 
diff -r 160fc94ed49f scripts/build/internals.sh
--- a/scripts/build/internals.sh	Sun Jan 31 23:04:35 2010 +0100
+++ b/scripts/build/internals.sh	Mon Feb 01 02:33:37 2010 +0100
@@ -42,6 +42,11 @@
         CT_DoLog EXTRA "Installing toolchain wrappers"
         CT_Pushd "${CT_PREFIX_DIR}/bin"
 
+        if [ "$CT_SYS_OS" = "Darwin" -o "$CT_SYS_OS" = "FreeBSD" ] ; then
+            # wrapper does not work (when using readlink -m)
+            CT_DoLog EXTRA "Forcing usage of binary wrappers"
+            CT_TOOLS_WRAPPER="exec"
+        fi
         # Install the wrapper
         case "${CT_TOOLS_WRAPPER}" in
             script)
@@ -55,9 +60,8 @@
                 if [ "${CT_DEBUG_CT}" = "y" ]; then
                   _t="" # If debugging crosstool-NG, don't strip the wrapper
                 fi
-                CT_DoExecLog DEBUG "${CT_HOST}-gcc"                           \
-                                   -Wall -Wextra -Wunreachable-code -Werror   \
-                                   -O3 -static ${_t}                          \
+                CT_DoExecLog DEBUG "cc" -Wall -Wextra -Werror        \
+                                   -O -D$CT_SYS_OS ${_t}             \
                                    "${CT_LIB_DIR}/scripts/wrapper.c"          \
                                    -o ".${CT_TARGET}-wrapper"
                 ;;
@@ -68,7 +72,7 @@
         # scripts, we don't know if they would in the end spawn a binary...
         # Just skip symlinks
         for _t in "${CT_TARGET}-"*; do
-            if [ "$( LANG=C stat -c '%F' "${_t}" )" != "symbolic link" ]; then
+            if [ -z "`readlink ${_t}`" ]; then
                 CT_DoExecLog ALL mv "${_t}" ".${_t}"
                 CT_DoExecLog ALL ln ".${CT_TARGET}-wrapper" "${_t}"
             fi
diff -r 160fc94ed49f scripts/crosstool-NG.sh.in
--- a/scripts/crosstool-NG.sh.in	Sun Jan 31 23:04:35 2010 +0100
+++ b/scripts/crosstool-NG.sh.in	Mon Feb 01 02:33:37 2010 +0100
@@ -189,8 +189,8 @@
 CT_SYS_HOSTNAME="${CT_SYS_HOSTNAME:-$(uname -n)}"
 CT_SYS_KERNEL=$(uname -s)
 CT_SYS_REVISION=$(uname -r)
-# MacOS X lacks '-o' :
-CT_SYS_OS=$(uname -o || echo "Unknown (maybe MacOS-X)")
+# uname -o is a GNU Extension. Others lack '-o' --> use System name for OS name.
+CT_SYS_OS=$(uname -o || uname -s)
 CT_SYS_MACHINE=$(uname -m)
 CT_SYS_PROCESSOR=$(uname -p)
 CT_SYS_GCC=$(gcc -dumpversion)
@@ -326,7 +326,12 @@
     # Determine build system if not set by the user
     CT_Test "You did not specify the build system. That's OK, I can guess..." -z "${CT_BUILD}"
     case "${CT_BUILD}" in
-        "") CT_BUILD=$("${CT_BUILD_PREFIX}gcc${CT_BUILD_SUFFIX}" -dumpmachine);;
+        "") if [ "$CT_SYS_OS" = "Darwin" -o "$CT_SYS_OS" = "FreeBSD" ] ; then
+                CT_BUILD=$(CT_DoConfigGuess)
+            else
+                CT_BUILD=$("${CT_BUILD_PREFIX}gcc${CT_BUILD_SUFFIX}" -dumpmachine)
+            fi
+            ;;
     esac
 
     # Prepare mangling patterns to later modify BUILD and HOST (see below)
@@ -454,7 +459,7 @@
     CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/buildtools/makeinfo"
 
     # Help gcc
-    CT_CFLAGS_FOR_HOST=
+    # Why clear that ? CT_CFLAGS_FOR_HOST=
     [ "${CT_USE_PIPES}" = "y" ] && CT_CFLAGS_FOR_HOST="${CT_CFLAGS_FOR_HOST} -pipe"
 
     # Override the configured jobs with what's been given on the command line
@@ -474,7 +479,7 @@
     CT_DoLog EXTRA "Installing user-supplied crosstool-NG configuration"
     CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/bin"
     CT_DoExecLog DEBUG install -m 0755 "${CT_LIB_DIR}/scripts/toolchain-config.in" "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config"
-    CT_DoExecLog DEBUG sed -r -i -e 's,@@grep@@,"'"${grep}"'",;' "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config"
+    CT_DoExecLog DEBUG sed -i -e 's,@@grep@@,"'"${grep}"'",;' "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config"
     bzip2 -c -9 .config >>"${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config"
 
     CT_DoStep EXTRA "Dumping internal crosstool-NG configuration"
@@ -483,6 +488,8 @@
     CT_DoLog EXTRA "  host   = ${CT_REAL_HOST}"
     CT_DoLog EXTRA "  target = ${CT_TARGET}"
     set |grep -E '^CT_.+=' |sort |CT_DoLog DEBUG
+    CT_DoLog DEBUG "  Other environment:"
+    printenv |grep -v -E '^CT_.+=' |sort |CT_DoLog DEBUG
     CT_EndStep
 fi
 
diff -r 160fc94ed49f scripts/functions
--- a/scripts/functions	Sun Jan 31 23:04:35 2010 +0100
+++ b/scripts/functions	Mon Feb 01 02:33:37 2010 +0100
@@ -192,7 +192,7 @@
 # to the highest entire second
 # Usage: CT_DoDate <fmt>
 CT_DoDate() {
-    date "$1" |sed -r -e 's/%N$/000000000/;'
+    date "$1" |sed -r -e 's/N$/000000000/;'
 }
 
 CT_STEP_COUNT=1
@@ -249,7 +249,17 @@
     local mode
     for dir in "${@}"; do
         [ -d "${dir}" ] || continue
-        mode="$(stat -c '%a' "$(dirname "${dir}")")"
+        case "$CT_SYS_OS" in
+            GNU/Linux)
+                mode="$(stat -c '%a' "$(dirname "${dir}")")"
+                ;;
+            Darwin|FreeBSD)
+                mode="$(stat -f '%Lp' "$(dirname "${dir}")")"
+                ;;
+            *)
+                CT_Abort "Unhandled host OS $CT_SYS_OS"
+                ;;
+        esac
         CT_DoExecLog ALL chmod u+w "$(dirname "${dir}")"
         CT_DoExecLog ALL chmod -R u+w "${dir}"
         CT_DoExecLog ALL rm -rf "${dir}"
diff -r 160fc94ed49f scripts/wrapper.c
--- a/scripts/wrapper.c	Sun Jan 31 23:04:35 2010 +0100
+++ b/scripts/wrapper.c	Mon Feb 01 02:33:37 2010 +0100
@@ -7,6 +7,11 @@
 #include <unistd.h>
 #include <errno.h>
 
+#ifdef	Darwin
+static const char * ldlp = "DYLD_LIBRARY_PATH";
+#else
+static const char * ldlp = "LD_LIBRARY_PATH";
+#endif
 
 /* Needed for execve */
 extern char **environ;
@@ -106,7 +111,7 @@
 
   /* Now add the directory with our runtime libraries to the
      front of the library search path, LD_LIBRARY_PATH */
-  ldlibpath = getenv( "LD_LIBRARY_PATH" );
+  ldlibpath = getenv(ldlp);
   if( ldlibpath ) {
     basedir = (char*) realloc( basedir,   strlen( basedir )
                                         + strlen( ldlibpath )
@@ -115,7 +120,7 @@
     strcat( basedir, ldlibpath );
   }
 
-  if( setenv( "LD_LIBRARY_PATH", basedir, 1 ) ) {
+  if( setenv( ldlp, basedir, 1 ) ) {
     errno = ENOMEM;
     perror( "tool wrapper" );
     exit( 1 );
diff -r 160fc94ed49f scripts/wrapper.in
--- a/scripts/wrapper.in	Sun Jan 31 23:04:35 2010 +0100
+++ b/scripts/wrapper.in	Mon Feb 01 02:33:37 2010 +0100
@@ -1,5 +1,10 @@
 #!/bin/sh
 
+# this wrapper will not work under BSD systems or others
+# not containig the GNU readlink.
+# Under those, wrapper.c will forcibly be used
+# regardless of the config file setting.
+
 canonicalizedname=$(readlink -nm "${0}")
 dirname="$(dirname "${canonicalizedname}")"
 basename="$(basename "${canonicalizedname}")"

[-- Attachment #3: README.freebsd --]
[-- Type: application/octet-stream, Size: 517 bytes --]

20 January 2010 - Titus von Boxberg

General instructions for using ct-ng for building a cross toolchain on FreeBSD as host.

1)	Install (at least) the following ports
	archivers/lzma
	textproc/gsed
	devel/gmake
	devel/patch
	shells/bash
	devel/bison

2)	run ct-ng's configure with the following tool configuration:
	./configure --with-sed=/usr/local/bin/gsed --with-make=/usr/local/bin/gmake \
	--with-patch=/usr/local/bin/gpatch
	[...other configure parameters...]

3)	proceed as described in general documentation

[-- Attachment #4: README.macos --]
[-- Type: application/octet-stream, Size: 1287 bytes --]

01 February 2010 - Titus

*General* instructions for using ct-ng for building a cross toolchain on MacOS as host.

0)	Mac OS Snow Leopard, with Developer Tools 3.2 installed, or
	Mac OS Leopard, with Developer Tools & newer gcc (>= 4.3) installed via macports

1)	Install macports (or similar easy means of installing 3rd party software),
	make sure that macport's bin dir is in your PATH. Furtheron assuming it is /opt/local/bin.

2)	Install the following macports
	lzmautils
	libtool
	binutils
	gsed
	gawk
	gcc43 (only necessary for Leopard OSX 10.5)

	On Leopard, make sure that the macport's gcc is called with the default commands
	(gcc, g++,...), e.g. via macport gcc_select

3)	run ct-ng's configure with the following tool configuration
	(assuming you have installed the tools via macports in /opt/local):
	./configure --with-sed=/opt/local/bin/gsed --with-libtool=/opt/local/bin/glibtool \
	--with-objcopy=/opt/local/bin/gobjcopy --with-objdump=/opt/local/bin/gobjdump \
	--with-readelf=/opt/local/bin/greadelf [...other configure parameters as you like...]

4)	You have to use a case sensitive file system for ct-ng's build and target directories.
	Use a disk or disk image with a case sensitive fs that you mount somewhere.

5)	proceed as described in standard documentation
	

[-- Attachment #5: Type: text/plain, Size: 71 bytes --]

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Building toolchain with crosstool-ng on Mac OS X 10.6.2 (SL) - libtool error
  2010-02-01  2:26 Help with Building toolchain with crosstool-ng on Mac OS X 10.6.2 (Snow Leopard) tvb377
@ 2010-02-02 15:18 ` Uwe Papengut
  2010-02-02 20:02   ` Titus von Boxberg
  2010-02-02 18:16 ` Help with Building toolchain with crosstool-ng on Mac OS X 10.6.2 (Snow Leopard) Yann E. MORIN
  1 sibling, 1 reply; 4+ messages in thread
From: Uwe Papengut @ 2010-02-02 15:18 UTC (permalink / raw)
  To: tvb377; +Cc: Yann E. MORIN, crossgcc

[-- Attachment #1: Type: text/plain, Size: 352 bytes --]

Hi Titus, Yann and all,

I wrote a short script for MacOS SL and crosstool-ng-1.6.0. I got an error with libtool, because the crosstool-ng/configure wrote:

  Checking for 'libtool'... no
  libtool 1.5.26 or above was not found

I used the newest version of libtool 2.2.6b_0. Script and log-file see attachment.

Can anyone please help me?


[-- Attachment #2: MacOS_SL --]
[-- Type: application/octet-stream, Size: 851 bytes --]

echo "1.Update Port."
echo "=============="
sudo port -v selfupdate
sudo port upgrade outdated
echo " "
echo "2. Change to Source-Directory."
echo "=============================="
cd /Users/uwepapengut/Desktop/Crosstool/crosstool-ng-1.6.0
echo " "
echo "3. Install ports crosstool-ng."
echo "==============================="
sudo port install lzmautils
sudo port install libtool
sudo port install binutils
sudo port install gsed
sudo port install gawk
echo " "
echo "4. Show versions."
echo "================="
port installed
echo " "
echo "5. Configure crosstool_ng."
echo "=========================="
./configure --prefix=/Users/uwepapengut/Desktop/Crosstool/XXX --with-sed=/opt/local/bin/gsed --with-libtool=/opt/local/bin/glibtool --with-objcopy=/opt/local/bin/gobjcopy --with-objdump=/opt/local/bin/gobjdump --with-readelf=/opt/local/bin/greadelf

[-- Attachment #3: MacOS_SL.log --]
[-- Type: application/octet-stream, Size: 2795 bytes --]

1.Update Port.
==============
--->  Updating the ports tree
Synchronizing local ports tree from rsync://rsync.macports.org/release/ports/
receiving file list ... done
archivers/lzmautils/
devel/binutils/
devel/libtool/
lang/gawk/
textproc/gsed/

sent 66 bytes  received 432006 bytes  66472.62 bytes/sec
total size is 28020898  speedup is 64.85
--->  Updating MacPorts base sources using rsync
receiving file list ... done

sent 36 bytes  received 6893 bytes  2771.60 bytes/sec
total size is 4023490  speedup is 580.67
MacPorts base version 1.8.2 installed,
MacPorts base version 1.8.2 downloaded.
--->  MacPorts base is already the latest version

The ports tree has been updated. To upgrade your installed ports, you should run
  port upgrade outdated
 
2. Change to Source-Directory.
==============================
 
3. Install ports crosstool-ng.
===============================
--->  Computing dependencies for lzmautils
--->  Cleaning lzmautils
--->  Computing dependencies for libtool
--->  Cleaning libtool
--->  Computing dependencies for binutils
--->  Cleaning binutils
--->  Computing dependencies for gsed
--->  Cleaning gsed
--->  Computing dependencies for gawk
--->  Cleaning gawk
 
4. Show versions.
=================
The following ports are currently installed:
  autoconf @2.65_0
  autoconf @2.65_1 (active)
  automake @1.11.1_0 (active)
  binutils @2.20_1 (active)
  expat @2.0.1_0 (active)
  gawk @3.1.7_0 (active)
  gettext @0.17_4 (active)
  gperf @3.0.4_0 (active)
  gsed @4.2.1_0 (active)
  help2man @1.37.1_1 (active)
  libiconv @1.13_0
  libiconv @1.13.1_0 (active)
  libidn @1.15_0 (active)
  libtool @2.2.6b_0 (active)
  lzmautils @4.32.7_1 (active)
  m4 @1.4.13_0 (active)
  ncurses @5.7_0+darwin_10 (active)
  ncursesw @5.7_0+darwin_10 (active)
  openssl @0.9.8l_0+darwin (active)
  p5-locale-gettext @1.05_0
  p5-locale-gettext @1.05_2 (active)
  perl5 @5.8.9_0 (active)
  perl5.8 @5.8.9_3 (active)
  wget @1.12_0 (active)
  zlib @1.2.3_3
  zlib @1.2.3_4 (active)
 
5. Configure crosstool_ng.
==========================
Checking for 'grep'... /usr/bin/grep
Checking whether '/usr/bin/grep' supports -E... yes
Checking for 'sed'... /opt/local/bin/gsed (cached)
Checking for 'bash'... /bin/bash
Checking for 'cut'... /usr/bin/cut
Checking for 'install'... /usr/bin/install
Checking for 'make'... /usr/bin/make
Checking for 'gcc'... /usr/bin/gcc
Checking for 'awk'... no
Checking for 'gawk'... /opt/local/bin/gawk
Checking for 'bison'... /usr/bin/bison
Checking for 'flex'... /usr/bin/flex
Checking for 'makeinfo'... /usr/bin/makeinfo
Checking for 'automake'... /opt/local/bin/automake
Checking for 'libtool'... no

libtool 1.5.26 or above was not found

Either you are missing entirely the needed tool,
or the version you have is too old.

configure: Bailing out...

[-- Attachment #4: Type: text/plain, Size: 2578 bytes --]



Best Regards,
Uwe




Am 01.02.2010 um 03:25 schrieb tvb377@gmx.de:

>>> I recently made a patch for using crosstool-ng on mac and freebsd.
>>> I will rework the cosmetics according to Yann's comments this month.
>> 
>> Titus, I think you are the one that can handle this stuff, as you have a
> 
> Uwe, Yann, all
> 
> here is the reworked patch for crosstool-ng on FreeBSD and MacOS against a current (31 January 23:00 CET) version.
> And two new READMEs (instead of docs/MacOS-X.txt).
> 
> Almost all patch parts revolve around GNU/BSD incompatibilities.
> I try to explain what I did:
> - enlarge the list of configurable tools that ctng uses (for usage of GNU tools).
> - also make sure that the configured tools actually get used.
> - make all calls to stat(1) dependent to `uname -s` or replace the call.
> - replace all calls to readlink(1GNU) with compatible variants.
>  This makes the usage of wrapper.c mandatory on MacOS because there is no way known to me emulating readlink -m without a lengthy shell script.
> - uname -o is not portable. use -s when -o fails
> - a bug in the sed-expression that sets the nanoseconds to 0 for a date(1) not handling %N
> 
> Notable other reasons besides GNU/BSD are:
> - have to compile mpfr with --disable-thread-safe on darwin.
> - "You did not specify the build system. That's OK, I can guess...":
>  Under MacOS 10.6 gcc reports itself as "i686-apple-..."
>  However, it's default behaviour is to generate 64bit objects.
>  This clashes with some configure scripts that require "x86_64-..." for configuring for a 64bit host.
>  Using CT_DoConfigGuess does the job correctly.
>  Why not use that in general?
> BTW, the above two changes are the only changes actually for BUILDING the toolchain, and not for porting ctng itself.
> - the compiler command line options for compiling wrapper.c crashes gcc on MacOS (and IMHO were a little bit overdone for the complexity of wrapper.c).
> - you should not link statically on MacOS (wrapper.c command line again)
> - under Darwin, use DYLD_LIBRARY_PATH in wrapper.c
> - added printenv to the build.log (I found that helpful).
> 
> I can now compile gcc4.4.2 for powerpc for linux/glibc under Linux, BSD, and MacOS.
> I only shortly grepped through scripts not necessary for this configuration, so more incompatibilities may arise. However, they should be easy to fix in this manner.
> 
> Hope this helps.
> Further comments are welcome.
> 
> Regards
> Titus
> <ct-ng-bsdpatch.txt><README.freebsd><README.macos>










[-- Attachment #5: Type: text/plain, Size: 71 bytes --]

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Help with Building toolchain with crosstool-ng on Mac OS X 10.6.2  (Snow Leopard)
  2010-02-01  2:26 Help with Building toolchain with crosstool-ng on Mac OS X 10.6.2 (Snow Leopard) tvb377
  2010-02-02 15:18 ` Building toolchain with crosstool-ng on Mac OS X 10.6.2 (SL) - libtool error Uwe Papengut
@ 2010-02-02 18:16 ` Yann E. MORIN
  1 sibling, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2010-02-02 18:16 UTC (permalink / raw)
  To: tvb377; +Cc: crossgcc

Titus, All,

On Monday 01 February 2010 03:25:56 tvb377@gmx.de wrote:
> here is the reworked patch for crosstool-ng on FreeBSD and MacOS

This patch is still very large, and contains unrelated changes.
It is thus hard to see the implications of each change.

Please, split the patch into self-contained patches that each add a
single change, as I suggested ealier. For example:
- the sed->$(sed) change in samples.mk on its own
- the configure+Makefile.in changes into their own (one for libtool, one
  for objcopy, ...)
- one for Darwin/*BSD vs. GNU
- and so on...

Having each change in a separate patch will help with review. Small patches
(few-liners) will most probably pass in a blink of an eye. When they get
applied, they will each yield a new changeset in the tree, and that would
be easier to revert the one(s) that is(are) faulty without having to revert
the whole stuff.

Also, if you would provide mercurial patches, it would be easier to work
with. See docs/overview.txt, section "Contributing".

> And two new READMEs (instead of docs/MacOS-X.txt).

Good. :-)

> Almost all patch parts revolve around GNU/BSD incompatibilities.
> I try to explain what I did:
> - enlarge the list of configurable tools that ctng uses (for usage of
> GNU tools).
> - also make sure that the configured tools actually get used.

One patch per new tool, please. Also, be sure to see how it plays with
the companion tools that were recently added.

> - make all calls to stat(1) dependent to `uname -s` or replace the call.

One patch for that.

> - replace all calls to readlink(1GNU) with compatible variants.

"readlink -e" and "readlink" are not equivalent.

>   This makes the usage of wrapper.c mandatory on MacOS because there is
>   no way known to me emulating readlink -m without a lengthy shell script.

Separate patch for that.

> - uname -o is not portable. use -s when -o fails

Ditto.

> - a bug in the sed-expression that sets the nanoseconds to 0 for a
>   date(1) not handling %N

On my system (%Q is not recognised, so use that)
  > date +%Q
  %Q

So this change seems to imply that on MacOS-X or *BSD, we get:
  > date +%N
  N

Right?

> Notable other reasons besides GNU/BSD are:
> - have to compile mpfr with --disable-thread-safe on darwin.

Separate patch for that as well.

> - "You did not specify the build system. That's OK, I can guess...":
>   Under MacOS 10.6 gcc reports itself as "i686-apple-..."
>   However, it's default behaviour is to generate 64bit objects.
>   This clashes with some configure scripts that require "x86_64-..." for
>   configuring for a 64bit host.
>   Using CT_DoConfigGuess does the job correctly.
>   Why not use that in general?

Not reliable on my system:
  > config.guess
  x86_64-unknown-linux-gnu
  > gcc -dumpmachine
  x86_64-linux-gnu

And I have the tools for x86_64-linux-gnu-{gcc,ld,...}, but not the ones for
x86_64-unknown-linux-gnu-{gcc,ld,...}. So it is much more reliable to ask
gcc than to ask config.guess.

gcc -dumpmachine will tell us the tuple for which it was configured, and
that means the prefix to use to the actual tools, which is what we need.

> BTW, the above two changes are the only changes actually for BUILDING the
> toolchain, and not for porting ctng itself.
> - the compiler command line options for compiling wrapper.c crashes gcc
>   on MacOS (and IMHO were a little bit overdone for the complexity of
>   wrapper.c).

Separate patch for that.

> - you should not link statically on MacOS (wrapper.c command line again)

Statically linking should hopefully speed up things. Having a /slow/
wrapper is not very interesting, is it? Of course, the ratio
time-in-wrapper / (time-in-wrapper + time-in-actual-tool) should be
fairly small, except for very trivial programs, where the total time
will anyway be almost imperceptible...

> - under Darwin, use DYLD_LIBRARY_PATH in wrapper.c

Separate patch for that as well.

> - added printenv to the build.log (I found that helpful).

Separate patch.

> I can now compile gcc4.4.2 for powerpc for linux/glibc under Linux, BSD,
> and MacOS. I only shortly grepped through scripts not necessary for this
> configuration, so more incompatibilities may arise. However, they should
> be easy to fix in this manner.

Please, provide a split-up patchset as instructed above, and we'll be
able to easily review it.

Thank you! :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Building toolchain with crosstool-ng on Mac OS X 10.6.2 (SL) -  libtool error
  2010-02-02 15:18 ` Building toolchain with crosstool-ng on Mac OS X 10.6.2 (SL) - libtool error Uwe Papengut
@ 2010-02-02 20:02   ` Titus von Boxberg
  0 siblings, 0 replies; 4+ messages in thread
From: Titus von Boxberg @ 2010-02-02 20:02 UTC (permalink / raw)
  To: Uwe Papengut; +Cc: crossgcc, yann.morin.1998

> Hi Titus, Yann and all,
> 
> I wrote a short script for MacOS SL and crosstool-ng-1.6.0. I got an error
> with libtool, because the crosstool-ng/configure wrote:
> 
>   Checking for 'libtool'... no
>   libtool 1.5.26 or above was not found
> 
It simply looks for me as if you did not apply my patch.
Apply it or wait for it being integrated into ctng.

Regards
Titus

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-02 20:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-01  2:26 Help with Building toolchain with crosstool-ng on Mac OS X 10.6.2 (Snow Leopard) tvb377
2010-02-02 15:18 ` Building toolchain with crosstool-ng on Mac OS X 10.6.2 (SL) - libtool error Uwe Papengut
2010-02-02 20:02   ` Titus von Boxberg
2010-02-02 18:16 ` Help with Building toolchain with crosstool-ng on Mac OS X 10.6.2 (Snow Leopard) Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).